diff --git a/roles/xmonad/files/cmus/rc b/roles/xmonad/files/cmus/rc new file mode 100644 index 0000000..028ccb6 --- /dev/null +++ b/roles/xmonad/files/cmus/rc @@ -0,0 +1,4 @@ +update-cache +add ~/music + +colorscheme zenburn diff --git a/roles/xmonad/files/cmus/zenburn.theme b/roles/xmonad/files/cmus/zenburn.theme new file mode 100644 index 0000000..a7481b0 --- /dev/null +++ b/roles/xmonad/files/cmus/zenburn.theme @@ -0,0 +1,52 @@ +# Directory colors +set color_win_dir=108 + +# Normal text +set color_win_fg=188 + +# Window background color. +set color_win_bg=237 + +# Command line color. +set color_cmdline_bg=237 +set color_cmdline_fg=108 + +# Color of error messages displayed on the command line. +set color_error=lightred + +# Color of informational messages displayed on the command line. +set color_info=lightgreen + +# Color of the separator line between windows in view (1). +set color_separator=246 + +# Color of window titles (topmost line of the screen). +set color_win_title_bg=235 +set color_win_title_fg=174 + +# Status line color. +set color_statusline_bg=237 +set color_statusline_fg=142 + +# Color of currently playing track. +set color_win_cur=172 + +# Color of the line displaying currently playing track. +set color_titleline_bg=235 +set color_titleline_fg=144 + +# Color of the selected row which is also the currently playing track in active window. +set color_win_cur_sel_bg=235 +set color_win_cur_sel_fg=223 + +# Color of the selected row which is also the currently playing track in inactive window. +set color_win_inactive_cur_sel_bg=238 +set color_win_inactive_cur_sel_fg=116 + +# Color of selected row in active window. +set color_win_sel_bg=235 +set color_win_sel_fg=223 + +# Color of selected row in inactive window. +set color_win_inactive_sel_bg=238 +set color_win_inactive_sel_fg=116 diff --git a/roles/xmonad/files/xmonad_t460p.hs b/roles/xmonad/files/xmonad_t460p.hs index 97f8546..988616a 100644 --- a/roles/xmonad/files/xmonad_t460p.hs +++ b/roles/xmonad/files/xmonad_t460p.hs @@ -32,6 +32,7 @@ import XMonad.Util.NamedScratchpad import XMonad.Actions.TopicSpace import XMonad.Prompt import XMonad.Prompt.FuzzyMatch +import XMonad.Prompt.Shell import XMonad.Prompt.Workspace import XMonad.Hooks.WorkspaceHistory (workspaceHistoryHook) import XMonad.Hooks.DynamicProperty @@ -39,6 +40,7 @@ import qualified XMonad.StackSet as W import qualified Data.Map as M import Text.Regex.Posix import XMonad.Util.WorkspaceCompare ( getSortByIndex, filterOutWs ) +import Data.Maybe (fromMaybe) -- colours @@ -61,9 +63,10 @@ myModMask = mod4Mask myScratchpads :: [NamedScratchpad] myScratchpads = [ NS "keepassxc" "keepassxc ~/db.kdbx" (title =? "it factum Max Hohlfeld - KeePassXC" <||> title =? "db.kdbx [Gesperrt] - KeePassXC") defaultFloating - , NS "nnn" "st -t nnn -e nnnwrapper" (title =? "nnn") (customFloating $ W.RationalRect (1/4) (1/6) (2/4) (4/6)) - , NS "vimwiki" "st -t vimwiki -e vwwrapper" (title =? "vimwiki") (customFloating $ W.RationalRect (1/6) (1/6) (2/3) (2/3)) + , NS "nnn" "alacritty -t nnn -e nnnwrapper" (title =? "nnn") (customFloating $ W.RationalRect (1/4) (1/6) (2/4) (4/6)) + , NS "vimwiki" "alacritty -t vimwiki -e vwwrapper" (title =? "vimwiki") (customFloating $ W.RationalRect (1/6) (1/6) (2/3) (2/3)) , NS "pavucontrol" "pavucontrol" (title =? "Lautstärkeregler") (customFloating $ W.RationalRect (1/6) (1/6) (2/3) (2/3)) + , NS "cmus" "alacritty -t 'cmus' -e cmus" (title =? "cmus") (customFloating $ W.RationalRect (1/6) (1/6) (2/3) (2/3)) ] -- Topic Space @@ -123,10 +126,11 @@ topicPrompt = def , bgHLight = red , alwaysHighlight = True -- Current best match , height = 25 - , position = Top + , position = CenteredAt 0.45 0.3 , promptBorderWidth = myBorderWidth -- Fit in with rest of config , borderColor = red - , maxComplRows = Just 5 -- Max rows to show in completion window + , maxComplRows = Just 10 -- Max rows to show in completion window + , maxComplColumns = Just 1 , searchPredicate = fuzzyMatch , sorter = fuzzySort } @@ -152,12 +156,14 @@ myAdditionalKeys = , ("M-", spawn "dm-recent-aliases") , ("M-p s", spawn "dm-screenshot") , ("M-p k", spawn "dm-kill") + , ("M-p p", shellPrompt topicPrompt) -- scratchpads , ("M-n", namedScratchpadAction myScratchpads "nnn") , ("M-S-a", namedScratchpadAction myScratchpads "keepassxc") , ("M-s v", namedScratchpadAction myScratchpads "vimwiki") , ("M-s a", namedScratchpadAction myScratchpads "pavucontrol") + , ("M-s c", namedScratchpadAction myScratchpads "cmus") -- open terminal , ("M-S-", spawnShell) @@ -201,7 +207,6 @@ myLayout = avoidStruts $ tiling ||| hacking ||| full tiling = renamed [Replace "Tall"] $ smartBorders $ mySpacing 6 $ Tall 1 (3/100) (1/2) hacking = renamed [Replace "Programming"] $ smartBorders $ mySpacing 6 $ Tall 1 (3/100) (5/8) full = noBorders Full - -- Regex lifted up to use in manageHook (*!?) :: Functor f => f String -> String -> f Bool q *!? x = fmap (=~ x) q @@ -215,6 +220,11 @@ myManageHook = composeAll . concat $ -- float specific classes , [ className =? c --> doFloat | c <- myFloatingClasses ] + -- safeyes + , [ title =? "SafeEyes-0" --> maybe mempty doShift =<< liftX (screenWorkspace 1) ] + , [ title =? "SafeEyes-1" --> maybe mempty doShift =<< liftX (screenWorkspace 2) ] + , [ className =? "Safeeyes" --> doFloat ] + -- scratchpads , [ namedScratchpadManageHook myScratchpads ] ] diff --git a/roles/xmonad/tasks/main.yml b/roles/xmonad/tasks/main.yml index 7942ffa..ef65436 100644 --- a/roles/xmonad/tasks/main.yml +++ b/roles/xmonad/tasks/main.yml @@ -8,6 +8,7 @@ - alacritty - dunst - redshift + - cmus state: present become: true tags: pc @@ -33,6 +34,7 @@ - ~/.config/xmonad - ~/.config/xmobar - ~/.config/dunst + - ~/.config/cmus tags: pc - name: Copy over alacritty config @@ -49,6 +51,14 @@ mode: '0644' tags: pc +- name: Copy over cmus config + ansible.builtin.copy: + src: "{{ item }}" + dest: "~/.config/cmus/" + mode: '0644' + with_fileglob: "cmus/*" + tags: pc + - name: Copy over T460p config files ansible.builtin.copy: src: "{{ item.src }}"