Adding NamedActions to xmonad to display all keybindings.

This commit is contained in:
Derek Taylor
2022-06-19 20:05:29 -05:00
parent 780cfcce88
commit dad192b689
2 changed files with 516 additions and 513 deletions
+258 -256
View File
@@ -168,33 +168,33 @@ These are commands we want XMonad to execute on startup, such as running a compo
#+BEGIN_SRC haskell #+BEGIN_SRC haskell
myStartupHook :: X () myStartupHook :: X ()
myStartupHook = do myStartupHook = do
spawnOnce (mySoundPlayer ++ startupSound) spawnOnce (mySoundPlayer ++ startupSound)
spawn "killall conky" -- kill current conky on each restart spawn "killall conky" -- kill current conky on each restart
spawn "killall trayer" -- kill current trayer on each restart spawn "killall trayer" -- kill current trayer on each restart
#+END_SRC #+END_SRC
#+BEGIN_SRC haskell #+BEGIN_SRC haskell
spawnOnce "lxsession" spawnOnce "lxsession"
spawnOnce "picom" spawnOnce "picom"
spawnOnce "nm-applet" spawnOnce "nm-applet"
spawnOnce "volumeicon" spawnOnce "volumeicon"
spawn "/usr/bin/emacs --daemon" -- emacs daemon for the emacsclient spawn "/usr/bin/emacs --daemon" -- emacs daemon for the emacsclient
#+END_SRC #+END_SRC
We killed any running conky and trayer processes earlier in the autostart, so now we sleep for 2 seconds and then restart conky and trayer. We killed any running conky and trayer processes earlier in the autostart, so now we sleep for 2 seconds and then restart conky and trayer.
#+BEGIN_SRC haskell #+BEGIN_SRC haskell
spawn ("sleep 2 && conky -c $HOME/.config/conky/xmonad/" ++ colorScheme ++ "-01.conkyrc") spawn ("sleep 2 && conky -c $HOME/.config/conky/xmonad/" ++ colorScheme ++ "-01.conkyrc")
spawn ("sleep 2 && trayer --edge top --align right --widthtype request --padding 6 --SetDockType true --SetPartialStrut true --expand true --monitor 1 --transparent true --alpha 0 " ++ colorTrayer ++ " --height 22") spawn ("sleep 2 && trayer --edge top --align right --widthtype request --padding 6 --SetDockType true --SetPartialStrut true --expand true --monitor 1 --transparent true --alpha 0 " ++ colorTrayer ++ " --height 22")
#+END_SRC #+END_SRC
Select only =ONE= of the following four ways to set the wallpaper. Select only =ONE= of the following four ways to set the wallpaper.
#+BEGIN_SRC haskell #+BEGIN_SRC haskell
spawnOnce "xargs xwallpaper --stretch < ~/.cache/wall" spawnOnce "xargs xwallpaper --stretch < ~/.cache/wall"
-- spawnOnce "~/.fehbg &" -- set last saved feh wallpaper -- spawnOnce "~/.fehbg &" -- set last saved feh wallpaper
-- spawnOnce "feh --randomize --bg-fill ~/wallpapers/*" -- feh set random wallpaper -- spawnOnce "feh --randomize --bg-fill ~/wallpapers/*" -- feh set random wallpaper
-- spawnOnce "nitrogen --restore &" -- if you prefer nitrogen to feh -- spawnOnce "nitrogen --restore &" -- if you prefer nitrogen to feh
setWMName "LG3D" setWMName "LG3D"
#+END_SRC #+END_SRC
* Gridselect * Gridselect
@@ -203,11 +203,11 @@ GridSelect displays items (programs, open windows, etc.) in a 2D grid and lets t
#+BEGIN_SRC haskell #+BEGIN_SRC haskell
myColorizer :: Window -> Bool -> X (String, String) myColorizer :: Window -> Bool -> X (String, String)
myColorizer = colorRangeFromClassName myColorizer = colorRangeFromClassName
(0x28,0x2c,0x34) -- lowest inactive bg (0x28,0x2c,0x34) -- lowest inactive bg
(0x28,0x2c,0x34) -- highest inactive bg (0x28,0x2c,0x34) -- highest inactive bg
(0xc7,0x92,0xea) -- active bg (0xc7,0x92,0xea) -- active bg
(0xc0,0xa7,0x9a) -- inactive fg (0xc0,0xa7,0x9a) -- inactive fg
(0x28,0x2c,0x34) -- active fg (0x28,0x2c,0x34) -- active fg
-- gridSelect menu layout -- gridSelect menu layout
mygridConfig :: p -> GSConfig Window mygridConfig :: p -> GSConfig Window
@@ -232,18 +232,18 @@ spawnSelected' lst = gridselect conf lst >>= flip whenJust spawn
} }
myAppGrid = [ ("Audacity", "audacity") myAppGrid = [ ("Audacity", "audacity")
, ("Deadbeef", "deadbeef") , ("Deadbeef", "deadbeef")
, ("Emacs", "emacsclient -c -a emacs") , ("Emacs", "emacsclient -c -a emacs")
, ("Firefox", "firefox") , ("Firefox", "firefox")
, ("Geany", "geany") , ("Geany", "geany")
, ("Geary", "geary") , ("Geary", "geary")
, ("Gimp", "gimp") , ("Gimp", "gimp")
, ("Kdenlive", "kdenlive") , ("Kdenlive", "kdenlive")
, ("LibreOffice Impress", "loimpress") , ("LibreOffice Impress", "loimpress")
, ("LibreOffice Writer", "lowriter") , ("LibreOffice Writer", "lowriter")
, ("OBS", "obs") , ("OBS", "obs")
, ("PCManFM", "pcmanfm") , ("PCManFM", "pcmanfm")
] ]
#+END_SRC #+END_SRC
* Scratchpads * Scratchpads
@@ -382,27 +382,30 @@ myTabTheme = def { fontName = myFont
-- Theme for showWName which prints current workspace when you change workspaces. -- Theme for showWName which prints current workspace when you change workspaces.
myShowWNameTheme :: SWNConfig myShowWNameTheme :: SWNConfig
myShowWNameTheme = def myShowWNameTheme = def
{ swn_font = "xft:Ubuntu:bold:size=60" { swn_font = "xft:Ubuntu:bold:size=60"
, swn_fade = 1.0 , swn_fade = 1.0
, swn_bgcolor = "#1c1f24" , swn_bgcolor = "#1c1f24"
, swn_color = "#ffffff" , swn_color = "#ffffff"
} }
-- The layout hook -- The layout hook
myLayoutHook = avoidStruts $ mouseResize $ windowArrange $ T.toggleLayouts floats myLayoutHook = avoidStruts
$ mouseResize
$ windowArrange
$ T.toggleLayouts floats
$ mkToggle (NBFULL ?? NOBORDERS ?? EOT) myDefaultLayout $ mkToggle (NBFULL ?? NOBORDERS ?? EOT) myDefaultLayout
where where
myDefaultLayout = withBorder myBorderWidth tall myDefaultLayout = withBorder myBorderWidth tall
||| magnify ||| magnify
||| noBorders monocle ||| noBorders monocle
||| floats ||| floats
||| noBorders tabs ||| noBorders tabs
||| grid ||| grid
||| spirals ||| spirals
||| threeCol ||| threeCol
||| threeRow ||| threeRow
||| tallAccordion ||| tallAccordion
||| wideAccordion ||| wideAccordion
#+END_SRC #+END_SRC
* Workspaces * Workspaces
@@ -423,30 +426,30 @@ Sets some rules for certain programs. Examples include forcing certain programs
#+BEGIN_SRC haskell #+BEGIN_SRC haskell
myManageHook :: XMonad.Query (Data.Monoid.Endo WindowSet) myManageHook :: XMonad.Query (Data.Monoid.Endo WindowSet)
myManageHook = composeAll myManageHook = composeAll
-- 'doFloat' forces a window to float. Useful for dialog boxes and such. -- 'doFloat' forces a window to float. Useful for dialog boxes and such.
-- using 'doShift ( myWorkspaces !! 7)' sends program to workspace 8! -- using 'doShift ( myWorkspaces !! 7)' sends program to workspace 8!
-- I'm doing it this way because otherwise I would have to write out the full -- I'm doing it this way because otherwise I would have to write out the full
-- name of my workspaces and the names would be very long if using clickable workspaces. -- name of my workspaces and the names would be very long if using clickable workspaces.
[ className =? "confirm" --> doFloat [ className =? "confirm" --> doFloat
, className =? "file_progress" --> doFloat , className =? "file_progress" --> doFloat
, className =? "dialog" --> doFloat , className =? "dialog" --> doFloat
, className =? "download" --> doFloat , className =? "download" --> doFloat
, className =? "error" --> doFloat , className =? "error" --> doFloat
, className =? "Gimp" --> doFloat , className =? "Gimp" --> doFloat
, className =? "notification" --> doFloat , className =? "notification" --> doFloat
, className =? "pinentry-gtk-2" --> doFloat , className =? "pinentry-gtk-2" --> doFloat
, className =? "splash" --> doFloat , className =? "splash" --> doFloat
, className =? "toolbar" --> doFloat , className =? "toolbar" --> doFloat
, className =? "Yad" --> doCenterFloat , className =? "Yad" --> doCenterFloat
, title =? "Oracle VM VirtualBox Manager" --> doFloat , title =? "Oracle VM VirtualBox Manager" --> doFloat
, title =? "Mozilla Firefox" --> doShift ( myWorkspaces !! 1 ) , title =? "Mozilla Firefox" --> doShift ( myWorkspaces !! 1 )
, className =? "Brave-browser" --> doShift ( myWorkspaces !! 1 ) , className =? "Brave-browser" --> doShift ( myWorkspaces !! 1 )
, className =? "mpv" --> doShift ( myWorkspaces !! 7 ) , className =? "mpv" --> doShift ( myWorkspaces !! 7 )
, className =? "Gimp" --> doShift ( myWorkspaces !! 8 ) , className =? "Gimp" --> doShift ( myWorkspaces !! 8 )
, className =? "VirtualBox Manager" --> doShift ( myWorkspaces !! 4 ) , className =? "VirtualBox Manager" --> doShift ( myWorkspaces !! 4 )
, (className =? "firefox" <&&> resource =? "Dialog") --> doFloat -- Float Firefox Dialog , (className =? "firefox" <&&> resource =? "Dialog") --> doFloat -- Float Firefox Dialog
, isFullscreen --> doFullFloat , isFullscreen --> doFullFloat
] <+> namedScratchpadManageHook myScratchPads ] <+> namedScratchpadManageHook myScratchPads
#+END_SRC #+END_SRC
* System Sounds * System Sounds
@@ -464,9 +467,9 @@ Available sounds that are part of the default =dtos-sounds= package include:
#+begin_src haskell #+begin_src haskell
soundDir = "/opt/dtos-sounds/" -- The directory that has the sound files soundDir = "/opt/dtos-sounds/" -- The directory that has the sound files
startupSound = soundDir ++ "startup-01.mp3" startupSound = soundDir ++ "startup-01.mp3"
shutdownSound = soundDir ++ "shutdown-01.mp3" shutdownSound = soundDir ++ "shutdown-01.mp3"
dmenuSound = soundDir ++ "menu-01.mp3" dmenuSound = soundDir ++ "menu-01.mp3"
#+end_src #+end_src
* Keybindings * Keybindings
@@ -500,156 +503,155 @@ I am using the Xmonad.Util.EZConfig module which allows keybindings to be writte
#+BEGIN_SRC haskell #+BEGIN_SRC haskell
showKeybindings :: [((KeyMask, KeySym), NamedAction)] -> NamedAction showKeybindings :: [((KeyMask, KeySym), NamedAction)] -> NamedAction
showKeybindings x = addName "Show Keybindings" $ io $ do showKeybindings x = addName "Show Keybindings" $ io $ do
h <- spawnPipe $ "yad --text-info --fontname=" ++ myFont ++ " --width 800 --height 600 --center --title \"XMonad keybindings\"" h <- spawnPipe $ "yad --text-info --fontname=\"SauceCodePro Nerd Font Mono 12\" --width 800 --height 600 --center --title \"XMonad keybindings\""
hPutStr h (unlines $ showKm x) hPutStr h (unlines $ showKm x)
hClose h hClose h
return () return ()
myKeys :: XConfig l0 -> [((KeyMask, KeySym), NamedAction)] myKeys :: XConfig l0 -> [((KeyMask, KeySym), NamedAction)]
myKeys c = (subtitle "Custom Keys":) $ mkNamedKeymap c $ myKeys c = (subtitle "Custom Keys":) $ mkNamedKeymap c $
-- KB_GROUP Xmonad
[ ("M-C-r", addName "Recompile XMonad" $ spawn "xmonad --recompile")
, ("M-S-r", addName "Restart XMonad" $ spawn "xmonad --restart")
, ("M-S-q", addName "Quit XMonad" $ sequence_ [spawn (mySoundPlayer ++ shutdownSound), io exitSuccess])
, ("M-S-/", addName "List all keybindings" $ spawn "~/.xmonad/xmonad_keys.sh")
, ("M-/", addName "DTOS Help" $ spawn "dtos-help")
, ("M-S-<Return>", addName "Run prompt" $ sequence_ [spawn (mySoundPlayer ++ dmenuSound), spawn "dm-run"])
-- In Xmonad and many tiling window managers, M-p is the default keybinding to
-- launch dmenu_run, so I've decided to use M-p plus KEY for these dmenu scripts.
, ("M-p h", addName "List all dmscripts" $ spawn "dm-hub")
, ("M-p a", addName "Choose ambient sound" $ spawn "dm-sounds")
, ("M-p b", addName "Set background" $ spawn "dm-setbg")
, ("M-p c", addName "Choose color scheme" $ spawn "dtos-colorscheme")
, ("M-p C", addName "Pick color from scheme" $ spawn "dm-colpick")
, ("M-p e", addName "Edit config files" $ spawn "dm-confedit")
, ("M-p i", addName "Take a screenshot" $ spawn "dm-maim")
, ("M-p k", addName "Kill processes" $ spawn "dm-kill")
, ("M-p m", addName "View manpages" $ spawn "dm-man")
, ("M-p n", addName "Store and copy notes" $ spawn "dm-note")
, ("M-p o", addName "Browser bookmarks" $ spawn "dm-bookman")
, ("M-p p", addName "Passmenu" $ spawn "passmenu -p \"Pass: \"")
, ("M-p q", addName "Logout Menu" $ spawn "dm-logout")
, ("M-p r", addName "Listen to online radio" $ spawn "dm-radio")
, ("M-p s", addName "Search various engines" $ spawn "dm-websearch")
, ("M-p t", addName "Translate text" $ spawn "dm-translate")
-- KB_GROUP Xmonad -- KB_GROUP Useful programs to have a keybinding for launch
[ ("M-C-r", addName "Recompile XMonad" $ spawn "xmonad --recompile") , ("M-<Return>", addName "Launch terminal" $ spawn (myTerminal))
, ("M-S-r", addName "Restart XMonad" $ spawn "xmonad --restart") , ("M-b", addName "Launch web browser" $ spawn (myBrowser))
, ("M-S-q", addName "Quit XMonad" $ sequence_ [spawn (mySoundPlayer ++ shutdownSound), io exitSuccess]) , ("M-M1-h", addName "Launch htop" $ spawn (myTerminal ++ " -e htop"))
, ("M-S-/", addName "List all keybindings" $ spawn "~/.xmonad/xmonad_keys.sh")
, ("M-/", addName "DTOS Help" $ spawn "dtos-help")
, ("M-S-<Return>", addName "Run prompt" $ sequence_ [spawn (mySoundPlayer ++ dmenuSound), spawn "dm-run"])
-- In Xmonad and many tiling window managers, M-p is the default keybinding to
-- launch dmenu_run, so I've decided to use M-p plus KEY for these dmenu scripts.
, ("M-p h", addName "List all dmscripts" $ spawn "dm-hub")
, ("M-p a", addName "Choose ambient sound" $ spawn "dm-sounds")
, ("M-p b", addName "Set background" $ spawn "dm-setbg")
, ("M-p c", addName "Choose color scheme" $ spawn "dtos-colorscheme")
, ("M-p C", addName "Pick color from scheme" $ spawn "dm-colpick")
, ("M-p e", addName "Edit config files" $ spawn "dm-confedit")
, ("M-p i", addName "Take a screenshot" $ spawn "dm-maim")
, ("M-p k", addName "Kill processes" $ spawn "dm-kill")
, ("M-p m", addName "View manpages" $ spawn "dm-man")
, ("M-p n", addName "Store and copy notes" $ spawn "dm-note")
, ("M-p o", addName "Browser bookmarks" $ spawn "dm-bookman")
, ("M-p p", addName "Passmenu" $ spawn "passmenu -p \"Pass: \"")
, ("M-p q", addName "Logout Menu" $ spawn "dm-logout")
, ("M-p r", addName "Listen to online radio" $ spawn "dm-radio")
, ("M-p s", addName "Search various engines" $ spawn "dm-websearch")
, ("M-p t", addName "Translate text" $ spawn "dm-translate")
-- KB_GROUP Useful programs to have a keybinding for launch -- KB_GROUP Kill windows
, ("M-<Return>", addName "Launch terminal" $ spawn (myTerminal)) , ("M-S-c", addName "Kill focused window" $ kill1)
, ("M-b", addName "Launch web browser" $ spawn (myBrowser)) , ("M-S-a", addName "Kill all windows on WS" $ killAll)
, ("M-M1-h", addName "Launch htop" $ spawn (myTerminal ++ " -e htop"))
-- KB_GROUP Kill windows -- KB_GROUP Workspaces
, ("M-S-c", addName "Kill focused window" $ kill1) , ("M-.", addName "Switch focus to next mon" $ nextScreen)
, ("M-S-a", addName "Kill all windows on WS" $ killAll) , ("M-,", addName "Switch focus to prev mon" $ prevScreen)
, ("M-S-<KP_Add>"
, addName "Move window to next WS" $ shiftTo Next nonNSP >> moveTo Next nonNSP)
, ("M-S-<KP_Subtract>"
, addName "Move window to prev WS" $ shiftTo Prev nonNSP >> moveTo Prev nonNSP)
-- KB_GROUP Workspaces -- KB_GROUP Floating windows
, ("M-.", addName "Switch focus to next mon" $ nextScreen) , ("M-f", addName "Toggle float layout" $ sendMessage (T.Toggle "floats"))
, ("M-,", addName "Switch focus to prev mon" $ prevScreen) , ("M-t", addName "Sink a floating window" $ withFocused $ windows . W.sink)
, ("M-S-<KP_Add>" , ("M-S-t", addName "Sink all floated windows" $ sinkAll)
, addName "Move window to next WS" $ shiftTo Next nonNSP >> moveTo Next nonNSP)
, ("M-S-<KP_Subtract>"
, addName "Move window to prev WS" $ shiftTo Prev nonNSP >> moveTo Prev nonNSP)
-- KB_GROUP Floating windows -- KB_GROUP Increase/decrease spacing (gaps)
, ("M-f", addName "Toggle float layout" $ sendMessage (T.Toggle "floats")) , ("C-M1-j", addName "Decrease window spacing" $ decWindowSpacing 4)
, ("M-t", addName "Sink a floating window" $ withFocused $ windows . W.sink) , ("C-M1-k", addName "Increase window spacing" $ incWindowSpacing 4)
, ("M-S-t", addName "Sink all floated windows" $ sinkAll) , ("C-M1-h", addName "Decrease screen spacing" $ decScreenSpacing 4)
, ("C-M1-l", addName "Increase screen spacing" $ incScreenSpacing 4)
-- KB_GROUP Increase/decrease spacing (gaps) -- KB_GROUP Grid Select (CTR-g followed by a key)
, ("C-M1-j", addName "Decrease window spacing" $ decWindowSpacing 4) , ("C-g g", addName "Select favorite apps" $ spawnSelected' myAppGrid)
, ("C-M1-k", addName "Increase window spacing" $ incWindowSpacing 4) , ("C-g t", addName "Goto selected window" $ goToSelected $ mygridConfig myColorizer)
, ("C-M1-h", addName "Decrease screen spacing" $ decScreenSpacing 4) , ("C-g b", addName "Bring selected window" $ bringSelected $ mygridConfig myColorizer)
, ("C-M1-l", addName "Increase screen spacing" $ incScreenSpacing 4)
-- KB_GROUP Grid Select (CTR-g followed by a key) -- KB_GROUP Windows navigation
, ("C-g g", addName "Select favorite apps" $ spawnSelected' myAppGrid) , ("M-m", addName "Move focus to master window" $ windows W.focusMaster)
, ("C-g t", addName "Goto selected window" $ goToSelected $ mygridConfig myColorizer) , ("M-j", addName "Move focus to next window" $ windows W.focusDown)
, ("C-g b", addName "Bring selected window" $ bringSelected $ mygridConfig myColorizer) , ("M-k", addName "Move focus to prev window" $ windows W.focusUp)
, ("M-S-m", addName "Swap focused window with master window" $ windows W.swapMaster)
, ("M-S-j", addName "Swap focused window with next window" $ windows W.swapDown)
, ("M-S-k", addName "Swap focused window with prev window" $ windows W.swapUp)
, ("M-<Backspace>", addName "Move focused window to master" $ promote)
, ("M-S-<Tab>", addName "Rotate all windows except master" $ rotSlavesDown)
, ("M-C-<Tab>", addName "Rotate all windows current stack" $ rotAllDown)
-- KB_GROUP Windows navigation -- KB_GROUP Layouts
, ("M-m", addName "" $ windows W.focusMaster) -- Move focus to the master window , ("M-<Tab>", addName "Switch to next layout" $ sendMessage NextLayout)
, ("M-j", addName "" $ windows W.focusDown) -- Move focus to the next window , ("M-<Space>", addName "Toggle noborders/full" $ sendMessage (MT.Toggle NBFULL) >> sendMessage ToggleStruts)
, ("M-k", addName "" $ windows W.focusUp) -- Move focus to the prev window
, ("M-S-m", addName "" $ windows W.swapMaster) -- Swap the focused window and the master window
, ("M-S-j", addName "" $ windows W.swapDown) -- Swap focused window with next window
, ("M-S-k", addName "" $ windows W.swapUp) -- Swap focused window with prev window
, ("M-<Backspace>", addName "" $ promote) -- Moves focused window to master, others maintain order
, ("M-S-<Tab>", addName "" $ rotSlavesDown) -- Rotate all windows except master and keep focus in place
, ("M-C-<Tab>", addName "" $ rotAllDown) -- Rotate all the windows in the current stack
-- KB_GROUP Layouts -- KB_GROUP Increase/decrease windows in the master pane or the stack
, ("M-<Tab>", addName "" $ sendMessage NextLayout) -- Switch to next layout , ("M-S-<Up>", addName "Increase clients in master pane" $ sendMessage (IncMasterN 1))
, ("M-<Space>", addName "" $ sendMessage (MT.Toggle NBFULL) >> sendMessage ToggleStruts) -- Toggles noborder/full , ("M-S-<Down>", addName "Decrease clients in master pane" $ sendMessage (IncMasterN (-1)))
, ("M-C-<Up>", addName "Increase # of windows" $ increaseLimit)
, ("M-C-<Down>", addName "Decrease # of windows" $ decreaseLimit)
-- KB_GROUP Increase/decrease windows in the master pane or the stack -- KB_GROUP Window resizing
, ("M-S-<Up>", addName "" $ sendMessage (IncMasterN 1)) -- Increase # of clients master pane , ("M-h", addName "Shrink window" $ sendMessage Shrink)
, ("M-S-<Down>", addName "" $ sendMessage (IncMasterN (-1))) -- Decrease # of clients master pane , ("M-l", addName "Expand window" $ sendMessage Expand)
, ("M-C-<Up>", addName "" $ increaseLimit) -- Increase # of windows , ("M-M1-j", addName "Shrink window vertically" $ sendMessage MirrorShrink)
, ("M-C-<Down>", addName "" $ decreaseLimit) -- Decrease # of windows , ("M-M1-k", addName "Expand window vertically" $ sendMessage MirrorExpand)
-- KB_GROUP Window resizing -- KB_GROUP Sublayouts
, ("M-h", addName "Shrink window" $ sendMessage Shrink) -- Shrink horiz window width -- This is used to push windows to tabbed sublayouts, or pull them out of it.
, ("M-l", addName "Expand window" $ sendMessage Expand) -- Expand horiz window width , ("M-C-h", addName "" $ sendMessage $ pullGroup L)
, ("M-M1-j", addName "Shrink window vertically" $ sendMessage MirrorShrink) -- Shrink vert window width , ("M-C-l", addName "" $ sendMessage $ pullGroup R)
, ("M-M1-k", addName "Expand window vertically" $ sendMessage MirrorExpand) -- Expand vert window width , ("M-C-k", addName "" $ sendMessage $ pullGroup U)
, ("M-C-j", addName "" $ sendMessage $ pullGroup D)
, ("M-C-m", addName "" $ withFocused (sendMessage . MergeAll))
-- , ("M-C-u", withFocused (sendMessage . UnMerge))
, ("M-C-/", addName "" $ withFocused (sendMessage . UnMergeAll))
, ("M-C-.", addName "" $ onGroup W.focusUp') -- Switch focus to next tab
, ("M-C-,", addName "" $ onGroup W.focusDown') -- Switch focus to prev tab
-- KB_GROUP Sublayouts -- KB_GROUP Scratchpads
-- This is used to push windows to tabbed sublayouts, or pull them out of it. -- Toggle show/hide these programs. They run on a hidden workspace.
, ("M-C-h", addName "" $ sendMessage $ pullGroup L) -- When you toggle them to show, it brings them to your current workspace.
, ("M-C-l", addName "" $ sendMessage $ pullGroup R) -- Toggle them to hide and it sends them back to hidden workspace (NSP).
, ("M-C-k", addName "" $ sendMessage $ pullGroup U) , ("M-s t", addName "Toggle scratchpad terminal" $ namedScratchpadAction myScratchPads "terminal")
, ("M-C-j", addName "" $ sendMessage $ pullGroup D) , ("M-s m", addName "Toggle scratchpad mocp" $ namedScratchpadAction myScratchPads "mocp")
, ("M-C-m", addName "" $ withFocused (sendMessage . MergeAll)) , ("M-s c", addName "Toggle scratchpad calculator" $ namedScratchpadAction myScratchPads "calculator")
-- , ("M-C-u", withFocused (sendMessage . UnMerge))
, ("M-C-/", addName "" $ withFocused (sendMessage . UnMergeAll))
, ("M-C-.", addName "" $ onGroup W.focusUp') -- Switch focus to next tab
, ("M-C-,", addName "" $ onGroup W.focusDown') -- Switch focus to prev tab
-- KB_GROUP Scratchpads -- KB_GROUP Controls for mocp music player (SUPER-u followed by a key)
-- Toggle show/hide these programs. They run on a hidden workspace. , ("M-u p", addName "" $ spawn "mocp --play")
-- When you toggle them to show, it brings them to your current workspace. , ("M-u l", addName "" $ spawn "mocp --next")
-- Toggle them to hide and it sends them back to hidden workspace (NSP). , ("M-u h", addName "" $ spawn "mocp --previous")
, ("M-s t", addName "" $ namedScratchpadAction myScratchPads "terminal") , ("M-u <Space>", addName "" $ spawn "mocp --toggle-pause")
, ("M-s m", addName "" $ namedScratchpadAction myScratchPads "mocp")
, ("M-s c", addName "" $ namedScratchpadAction myScratchPads "calculator")
-- KB_GROUP Controls for mocp music player (SUPER-u followed by a key) -- KB_GROUP Emacs (SUPER-e followed by a key)
, ("M-u p", addName "" $ spawn "mocp --play") , ("M-e e", addName "Emacsclient Dashboard" $ spawn (myEmacs ++ ("--eval '(dashboard-refresh-buffer)'"))) -- emacs dashboard
, ("M-u l", addName "" $ spawn "mocp --next") , ("M-e b", addName "Emacsclient Ibuffer" $ spawn (myEmacs ++ ("--eval '(ibuffer)'"))) -- list buffers
, ("M-u h", addName "" $ spawn "mocp --previous") , ("M-e d", addName "Emacsclient Dired" $ spawn (myEmacs ++ ("--eval '(dired nil)'"))) -- dired
, ("M-u <Space>", addName "" $ spawn "mocp --toggle-pause") , ("M-e i", addName "Emacsclient ERC (IRC)" $ spawn (myEmacs ++ ("--eval '(erc)'"))) -- erc irc client
, ("M-e n", addName "Emacsclient Elfeed (RSS)" $ spawn (myEmacs ++ ("--eval '(elfeed)'"))) -- elfeed rss
, ("M-e s", addName "Emacsclient Eshell" $ spawn (myEmacs ++ ("--eval '(eshell)'"))) -- eshell
, ("M-e t", addName "Emacsclient Mastodon" $ spawn (myEmacs ++ ("--eval '(mastodon)'"))) -- mastodon.el
, ("M-e v", addName "Emacsclient Vterm" $ spawn (myEmacs ++ ("--eval '(+vterm/here nil)'"))) -- vterm if on Doom Emacs
, ("M-e w", addName "Emacsclient EWW browser" $ spawn (myEmacs ++ ("--eval '(doom/window-maximize-buffer(eww \"distro.tube\"))'"))) -- eww browser if on Doom Emacs
, ("M-e a", addName "Emacsclient EMMS (music)" $ spawn (myEmacs ++ ("--eval '(emms)' --eval '(emms-play-directory-tree \"~/Music/\")'")))
-- KB_GROUP Emacs (SUPER-e followed by a key) -- KB_GROUP Multimedia Keys
, ("M-e e", addName "" $ spawn (myEmacs ++ ("--eval '(dashboard-refresh-buffer)'"))) -- emacs dashboard , ("<XF86AudioPlay>", addName "" $ spawn "mocp --play")
, ("M-e b", addName "" $ spawn (myEmacs ++ ("--eval '(ibuffer)'"))) -- list buffers , ("<XF86AudioPrev>", addName "" $ spawn "mocp --previous")
, ("M-e d", addName "" $ spawn (myEmacs ++ ("--eval '(dired nil)'"))) -- dired , ("<XF86AudioNext>", addName "" $ spawn "mocp --next")
, ("M-e i", addName "" $ spawn (myEmacs ++ ("--eval '(erc)'"))) -- erc irc client , ("<XF86AudioMute>", addName "" $ spawn "amixer set Master toggle")
, ("M-e n", addName "" $ spawn (myEmacs ++ ("--eval '(elfeed)'"))) -- elfeed rss , ("<XF86AudioLowerVolume>", addName "" $ spawn "amixer set Master 5%- unmute")
, ("M-e s", addName "" $ spawn (myEmacs ++ ("--eval '(eshell)'"))) -- eshell , ("<XF86AudioRaiseVolume>", addName "" $ spawn "amixer set Master 5%+ unmute")
, ("M-e t", addName "" $ spawn (myEmacs ++ ("--eval '(mastodon)'"))) -- mastodon.el , ("<XF86HomePage>", addName "" $ spawn "qutebrowser https://www.youtube.com/c/DistroTube")
, ("M-e v", addName "" $ spawn (myEmacs ++ ("--eval '(+vterm/here nil)'"))) -- vterm if on Doom Emacs , ("<XF86Search>", addName "" $ spawn "dm-websearch")
, ("M-e w", addName "" $ spawn (myEmacs ++ ("--eval '(doom/window-maximize-buffer(eww \"distro.tube\"))'"))) -- eww browser if on Doom Emacs , ("<XF86Mail>", addName "" $ runOrRaise "thunderbird" (resource =? "thunderbird"))
, ("M-e a", addName "" $ spawn (myEmacs ++ ("--eval '(emms)' --eval '(emms-play-directory-tree \"~/Music/\")'"))) , ("<XF86Calculator>", addName "" $ runOrRaise "qalculate-gtk" (resource =? "qalculate-gtk"))
, ("<XF86Eject>", addName "" $ spawn "toggleeject")
, ("<Print>", addName "" $ spawn "dm-maim")
]
-- The following lines are needed for named scratchpads.
where nonNSP = WSIs (return (\ws -> W.tag ws /= "NSP"))
nonEmptyNonNSP = WSIs (return (\ws -> isJust (W.stack ws) && W.tag ws /= "NSP"))
-- KB_GROUP Multimedia Keys
, ("<XF86AudioPlay>", addName "" $ spawn "mocp --play")
, ("<XF86AudioPrev>", addName "" $ spawn "mocp --previous")
, ("<XF86AudioNext>", addName "" $ spawn "mocp --next")
, ("<XF86AudioMute>", addName "" $ spawn "amixer set Master toggle")
, ("<XF86AudioLowerVolume>", addName "" $ spawn "amixer set Master 5%- unmute")
, ("<XF86AudioRaiseVolume>", addName "" $ spawn "amixer set Master 5%+ unmute")
, ("<XF86HomePage>", addName "" $ spawn "qutebrowser https://www.youtube.com/c/DistroTube")
, ("<XF86Search>", addName "" $ spawn "dm-websearch")
, ("<XF86Mail>", addName "" $ runOrRaise "thunderbird" (resource =? "thunderbird"))
, ("<XF86Calculator>", addName "" $ runOrRaise "qalculate-gtk" (resource =? "qalculate-gtk"))
, ("<XF86Eject>", addName "" $ spawn "toggleeject")
, ("<Print>", addName "" $ spawn "dm-maim")
]
-- The following lines are needed for named scratchpads.
where nonNSP = WSIs (return (\ws -> W.tag ws /= "NSP"))
nonEmptyNonNSP = WSIs (return (\ws -> isJust (W.stack ws) && W.tag ws /= "NSP"))
-- END_KEYS
#+END_SRC #+END_SRC
* Main * Main
@@ -658,52 +660,52 @@ This is the "main" of XMonad. This where everything in our configs comes togethe
#+BEGIN_SRC haskell #+BEGIN_SRC haskell
main :: IO () main :: IO ()
main = do main = do
-- Launching three instances of xmobar on their monitors. -- Launching three instances of xmobar on their monitors.
xmproc0 <- spawnPipe ("xmobar -x 0 $HOME/.config/xmobar/" ++ colorScheme ++ "-xmobarrc") xmproc0 <- spawnPipe ("xmobar -x 0 $HOME/.config/xmobar/" ++ colorScheme ++ "-xmobarrc")
xmproc1 <- spawnPipe ("xmobar -x 1 $HOME/.config/xmobar/" ++ colorScheme ++ "-xmobarrc") xmproc1 <- spawnPipe ("xmobar -x 1 $HOME/.config/xmobar/" ++ colorScheme ++ "-xmobarrc")
xmproc2 <- spawnPipe ("xmobar -x 2 $HOME/.config/xmobar/" ++ colorScheme ++ "-xmobarrc") xmproc2 <- spawnPipe ("xmobar -x 2 $HOME/.config/xmobar/" ++ colorScheme ++ "-xmobarrc")
-- the xmonad, ya know...what the WM is named after! -- the xmonad, ya know...what the WM is named after!
xmonad $ addDescrKeys ((mod4Mask, xK_F1), showKeybindings) myKeys $ ewmh def xmonad $ addDescrKeys ((mod4Mask, xK_F1), showKeybindings) myKeys $ ewmh def
{ manageHook = myManageHook <+> manageDocks { manageHook = myManageHook <+> manageDocks
, handleEventHook = docksEventHook , handleEventHook = docksEventHook
-- Uncomment this line to enable fullscreen support on things like YouTube/Netflix. -- Uncomment this line to enable fullscreen support on things like YouTube/Netflix.
-- This works perfect on SINGLE monitor systems. On multi-monitor systems, -- This works perfect on SINGLE monitor systems. On multi-monitor systems,
-- it adds a border around the window if screen does not have focus. So, my solution -- it adds a border around the window if screen does not have focus. So, my solution
-- is to use a keybinding to toggle fullscreen noborders instead. (M-<Space>) -- is to use a keybinding to toggle fullscreen noborders instead. (M-<Space>)
-- <+> fullscreenEventHook -- <+> fullscreenEventHook
, modMask = myModMask , modMask = myModMask
, terminal = myTerminal , terminal = myTerminal
, startupHook = myStartupHook , startupHook = myStartupHook
, layoutHook = showWName' myShowWNameTheme $ myLayoutHook , layoutHook = showWName' myShowWNameTheme $ myLayoutHook
, workspaces = myWorkspaces , workspaces = myWorkspaces
, borderWidth = myBorderWidth , borderWidth = myBorderWidth
, normalBorderColor = myNormColor , normalBorderColor = myNormColor
, focusedBorderColor = myFocusColor , focusedBorderColor = myFocusColor
, logHook = dynamicLogWithPP $ namedScratchpadFilterOutWorkspacePP $ xmobarPP , logHook = dynamicLogWithPP $ namedScratchpadFilterOutWorkspacePP $ xmobarPP
-- XMOBAR SETTINGS -- XMOBAR SETTINGS
{ ppOutput = \x -> hPutStrLn xmproc0 x -- xmobar on monitor 1 { ppOutput = \x -> hPutStrLn xmproc0 x -- xmobar on monitor 1
>> hPutStrLn xmproc1 x -- xmobar on monitor 2 >> hPutStrLn xmproc1 x -- xmobar on monitor 2
>> hPutStrLn xmproc2 x -- xmobar on monitor 3 >> hPutStrLn xmproc2 x -- xmobar on monitor 3
-- Current workspace -- Current workspace
, ppCurrent = xmobarColor color06 "" . wrap , ppCurrent = xmobarColor color06 "" . wrap
("<box type=Bottom width=2 mb=2 color=" ++ color06 ++ ">") "</box>" ("<box type=Bottom width=2 mb=2 color=" ++ color06 ++ ">") "</box>"
-- Visible but not current workspace -- Visible but not current workspace
, ppVisible = xmobarColor color06 "" . clickable , ppVisible = xmobarColor color06 "" . clickable
-- Hidden workspace -- Hidden workspace
, ppHidden = xmobarColor color05 "" . wrap , ppHidden = xmobarColor color05 "" . wrap
("<box type=Top width=2 mt=2 color=" ++ color05 ++ ">") "</box>" . clickable ("<box type=Top width=2 mt=2 color=" ++ color05 ++ ">") "</box>" . clickable
-- Hidden workspaces (no windows) -- Hidden workspaces (no windows)
, ppHiddenNoWindows = xmobarColor color05 "" . clickable , ppHiddenNoWindows = xmobarColor color05 "" . clickable
-- Title of active window -- Title of active window
, ppTitle = xmobarColor color16 "" . shorten 60 , ppTitle = xmobarColor color16 "" . shorten 60
-- Separator character -- Separator character
, ppSep = "<fc=" ++ color09 ++ "> <fn=1>|</fn> </fc>" , ppSep = "<fc=" ++ color09 ++ "> <fn=1>|</fn> </fc>"
-- Urgent workspace -- Urgent workspace
, ppUrgent = xmobarColor color02 "" . wrap "!" "!" , ppUrgent = xmobarColor color02 "" . wrap "!" "!"
-- Adding # of windows on current workspace to the bar -- Adding # of windows on current workspace to the bar
, ppExtras = [windowCount] , ppExtras = [windowCount]
-- order of things in xmobar -- order of things in xmobar
, ppOrder = \(ws:l:t:ex) -> [ws,l]++ex++[t] , ppOrder = \(ws:l:t:ex) -> [ws,l]++ex++[t]
} }
} -- `additionalKeysP` myKeys } -- `additionalKeysP` myKeys
#+END_SRC #+END_SRC
+258 -257
View File
@@ -117,32 +117,32 @@ windowCount = gets $ Just . show . length . W.integrate' . W.stack . W.workspace
myStartupHook :: X () myStartupHook :: X ()
myStartupHook = do myStartupHook = do
spawnOnce (mySoundPlayer ++ startupSound) spawnOnce (mySoundPlayer ++ startupSound)
spawn "killall conky" -- kill current conky on each restart spawn "killall conky" -- kill current conky on each restart
spawn "killall trayer" -- kill current trayer on each restart spawn "killall trayer" -- kill current trayer on each restart
spawnOnce "lxsession" spawnOnce "lxsession"
spawnOnce "picom" spawnOnce "picom"
spawnOnce "nm-applet" spawnOnce "nm-applet"
spawnOnce "volumeicon" spawnOnce "volumeicon"
spawn "/usr/bin/emacs --daemon" -- emacs daemon for the emacsclient spawn "/usr/bin/emacs --daemon" -- emacs daemon for the emacsclient
spawn ("sleep 2 && conky -c $HOME/.config/conky/xmonad/" ++ colorScheme ++ "-01.conkyrc") spawn ("sleep 2 && conky -c $HOME/.config/conky/xmonad/" ++ colorScheme ++ "-01.conkyrc")
spawn ("sleep 2 && trayer --edge top --align right --widthtype request --padding 6 --SetDockType true --SetPartialStrut true --expand true --monitor 1 --transparent true --alpha 0 " ++ colorTrayer ++ " --height 22") spawn ("sleep 2 && trayer --edge top --align right --widthtype request --padding 6 --SetDockType true --SetPartialStrut true --expand true --monitor 1 --transparent true --alpha 0 " ++ colorTrayer ++ " --height 22")
spawnOnce "xargs xwallpaper --stretch < ~/.cache/wall" spawnOnce "xargs xwallpaper --stretch < ~/.cache/wall"
-- spawnOnce "~/.fehbg &" -- set last saved feh wallpaper -- spawnOnce "~/.fehbg &" -- set last saved feh wallpaper
-- spawnOnce "feh --randomize --bg-fill ~/wallpapers/*" -- feh set random wallpaper -- spawnOnce "feh --randomize --bg-fill ~/wallpapers/*" -- feh set random wallpaper
-- spawnOnce "nitrogen --restore &" -- if you prefer nitrogen to feh -- spawnOnce "nitrogen --restore &" -- if you prefer nitrogen to feh
setWMName "LG3D" setWMName "LG3D"
myColorizer :: Window -> Bool -> X (String, String) myColorizer :: Window -> Bool -> X (String, String)
myColorizer = colorRangeFromClassName myColorizer = colorRangeFromClassName
(0x28,0x2c,0x34) -- lowest inactive bg (0x28,0x2c,0x34) -- lowest inactive bg
(0x28,0x2c,0x34) -- highest inactive bg (0x28,0x2c,0x34) -- highest inactive bg
(0xc7,0x92,0xea) -- active bg (0xc7,0x92,0xea) -- active bg
(0xc0,0xa7,0x9a) -- inactive fg (0xc0,0xa7,0x9a) -- inactive fg
(0x28,0x2c,0x34) -- active fg (0x28,0x2c,0x34) -- active fg
-- gridSelect menu layout -- gridSelect menu layout
mygridConfig :: p -> GSConfig Window mygridConfig :: p -> GSConfig Window
@@ -167,18 +167,18 @@ spawnSelected' lst = gridselect conf lst >>= flip whenJust spawn
} }
myAppGrid = [ ("Audacity", "audacity") myAppGrid = [ ("Audacity", "audacity")
, ("Deadbeef", "deadbeef") , ("Deadbeef", "deadbeef")
, ("Emacs", "emacsclient -c -a emacs") , ("Emacs", "emacsclient -c -a emacs")
, ("Firefox", "firefox") , ("Firefox", "firefox")
, ("Geany", "geany") , ("Geany", "geany")
, ("Geary", "geary") , ("Geary", "geary")
, ("Gimp", "gimp") , ("Gimp", "gimp")
, ("Kdenlive", "kdenlive") , ("Kdenlive", "kdenlive")
, ("LibreOffice Impress", "loimpress") , ("LibreOffice Impress", "loimpress")
, ("LibreOffice Writer", "lowriter") , ("LibreOffice Writer", "lowriter")
, ("OBS", "obs") , ("OBS", "obs")
, ("PCManFM", "pcmanfm") , ("PCManFM", "pcmanfm")
] ]
myScratchPads :: [NamedScratchpad] myScratchPads :: [NamedScratchpad]
myScratchPads = [ NS "terminal" spawnTerm findTerm manageTerm myScratchPads = [ NS "terminal" spawnTerm findTerm manageTerm
@@ -304,27 +304,30 @@ myTabTheme = def { fontName = myFont
-- Theme for showWName which prints current workspace when you change workspaces. -- Theme for showWName which prints current workspace when you change workspaces.
myShowWNameTheme :: SWNConfig myShowWNameTheme :: SWNConfig
myShowWNameTheme = def myShowWNameTheme = def
{ swn_font = "xft:Ubuntu:bold:size=60" { swn_font = "xft:Ubuntu:bold:size=60"
, swn_fade = 1.0 , swn_fade = 1.0
, swn_bgcolor = "#1c1f24" , swn_bgcolor = "#1c1f24"
, swn_color = "#ffffff" , swn_color = "#ffffff"
} }
-- The layout hook -- The layout hook
myLayoutHook = avoidStruts $ mouseResize $ windowArrange $ T.toggleLayouts floats myLayoutHook = avoidStruts
$ mouseResize
$ windowArrange
$ T.toggleLayouts floats
$ mkToggle (NBFULL ?? NOBORDERS ?? EOT) myDefaultLayout $ mkToggle (NBFULL ?? NOBORDERS ?? EOT) myDefaultLayout
where where
myDefaultLayout = withBorder myBorderWidth tall myDefaultLayout = withBorder myBorderWidth tall
||| magnify ||| magnify
||| noBorders monocle ||| noBorders monocle
||| floats ||| floats
||| noBorders tabs ||| noBorders tabs
||| grid ||| grid
||| spirals ||| spirals
||| threeCol ||| threeCol
||| threeRow ||| threeRow
||| tallAccordion ||| tallAccordion
||| wideAccordion ||| wideAccordion
-- myWorkspaces = [" 1 ", " 2 ", " 3 ", " 4 ", " 5 ", " 6 ", " 7 ", " 8 ", " 9 "] -- myWorkspaces = [" 1 ", " 2 ", " 3 ", " 4 ", " 5 ", " 6 ", " 7 ", " 8 ", " 9 "]
myWorkspaces = [" dev ", " www ", " sys ", " doc ", " vbox ", " chat ", " mus ", " vid ", " gfx "] myWorkspaces = [" dev ", " www ", " sys ", " doc ", " vbox ", " chat ", " mus ", " vid ", " gfx "]
@@ -335,237 +338,235 @@ clickable ws = "<action=xdotool key super+"++show i++">"++ws++"</action>"
myManageHook :: XMonad.Query (Data.Monoid.Endo WindowSet) myManageHook :: XMonad.Query (Data.Monoid.Endo WindowSet)
myManageHook = composeAll myManageHook = composeAll
-- 'doFloat' forces a window to float. Useful for dialog boxes and such. -- 'doFloat' forces a window to float. Useful for dialog boxes and such.
-- using 'doShift ( myWorkspaces !! 7)' sends program to workspace 8! -- using 'doShift ( myWorkspaces !! 7)' sends program to workspace 8!
-- I'm doing it this way because otherwise I would have to write out the full -- I'm doing it this way because otherwise I would have to write out the full
-- name of my workspaces and the names would be very long if using clickable workspaces. -- name of my workspaces and the names would be very long if using clickable workspaces.
[ className =? "confirm" --> doFloat [ className =? "confirm" --> doFloat
, className =? "file_progress" --> doFloat , className =? "file_progress" --> doFloat
, className =? "dialog" --> doFloat , className =? "dialog" --> doFloat
, className =? "download" --> doFloat , className =? "download" --> doFloat
, className =? "error" --> doFloat , className =? "error" --> doFloat
, className =? "Gimp" --> doFloat , className =? "Gimp" --> doFloat
, className =? "notification" --> doFloat , className =? "notification" --> doFloat
, className =? "pinentry-gtk-2" --> doFloat , className =? "pinentry-gtk-2" --> doFloat
, className =? "splash" --> doFloat , className =? "splash" --> doFloat
, className =? "toolbar" --> doFloat , className =? "toolbar" --> doFloat
, className =? "Yad" --> doCenterFloat , className =? "Yad" --> doCenterFloat
, title =? "Oracle VM VirtualBox Manager" --> doFloat , title =? "Oracle VM VirtualBox Manager" --> doFloat
, title =? "Mozilla Firefox" --> doShift ( myWorkspaces !! 1 ) , title =? "Mozilla Firefox" --> doShift ( myWorkspaces !! 1 )
, className =? "Brave-browser" --> doShift ( myWorkspaces !! 1 ) , className =? "Brave-browser" --> doShift ( myWorkspaces !! 1 )
, className =? "mpv" --> doShift ( myWorkspaces !! 7 ) , className =? "mpv" --> doShift ( myWorkspaces !! 7 )
, className =? "Gimp" --> doShift ( myWorkspaces !! 8 ) , className =? "Gimp" --> doShift ( myWorkspaces !! 8 )
, className =? "VirtualBox Manager" --> doShift ( myWorkspaces !! 4 ) , className =? "VirtualBox Manager" --> doShift ( myWorkspaces !! 4 )
, (className =? "firefox" <&&> resource =? "Dialog") --> doFloat -- Float Firefox Dialog , (className =? "firefox" <&&> resource =? "Dialog") --> doFloat -- Float Firefox Dialog
, isFullscreen --> doFullFloat , isFullscreen --> doFullFloat
] <+> namedScratchpadManageHook myScratchPads ] <+> namedScratchpadManageHook myScratchPads
soundDir = "/opt/dtos-sounds/" -- The directory that has the sound files soundDir = "/opt/dtos-sounds/" -- The directory that has the sound files
startupSound = soundDir ++ "startup-01.mp3" startupSound = soundDir ++ "startup-01.mp3"
shutdownSound = soundDir ++ "shutdown-01.mp3" shutdownSound = soundDir ++ "shutdown-01.mp3"
dmenuSound = soundDir ++ "menu-01.mp3" dmenuSound = soundDir ++ "menu-01.mp3"
showKeybindings :: [((KeyMask, KeySym), NamedAction)] -> NamedAction showKeybindings :: [((KeyMask, KeySym), NamedAction)] -> NamedAction
showKeybindings x = addName "Show Keybindings" $ io $ do showKeybindings x = addName "Show Keybindings" $ io $ do
h <- spawnPipe $ "yad --text-info --fontname=" ++ myFont ++ " --width 800 --height 600 --center --title \"XMonad keybindings\"" h <- spawnPipe $ "yad --text-info --fontname=\"SauceCodePro Nerd Font Mono 12\" --width 800 --height 600 --center --title \"XMonad keybindings\""
hPutStr h (unlines $ showKm x) hPutStr h (unlines $ showKm x)
hClose h hClose h
return () return ()
myKeys :: XConfig l0 -> [((KeyMask, KeySym), NamedAction)] myKeys :: XConfig l0 -> [((KeyMask, KeySym), NamedAction)]
myKeys c = (subtitle "Custom Keys":) $ mkNamedKeymap c $ myKeys c = (subtitle "Custom Keys":) $ mkNamedKeymap c $
-- KB_GROUP Xmonad
[ ("M-C-r", addName "Recompile XMonad" $ spawn "xmonad --recompile")
, ("M-S-r", addName "Restart XMonad" $ spawn "xmonad --restart")
, ("M-S-q", addName "Quit XMonad" $ sequence_ [spawn (mySoundPlayer ++ shutdownSound), io exitSuccess])
, ("M-S-/", addName "List all keybindings" $ spawn "~/.xmonad/xmonad_keys.sh")
, ("M-/", addName "DTOS Help" $ spawn "dtos-help")
, ("M-S-<Return>", addName "Run prompt" $ sequence_ [spawn (mySoundPlayer ++ dmenuSound), spawn "dm-run"])
-- In Xmonad and many tiling window managers, M-p is the default keybinding to
-- launch dmenu_run, so I've decided to use M-p plus KEY for these dmenu scripts.
, ("M-p h", addName "List all dmscripts" $ spawn "dm-hub")
, ("M-p a", addName "Choose ambient sound" $ spawn "dm-sounds")
, ("M-p b", addName "Set background" $ spawn "dm-setbg")
, ("M-p c", addName "Choose color scheme" $ spawn "dtos-colorscheme")
, ("M-p C", addName "Pick color from scheme" $ spawn "dm-colpick")
, ("M-p e", addName "Edit config files" $ spawn "dm-confedit")
, ("M-p i", addName "Take a screenshot" $ spawn "dm-maim")
, ("M-p k", addName "Kill processes" $ spawn "dm-kill")
, ("M-p m", addName "View manpages" $ spawn "dm-man")
, ("M-p n", addName "Store and copy notes" $ spawn "dm-note")
, ("M-p o", addName "Browser bookmarks" $ spawn "dm-bookman")
, ("M-p p", addName "Passmenu" $ spawn "passmenu -p \"Pass: \"")
, ("M-p q", addName "Logout Menu" $ spawn "dm-logout")
, ("M-p r", addName "Listen to online radio" $ spawn "dm-radio")
, ("M-p s", addName "Search various engines" $ spawn "dm-websearch")
, ("M-p t", addName "Translate text" $ spawn "dm-translate")
-- KB_GROUP Xmonad -- KB_GROUP Useful programs to have a keybinding for launch
[ ("M-C-r", addName "Recompile XMonad" $ spawn "xmonad --recompile") , ("M-<Return>", addName "Launch terminal" $ spawn (myTerminal))
, ("M-S-r", addName "Restart XMonad" $ spawn "xmonad --restart") , ("M-b", addName "Launch web browser" $ spawn (myBrowser))
, ("M-S-q", addName "Quit XMonad" $ sequence_ [spawn (mySoundPlayer ++ shutdownSound), io exitSuccess]) , ("M-M1-h", addName "Launch htop" $ spawn (myTerminal ++ " -e htop"))
, ("M-S-/", addName "List all keybindings" $ spawn "~/.xmonad/xmonad_keys.sh")
, ("M-/", addName "DTOS Help" $ spawn "dtos-help")
, ("M-S-<Return>", addName "Run prompt" $ sequence_ [spawn (mySoundPlayer ++ dmenuSound), spawn "dm-run"])
-- In Xmonad and many tiling window managers, M-p is the default keybinding to
-- launch dmenu_run, so I've decided to use M-p plus KEY for these dmenu scripts.
, ("M-p h", addName "List all dmscripts" $ spawn "dm-hub")
, ("M-p a", addName "Choose ambient sound" $ spawn "dm-sounds")
, ("M-p b", addName "Set background" $ spawn "dm-setbg")
, ("M-p c", addName "Choose color scheme" $ spawn "dtos-colorscheme")
, ("M-p C", addName "Pick color from scheme" $ spawn "dm-colpick")
, ("M-p e", addName "Edit config files" $ spawn "dm-confedit")
, ("M-p i", addName "Take a screenshot" $ spawn "dm-maim")
, ("M-p k", addName "Kill processes" $ spawn "dm-kill")
, ("M-p m", addName "View manpages" $ spawn "dm-man")
, ("M-p n", addName "Store and copy notes" $ spawn "dm-note")
, ("M-p o", addName "Browser bookmarks" $ spawn "dm-bookman")
, ("M-p p", addName "Passmenu" $ spawn "passmenu -p \"Pass: \"")
, ("M-p q", addName "Logout Menu" $ spawn "dm-logout")
, ("M-p r", addName "Listen to online radio" $ spawn "dm-radio")
, ("M-p s", addName "Search various engines" $ spawn "dm-websearch")
, ("M-p t", addName "Translate text" $ spawn "dm-translate")
-- KB_GROUP Useful programs to have a keybinding for launch -- KB_GROUP Kill windows
, ("M-<Return>", addName "Launch terminal" $ spawn (myTerminal)) , ("M-S-c", addName "Kill focused window" $ kill1)
, ("M-b", addName "Launch web browser" $ spawn (myBrowser)) , ("M-S-a", addName "Kill all windows on WS" $ killAll)
, ("M-M1-h", addName "Launch htop" $ spawn (myTerminal ++ " -e htop"))
-- KB_GROUP Kill windows -- KB_GROUP Workspaces
, ("M-S-c", addName "Kill focused window" $ kill1) , ("M-.", addName "Switch focus to next mon" $ nextScreen)
, ("M-S-a", addName "Kill all windows on WS" $ killAll) , ("M-,", addName "Switch focus to prev mon" $ prevScreen)
, ("M-S-<KP_Add>"
, addName "Move window to next WS" $ shiftTo Next nonNSP >> moveTo Next nonNSP)
, ("M-S-<KP_Subtract>"
, addName "Move window to prev WS" $ shiftTo Prev nonNSP >> moveTo Prev nonNSP)
-- KB_GROUP Workspaces -- KB_GROUP Floating windows
, ("M-.", addName "Switch focus to next mon" $ nextScreen) , ("M-f", addName "Toggle float layout" $ sendMessage (T.Toggle "floats"))
, ("M-,", addName "Switch focus to prev mon" $ prevScreen) , ("M-t", addName "Sink a floating window" $ withFocused $ windows . W.sink)
, ("M-S-<KP_Add>" , ("M-S-t", addName "Sink all floated windows" $ sinkAll)
, addName "Move window to next WS" $ shiftTo Next nonNSP >> moveTo Next nonNSP)
, ("M-S-<KP_Subtract>"
, addName "Move window to prev WS" $ shiftTo Prev nonNSP >> moveTo Prev nonNSP)
-- KB_GROUP Floating windows -- KB_GROUP Increase/decrease spacing (gaps)
, ("M-f", addName "Toggle float layout" $ sendMessage (T.Toggle "floats")) , ("C-M1-j", addName "Decrease window spacing" $ decWindowSpacing 4)
, ("M-t", addName "Sink a floating window" $ withFocused $ windows . W.sink) , ("C-M1-k", addName "Increase window spacing" $ incWindowSpacing 4)
, ("M-S-t", addName "Sink all floated windows" $ sinkAll) , ("C-M1-h", addName "Decrease screen spacing" $ decScreenSpacing 4)
, ("C-M1-l", addName "Increase screen spacing" $ incScreenSpacing 4)
-- KB_GROUP Increase/decrease spacing (gaps) -- KB_GROUP Grid Select (CTR-g followed by a key)
, ("C-M1-j", addName "Decrease window spacing" $ decWindowSpacing 4) , ("C-g g", addName "Select favorite apps" $ spawnSelected' myAppGrid)
, ("C-M1-k", addName "Increase window spacing" $ incWindowSpacing 4) , ("C-g t", addName "Goto selected window" $ goToSelected $ mygridConfig myColorizer)
, ("C-M1-h", addName "Decrease screen spacing" $ decScreenSpacing 4) , ("C-g b", addName "Bring selected window" $ bringSelected $ mygridConfig myColorizer)
, ("C-M1-l", addName "Increase screen spacing" $ incScreenSpacing 4)
-- KB_GROUP Grid Select (CTR-g followed by a key) -- KB_GROUP Windows navigation
, ("C-g g", addName "Select favorite apps" $ spawnSelected' myAppGrid) , ("M-m", addName "Move focus to master window" $ windows W.focusMaster)
, ("C-g t", addName "Goto selected window" $ goToSelected $ mygridConfig myColorizer) , ("M-j", addName "Move focus to next window" $ windows W.focusDown)
, ("C-g b", addName "Bring selected window" $ bringSelected $ mygridConfig myColorizer) , ("M-k", addName "Move focus to prev window" $ windows W.focusUp)
, ("M-S-m", addName "Swap focused window with master window" $ windows W.swapMaster)
, ("M-S-j", addName "Swap focused window with next window" $ windows W.swapDown)
, ("M-S-k", addName "Swap focused window with prev window" $ windows W.swapUp)
, ("M-<Backspace>", addName "Move focused window to master" $ promote)
, ("M-S-<Tab>", addName "Rotate all windows except master" $ rotSlavesDown)
, ("M-C-<Tab>", addName "Rotate all windows current stack" $ rotAllDown)
-- KB_GROUP Windows navigation -- KB_GROUP Layouts
, ("M-m", addName "" $ windows W.focusMaster) -- Move focus to the master window , ("M-<Tab>", addName "Switch to next layout" $ sendMessage NextLayout)
, ("M-j", addName "" $ windows W.focusDown) -- Move focus to the next window , ("M-<Space>", addName "Toggle noborders/full" $ sendMessage (MT.Toggle NBFULL) >> sendMessage ToggleStruts)
, ("M-k", addName "" $ windows W.focusUp) -- Move focus to the prev window
, ("M-S-m", addName "" $ windows W.swapMaster) -- Swap the focused window and the master window
, ("M-S-j", addName "" $ windows W.swapDown) -- Swap focused window with next window
, ("M-S-k", addName "" $ windows W.swapUp) -- Swap focused window with prev window
, ("M-<Backspace>", addName "" $ promote) -- Moves focused window to master, others maintain order
, ("M-S-<Tab>", addName "" $ rotSlavesDown) -- Rotate all windows except master and keep focus in place
, ("M-C-<Tab>", addName "" $ rotAllDown) -- Rotate all the windows in the current stack
-- KB_GROUP Layouts -- KB_GROUP Increase/decrease windows in the master pane or the stack
, ("M-<Tab>", addName "" $ sendMessage NextLayout) -- Switch to next layout , ("M-S-<Up>", addName "Increase clients in master pane" $ sendMessage (IncMasterN 1))
, ("M-<Space>", addName "" $ sendMessage (MT.Toggle NBFULL) >> sendMessage ToggleStruts) -- Toggles noborder/full , ("M-S-<Down>", addName "Decrease clients in master pane" $ sendMessage (IncMasterN (-1)))
, ("M-C-<Up>", addName "Increase # of windows" $ increaseLimit)
, ("M-C-<Down>", addName "Decrease # of windows" $ decreaseLimit)
-- KB_GROUP Increase/decrease windows in the master pane or the stack -- KB_GROUP Window resizing
, ("M-S-<Up>", addName "" $ sendMessage (IncMasterN 1)) -- Increase # of clients master pane , ("M-h", addName "Shrink window" $ sendMessage Shrink)
, ("M-S-<Down>", addName "" $ sendMessage (IncMasterN (-1))) -- Decrease # of clients master pane , ("M-l", addName "Expand window" $ sendMessage Expand)
, ("M-C-<Up>", addName "" $ increaseLimit) -- Increase # of windows , ("M-M1-j", addName "Shrink window vertically" $ sendMessage MirrorShrink)
, ("M-C-<Down>", addName "" $ decreaseLimit) -- Decrease # of windows , ("M-M1-k", addName "Expand window vertically" $ sendMessage MirrorExpand)
-- KB_GROUP Window resizing -- KB_GROUP Sublayouts
, ("M-h", addName "Shrink window" $ sendMessage Shrink) -- Shrink horiz window width -- This is used to push windows to tabbed sublayouts, or pull them out of it.
, ("M-l", addName "Expand window" $ sendMessage Expand) -- Expand horiz window width , ("M-C-h", addName "" $ sendMessage $ pullGroup L)
, ("M-M1-j", addName "Shrink window vertically" $ sendMessage MirrorShrink) -- Shrink vert window width , ("M-C-l", addName "" $ sendMessage $ pullGroup R)
, ("M-M1-k", addName "Expand window vertically" $ sendMessage MirrorExpand) -- Expand vert window width , ("M-C-k", addName "" $ sendMessage $ pullGroup U)
, ("M-C-j", addName "" $ sendMessage $ pullGroup D)
, ("M-C-m", addName "" $ withFocused (sendMessage . MergeAll))
-- , ("M-C-u", withFocused (sendMessage . UnMerge))
, ("M-C-/", addName "" $ withFocused (sendMessage . UnMergeAll))
, ("M-C-.", addName "" $ onGroup W.focusUp') -- Switch focus to next tab
, ("M-C-,", addName "" $ onGroup W.focusDown') -- Switch focus to prev tab
-- KB_GROUP Sublayouts -- KB_GROUP Scratchpads
-- This is used to push windows to tabbed sublayouts, or pull them out of it. -- Toggle show/hide these programs. They run on a hidden workspace.
, ("M-C-h", addName "" $ sendMessage $ pullGroup L) -- When you toggle them to show, it brings them to your current workspace.
, ("M-C-l", addName "" $ sendMessage $ pullGroup R) -- Toggle them to hide and it sends them back to hidden workspace (NSP).
, ("M-C-k", addName "" $ sendMessage $ pullGroup U) , ("M-s t", addName "Toggle scratchpad terminal" $ namedScratchpadAction myScratchPads "terminal")
, ("M-C-j", addName "" $ sendMessage $ pullGroup D) , ("M-s m", addName "Toggle scratchpad mocp" $ namedScratchpadAction myScratchPads "mocp")
, ("M-C-m", addName "" $ withFocused (sendMessage . MergeAll)) , ("M-s c", addName "Toggle scratchpad calculator" $ namedScratchpadAction myScratchPads "calculator")
-- , ("M-C-u", withFocused (sendMessage . UnMerge))
, ("M-C-/", addName "" $ withFocused (sendMessage . UnMergeAll))
, ("M-C-.", addName "" $ onGroup W.focusUp') -- Switch focus to next tab
, ("M-C-,", addName "" $ onGroup W.focusDown') -- Switch focus to prev tab
-- KB_GROUP Scratchpads -- KB_GROUP Controls for mocp music player (SUPER-u followed by a key)
-- Toggle show/hide these programs. They run on a hidden workspace. , ("M-u p", addName "" $ spawn "mocp --play")
-- When you toggle them to show, it brings them to your current workspace. , ("M-u l", addName "" $ spawn "mocp --next")
-- Toggle them to hide and it sends them back to hidden workspace (NSP). , ("M-u h", addName "" $ spawn "mocp --previous")
, ("M-s t", addName "" $ namedScratchpadAction myScratchPads "terminal") , ("M-u <Space>", addName "" $ spawn "mocp --toggle-pause")
, ("M-s m", addName "" $ namedScratchpadAction myScratchPads "mocp")
, ("M-s c", addName "" $ namedScratchpadAction myScratchPads "calculator")
-- KB_GROUP Controls for mocp music player (SUPER-u followed by a key) -- KB_GROUP Emacs (SUPER-e followed by a key)
, ("M-u p", addName "" $ spawn "mocp --play") , ("M-e e", addName "Emacsclient Dashboard" $ spawn (myEmacs ++ ("--eval '(dashboard-refresh-buffer)'"))) -- emacs dashboard
, ("M-u l", addName "" $ spawn "mocp --next") , ("M-e b", addName "Emacsclient Ibuffer" $ spawn (myEmacs ++ ("--eval '(ibuffer)'"))) -- list buffers
, ("M-u h", addName "" $ spawn "mocp --previous") , ("M-e d", addName "Emacsclient Dired" $ spawn (myEmacs ++ ("--eval '(dired nil)'"))) -- dired
, ("M-u <Space>", addName "" $ spawn "mocp --toggle-pause") , ("M-e i", addName "Emacsclient ERC (IRC)" $ spawn (myEmacs ++ ("--eval '(erc)'"))) -- erc irc client
, ("M-e n", addName "Emacsclient Elfeed (RSS)" $ spawn (myEmacs ++ ("--eval '(elfeed)'"))) -- elfeed rss
, ("M-e s", addName "Emacsclient Eshell" $ spawn (myEmacs ++ ("--eval '(eshell)'"))) -- eshell
, ("M-e t", addName "Emacsclient Mastodon" $ spawn (myEmacs ++ ("--eval '(mastodon)'"))) -- mastodon.el
, ("M-e v", addName "Emacsclient Vterm" $ spawn (myEmacs ++ ("--eval '(+vterm/here nil)'"))) -- vterm if on Doom Emacs
, ("M-e w", addName "Emacsclient EWW browser" $ spawn (myEmacs ++ ("--eval '(doom/window-maximize-buffer(eww \"distro.tube\"))'"))) -- eww browser if on Doom Emacs
, ("M-e a", addName "Emacsclient EMMS (music)" $ spawn (myEmacs ++ ("--eval '(emms)' --eval '(emms-play-directory-tree \"~/Music/\")'")))
-- KB_GROUP Emacs (SUPER-e followed by a key) -- KB_GROUP Multimedia Keys
, ("M-e e", addName "" $ spawn (myEmacs ++ ("--eval '(dashboard-refresh-buffer)'"))) -- emacs dashboard , ("<XF86AudioPlay>", addName "" $ spawn "mocp --play")
, ("M-e b", addName "" $ spawn (myEmacs ++ ("--eval '(ibuffer)'"))) -- list buffers , ("<XF86AudioPrev>", addName "" $ spawn "mocp --previous")
, ("M-e d", addName "" $ spawn (myEmacs ++ ("--eval '(dired nil)'"))) -- dired , ("<XF86AudioNext>", addName "" $ spawn "mocp --next")
, ("M-e i", addName "" $ spawn (myEmacs ++ ("--eval '(erc)'"))) -- erc irc client , ("<XF86AudioMute>", addName "" $ spawn "amixer set Master toggle")
, ("M-e n", addName "" $ spawn (myEmacs ++ ("--eval '(elfeed)'"))) -- elfeed rss , ("<XF86AudioLowerVolume>", addName "" $ spawn "amixer set Master 5%- unmute")
, ("M-e s", addName "" $ spawn (myEmacs ++ ("--eval '(eshell)'"))) -- eshell , ("<XF86AudioRaiseVolume>", addName "" $ spawn "amixer set Master 5%+ unmute")
, ("M-e t", addName "" $ spawn (myEmacs ++ ("--eval '(mastodon)'"))) -- mastodon.el , ("<XF86HomePage>", addName "" $ spawn "qutebrowser https://www.youtube.com/c/DistroTube")
, ("M-e v", addName "" $ spawn (myEmacs ++ ("--eval '(+vterm/here nil)'"))) -- vterm if on Doom Emacs , ("<XF86Search>", addName "" $ spawn "dm-websearch")
, ("M-e w", addName "" $ spawn (myEmacs ++ ("--eval '(doom/window-maximize-buffer(eww \"distro.tube\"))'"))) -- eww browser if on Doom Emacs , ("<XF86Mail>", addName "" $ runOrRaise "thunderbird" (resource =? "thunderbird"))
, ("M-e a", addName "" $ spawn (myEmacs ++ ("--eval '(emms)' --eval '(emms-play-directory-tree \"~/Music/\")'"))) , ("<XF86Calculator>", addName "" $ runOrRaise "qalculate-gtk" (resource =? "qalculate-gtk"))
, ("<XF86Eject>", addName "" $ spawn "toggleeject")
-- KB_GROUP Multimedia Keys , ("<Print>", addName "" $ spawn "dm-maim")
, ("<XF86AudioPlay>", addName "" $ spawn "mocp --play") ]
, ("<XF86AudioPrev>", addName "" $ spawn "mocp --previous") -- The following lines are needed for named scratchpads.
, ("<XF86AudioNext>", addName "" $ spawn "mocp --next") where nonNSP = WSIs (return (\ws -> W.tag ws /= "NSP"))
, ("<XF86AudioMute>", addName "" $ spawn "amixer set Master toggle") nonEmptyNonNSP = WSIs (return (\ws -> isJust (W.stack ws) && W.tag ws /= "NSP"))
, ("<XF86AudioLowerVolume>", addName "" $ spawn "amixer set Master 5%- unmute")
, ("<XF86AudioRaiseVolume>", addName "" $ spawn "amixer set Master 5%+ unmute")
, ("<XF86HomePage>", addName "" $ spawn "qutebrowser https://www.youtube.com/c/DistroTube")
, ("<XF86Search>", addName "" $ spawn "dm-websearch")
, ("<XF86Mail>", addName "" $ runOrRaise "thunderbird" (resource =? "thunderbird"))
, ("<XF86Calculator>", addName "" $ runOrRaise "qalculate-gtk" (resource =? "qalculate-gtk"))
, ("<XF86Eject>", addName "" $ spawn "toggleeject")
, ("<Print>", addName "" $ spawn "dm-maim")
]
-- The following lines are needed for named scratchpads.
where nonNSP = WSIs (return (\ws -> W.tag ws /= "NSP"))
nonEmptyNonNSP = WSIs (return (\ws -> isJust (W.stack ws) && W.tag ws /= "NSP"))
-- END_KEYS
main :: IO () main :: IO ()
main = do main = do
-- Launching three instances of xmobar on their monitors. -- Launching three instances of xmobar on their monitors.
xmproc0 <- spawnPipe ("xmobar -x 0 $HOME/.config/xmobar/" ++ colorScheme ++ "-xmobarrc") xmproc0 <- spawnPipe ("xmobar -x 0 $HOME/.config/xmobar/" ++ colorScheme ++ "-xmobarrc")
xmproc1 <- spawnPipe ("xmobar -x 1 $HOME/.config/xmobar/" ++ colorScheme ++ "-xmobarrc") xmproc1 <- spawnPipe ("xmobar -x 1 $HOME/.config/xmobar/" ++ colorScheme ++ "-xmobarrc")
xmproc2 <- spawnPipe ("xmobar -x 2 $HOME/.config/xmobar/" ++ colorScheme ++ "-xmobarrc") xmproc2 <- spawnPipe ("xmobar -x 2 $HOME/.config/xmobar/" ++ colorScheme ++ "-xmobarrc")
-- the xmonad, ya know...what the WM is named after! -- the xmonad, ya know...what the WM is named after!
xmonad $ addDescrKeys ((mod4Mask, xK_F1), showKeybindings) myKeys $ ewmh def xmonad $ addDescrKeys ((mod4Mask, xK_F1), showKeybindings) myKeys $ ewmh def
{ manageHook = myManageHook <+> manageDocks { manageHook = myManageHook <+> manageDocks
, handleEventHook = docksEventHook , handleEventHook = docksEventHook
-- Uncomment this line to enable fullscreen support on things like YouTube/Netflix. -- Uncomment this line to enable fullscreen support on things like YouTube/Netflix.
-- This works perfect on SINGLE monitor systems. On multi-monitor systems, -- This works perfect on SINGLE monitor systems. On multi-monitor systems,
-- it adds a border around the window if screen does not have focus. So, my solution -- it adds a border around the window if screen does not have focus. So, my solution
-- is to use a keybinding to toggle fullscreen noborders instead. (M-<Space>) -- is to use a keybinding to toggle fullscreen noborders instead. (M-<Space>)
-- <+> fullscreenEventHook -- <+> fullscreenEventHook
, modMask = myModMask , modMask = myModMask
, terminal = myTerminal , terminal = myTerminal
, startupHook = myStartupHook , startupHook = myStartupHook
, layoutHook = showWName' myShowWNameTheme $ myLayoutHook , layoutHook = showWName' myShowWNameTheme $ myLayoutHook
, workspaces = myWorkspaces , workspaces = myWorkspaces
, borderWidth = myBorderWidth , borderWidth = myBorderWidth
, normalBorderColor = myNormColor , normalBorderColor = myNormColor
, focusedBorderColor = myFocusColor , focusedBorderColor = myFocusColor
, logHook = dynamicLogWithPP $ namedScratchpadFilterOutWorkspacePP $ xmobarPP , logHook = dynamicLogWithPP $ namedScratchpadFilterOutWorkspacePP $ xmobarPP
-- XMOBAR SETTINGS -- XMOBAR SETTINGS
{ ppOutput = \x -> hPutStrLn xmproc0 x -- xmobar on monitor 1 { ppOutput = \x -> hPutStrLn xmproc0 x -- xmobar on monitor 1
>> hPutStrLn xmproc1 x -- xmobar on monitor 2 >> hPutStrLn xmproc1 x -- xmobar on monitor 2
>> hPutStrLn xmproc2 x -- xmobar on monitor 3 >> hPutStrLn xmproc2 x -- xmobar on monitor 3
-- Current workspace -- Current workspace
, ppCurrent = xmobarColor color06 "" . wrap , ppCurrent = xmobarColor color06 "" . wrap
("<box type=Bottom width=2 mb=2 color=" ++ color06 ++ ">") "</box>" ("<box type=Bottom width=2 mb=2 color=" ++ color06 ++ ">") "</box>"
-- Visible but not current workspace -- Visible but not current workspace
, ppVisible = xmobarColor color06 "" . clickable , ppVisible = xmobarColor color06 "" . clickable
-- Hidden workspace -- Hidden workspace
, ppHidden = xmobarColor color05 "" . wrap , ppHidden = xmobarColor color05 "" . wrap
("<box type=Top width=2 mt=2 color=" ++ color05 ++ ">") "</box>" . clickable ("<box type=Top width=2 mt=2 color=" ++ color05 ++ ">") "</box>" . clickable
-- Hidden workspaces (no windows) -- Hidden workspaces (no windows)
, ppHiddenNoWindows = xmobarColor color05 "" . clickable , ppHiddenNoWindows = xmobarColor color05 "" . clickable
-- Title of active window -- Title of active window
, ppTitle = xmobarColor color16 "" . shorten 60 , ppTitle = xmobarColor color16 "" . shorten 60
-- Separator character -- Separator character
, ppSep = "<fc=" ++ color09 ++ "> <fn=1>|</fn> </fc>" , ppSep = "<fc=" ++ color09 ++ "> <fn=1>|</fn> </fc>"
-- Urgent workspace -- Urgent workspace
, ppUrgent = xmobarColor color02 "" . wrap "!" "!" , ppUrgent = xmobarColor color02 "" . wrap "!" "!"
-- Adding # of windows on current workspace to the bar -- Adding # of windows on current workspace to the bar
, ppExtras = [windowCount] , ppExtras = [windowCount]
-- order of things in xmobar -- order of things in xmobar
, ppOrder = \(ws:l:t:ex) -> [ws,l]++ex++[t] , ppOrder = \(ws:l:t:ex) -> [ws,l]++ex++[t]
} }
} -- `additionalKeysP` myKeys } -- `additionalKeysP` myKeys