diff --git a/.xmonad/README.org b/.xmonad/README.org index 1be4322..708eca1 100644 --- a/.xmonad/README.org +++ b/.xmonad/README.org @@ -168,33 +168,33 @@ These are commands we want XMonad to execute on startup, such as running a compo #+BEGIN_SRC haskell myStartupHook :: X () myStartupHook = do - spawnOnce (mySoundPlayer ++ startupSound) - spawn "killall conky" -- kill current conky on each restart - spawn "killall trayer" -- kill current trayer on each restart + spawnOnce (mySoundPlayer ++ startupSound) + spawn "killall conky" -- kill current conky on each restart + spawn "killall trayer" -- kill current trayer on each restart #+END_SRC #+BEGIN_SRC haskell - spawnOnce "lxsession" - spawnOnce "picom" - spawnOnce "nm-applet" - spawnOnce "volumeicon" - spawn "/usr/bin/emacs --daemon" -- emacs daemon for the emacsclient + spawnOnce "lxsession" + spawnOnce "picom" + spawnOnce "nm-applet" + spawnOnce "volumeicon" + spawn "/usr/bin/emacs --daemon" -- emacs daemon for the emacsclient #+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. #+BEGIN_SRC haskell - 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 && 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") #+END_SRC Select only =ONE= of the following four ways to set the wallpaper. #+BEGIN_SRC haskell - spawnOnce "xargs xwallpaper --stretch < ~/.cache/wall" - -- spawnOnce "~/.fehbg &" -- set last saved feh wallpaper - -- spawnOnce "feh --randomize --bg-fill ~/wallpapers/*" -- feh set random wallpaper - -- spawnOnce "nitrogen --restore &" -- if you prefer nitrogen to feh - setWMName "LG3D" + spawnOnce "xargs xwallpaper --stretch < ~/.cache/wall" + -- spawnOnce "~/.fehbg &" -- set last saved feh wallpaper + -- spawnOnce "feh --randomize --bg-fill ~/wallpapers/*" -- feh set random wallpaper + -- spawnOnce "nitrogen --restore &" -- if you prefer nitrogen to feh + setWMName "LG3D" #+END_SRC * Gridselect @@ -203,11 +203,11 @@ GridSelect displays items (programs, open windows, etc.) in a 2D grid and lets t #+BEGIN_SRC haskell myColorizer :: Window -> Bool -> X (String, String) myColorizer = colorRangeFromClassName - (0x28,0x2c,0x34) -- lowest inactive bg - (0x28,0x2c,0x34) -- highest inactive bg - (0xc7,0x92,0xea) -- active bg - (0xc0,0xa7,0x9a) -- inactive fg - (0x28,0x2c,0x34) -- active fg + (0x28,0x2c,0x34) -- lowest inactive bg + (0x28,0x2c,0x34) -- highest inactive bg + (0xc7,0x92,0xea) -- active bg + (0xc0,0xa7,0x9a) -- inactive fg + (0x28,0x2c,0x34) -- active fg -- gridSelect menu layout mygridConfig :: p -> GSConfig Window @@ -232,18 +232,18 @@ spawnSelected' lst = gridselect conf lst >>= flip whenJust spawn } myAppGrid = [ ("Audacity", "audacity") - , ("Deadbeef", "deadbeef") - , ("Emacs", "emacsclient -c -a emacs") - , ("Firefox", "firefox") - , ("Geany", "geany") - , ("Geary", "geary") - , ("Gimp", "gimp") - , ("Kdenlive", "kdenlive") - , ("LibreOffice Impress", "loimpress") - , ("LibreOffice Writer", "lowriter") - , ("OBS", "obs") - , ("PCManFM", "pcmanfm") - ] + , ("Deadbeef", "deadbeef") + , ("Emacs", "emacsclient -c -a emacs") + , ("Firefox", "firefox") + , ("Geany", "geany") + , ("Geary", "geary") + , ("Gimp", "gimp") + , ("Kdenlive", "kdenlive") + , ("LibreOffice Impress", "loimpress") + , ("LibreOffice Writer", "lowriter") + , ("OBS", "obs") + , ("PCManFM", "pcmanfm") + ] #+END_SRC * Scratchpads @@ -382,27 +382,30 @@ myTabTheme = def { fontName = myFont -- Theme for showWName which prints current workspace when you change workspaces. myShowWNameTheme :: SWNConfig myShowWNameTheme = def - { swn_font = "xft:Ubuntu:bold:size=60" - , swn_fade = 1.0 - , swn_bgcolor = "#1c1f24" - , swn_color = "#ffffff" - } + { swn_font = "xft:Ubuntu:bold:size=60" + , swn_fade = 1.0 + , swn_bgcolor = "#1c1f24" + , swn_color = "#ffffff" + } -- The layout hook -myLayoutHook = avoidStruts $ mouseResize $ windowArrange $ T.toggleLayouts floats +myLayoutHook = avoidStruts + $ mouseResize + $ windowArrange + $ T.toggleLayouts floats $ mkToggle (NBFULL ?? NOBORDERS ?? EOT) myDefaultLayout - where - myDefaultLayout = withBorder myBorderWidth tall - ||| magnify - ||| noBorders monocle - ||| floats - ||| noBorders tabs - ||| grid - ||| spirals - ||| threeCol - ||| threeRow - ||| tallAccordion - ||| wideAccordion + where + myDefaultLayout = withBorder myBorderWidth tall + ||| magnify + ||| noBorders monocle + ||| floats + ||| noBorders tabs + ||| grid + ||| spirals + ||| threeCol + ||| threeRow + ||| tallAccordion + ||| wideAccordion #+END_SRC * Workspaces @@ -423,30 +426,30 @@ Sets some rules for certain programs. Examples include forcing certain programs #+BEGIN_SRC haskell myManageHook :: XMonad.Query (Data.Monoid.Endo WindowSet) myManageHook = composeAll - -- 'doFloat' forces a window to float. Useful for dialog boxes and such. - -- 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 - -- name of my workspaces and the names would be very long if using clickable workspaces. - [ className =? "confirm" --> doFloat - , className =? "file_progress" --> doFloat - , className =? "dialog" --> doFloat - , className =? "download" --> doFloat - , className =? "error" --> doFloat - , className =? "Gimp" --> doFloat - , className =? "notification" --> doFloat - , className =? "pinentry-gtk-2" --> doFloat - , className =? "splash" --> doFloat - , className =? "toolbar" --> doFloat - , className =? "Yad" --> doCenterFloat - , title =? "Oracle VM VirtualBox Manager" --> doFloat - , title =? "Mozilla Firefox" --> doShift ( myWorkspaces !! 1 ) - , className =? "Brave-browser" --> doShift ( myWorkspaces !! 1 ) - , className =? "mpv" --> doShift ( myWorkspaces !! 7 ) - , className =? "Gimp" --> doShift ( myWorkspaces !! 8 ) - , className =? "VirtualBox Manager" --> doShift ( myWorkspaces !! 4 ) - , (className =? "firefox" <&&> resource =? "Dialog") --> doFloat -- Float Firefox Dialog - , isFullscreen --> doFullFloat - ] <+> namedScratchpadManageHook myScratchPads + -- 'doFloat' forces a window to float. Useful for dialog boxes and such. + -- 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 + -- name of my workspaces and the names would be very long if using clickable workspaces. + [ className =? "confirm" --> doFloat + , className =? "file_progress" --> doFloat + , className =? "dialog" --> doFloat + , className =? "download" --> doFloat + , className =? "error" --> doFloat + , className =? "Gimp" --> doFloat + , className =? "notification" --> doFloat + , className =? "pinentry-gtk-2" --> doFloat + , className =? "splash" --> doFloat + , className =? "toolbar" --> doFloat + , className =? "Yad" --> doCenterFloat + , title =? "Oracle VM VirtualBox Manager" --> doFloat + , title =? "Mozilla Firefox" --> doShift ( myWorkspaces !! 1 ) + , className =? "Brave-browser" --> doShift ( myWorkspaces !! 1 ) + , className =? "mpv" --> doShift ( myWorkspaces !! 7 ) + , className =? "Gimp" --> doShift ( myWorkspaces !! 8 ) + , className =? "VirtualBox Manager" --> doShift ( myWorkspaces !! 4 ) + , (className =? "firefox" <&&> resource =? "Dialog") --> doFloat -- Float Firefox Dialog + , isFullscreen --> doFullFloat + ] <+> namedScratchpadManageHook myScratchPads #+END_SRC * System Sounds @@ -464,9 +467,9 @@ Available sounds that are part of the default =dtos-sounds= package include: #+begin_src haskell soundDir = "/opt/dtos-sounds/" -- The directory that has the sound files -startupSound = soundDir ++ "startup-01.mp3" -shutdownSound = soundDir ++ "shutdown-01.mp3" -dmenuSound = soundDir ++ "menu-01.mp3" +startupSound = soundDir ++ "startup-01.mp3" +shutdownSound = soundDir ++ "shutdown-01.mp3" +dmenuSound = soundDir ++ "menu-01.mp3" #+end_src * Keybindings @@ -500,156 +503,155 @@ I am using the Xmonad.Util.EZConfig module which allows keybindings to be writte #+BEGIN_SRC haskell showKeybindings :: [((KeyMask, KeySym), NamedAction)] -> NamedAction showKeybindings x = addName "Show Keybindings" $ io $ do - h <- spawnPipe $ "yad --text-info --fontname=" ++ myFont ++ " --width 800 --height 600 --center --title \"XMonad keybindings\"" - hPutStr h (unlines $ showKm x) - hClose h - return () + h <- spawnPipe $ "yad --text-info --fontname=\"SauceCodePro Nerd Font Mono 12\" --width 800 --height 600 --center --title \"XMonad keybindings\"" + hPutStr h (unlines $ showKm x) + hClose h + return () myKeys :: XConfig l0 -> [((KeyMask, KeySym), NamedAction)] 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-", 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 - [ ("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-", 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 + , ("M-", addName "Launch terminal" $ spawn (myTerminal)) + , ("M-b", addName "Launch web browser" $ spawn (myBrowser)) + , ("M-M1-h", addName "Launch htop" $ spawn (myTerminal ++ " -e htop")) - -- KB_GROUP Useful programs to have a keybinding for launch - , ("M-", addName "Launch terminal" $ spawn (myTerminal)) - , ("M-b", addName "Launch web browser" $ spawn (myBrowser)) - , ("M-M1-h", addName "Launch htop" $ spawn (myTerminal ++ " -e htop")) + -- KB_GROUP Kill windows + , ("M-S-c", addName "Kill focused window" $ kill1) + , ("M-S-a", addName "Kill all windows on WS" $ killAll) - -- KB_GROUP Kill windows - , ("M-S-c", addName "Kill focused window" $ kill1) - , ("M-S-a", addName "Kill all windows on WS" $ killAll) + -- KB_GROUP Workspaces + , ("M-.", addName "Switch focus to next mon" $ nextScreen) + , ("M-,", addName "Switch focus to prev mon" $ prevScreen) + , ("M-S-" + , addName "Move window to next WS" $ shiftTo Next nonNSP >> moveTo Next nonNSP) + , ("M-S-" + , addName "Move window to prev WS" $ shiftTo Prev nonNSP >> moveTo Prev nonNSP) - -- KB_GROUP Workspaces - , ("M-.", addName "Switch focus to next mon" $ nextScreen) - , ("M-,", addName "Switch focus to prev mon" $ prevScreen) - , ("M-S-" - , addName "Move window to next WS" $ shiftTo Next nonNSP >> moveTo Next nonNSP) - , ("M-S-" - , addName "Move window to prev WS" $ shiftTo Prev nonNSP >> moveTo Prev nonNSP) + -- KB_GROUP Floating windows + , ("M-f", addName "Toggle float layout" $ sendMessage (T.Toggle "floats")) + , ("M-t", addName "Sink a floating window" $ withFocused $ windows . W.sink) + , ("M-S-t", addName "Sink all floated windows" $ sinkAll) - -- KB_GROUP Floating windows - , ("M-f", addName "Toggle float layout" $ sendMessage (T.Toggle "floats")) - , ("M-t", addName "Sink a floating window" $ withFocused $ windows . W.sink) - , ("M-S-t", addName "Sink all floated windows" $ sinkAll) + -- KB_GROUP Increase/decrease spacing (gaps) + , ("C-M1-j", addName "Decrease window spacing" $ decWindowSpacing 4) + , ("C-M1-k", addName "Increase window spacing" $ incWindowSpacing 4) + , ("C-M1-h", addName "Decrease screen spacing" $ decScreenSpacing 4) + , ("C-M1-l", addName "Increase screen spacing" $ incScreenSpacing 4) - -- KB_GROUP Increase/decrease spacing (gaps) - , ("C-M1-j", addName "Decrease window spacing" $ decWindowSpacing 4) - , ("C-M1-k", addName "Increase window spacing" $ incWindowSpacing 4) - , ("C-M1-h", addName "Decrease screen spacing" $ decScreenSpacing 4) - , ("C-M1-l", addName "Increase screen spacing" $ incScreenSpacing 4) + -- KB_GROUP Grid Select (CTR-g followed by a key) + , ("C-g g", addName "Select favorite apps" $ spawnSelected' myAppGrid) + , ("C-g t", addName "Goto selected window" $ goToSelected $ mygridConfig myColorizer) + , ("C-g b", addName "Bring selected window" $ bringSelected $ mygridConfig myColorizer) - -- KB_GROUP Grid Select (CTR-g followed by a key) - , ("C-g g", addName "Select favorite apps" $ spawnSelected' myAppGrid) - , ("C-g t", addName "Goto selected window" $ goToSelected $ mygridConfig myColorizer) - , ("C-g b", addName "Bring selected window" $ bringSelected $ mygridConfig myColorizer) + -- KB_GROUP Windows navigation + , ("M-m", addName "Move focus to master window" $ windows W.focusMaster) + , ("M-j", addName "Move focus to next window" $ windows W.focusDown) + , ("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-", addName "Move focused window to master" $ promote) + , ("M-S-", addName "Rotate all windows except master" $ rotSlavesDown) + , ("M-C-", addName "Rotate all windows current stack" $ rotAllDown) - -- KB_GROUP Windows navigation - , ("M-m", addName "" $ windows W.focusMaster) -- Move focus to the master window - , ("M-j", addName "" $ windows W.focusDown) -- Move focus to the next window - , ("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-", addName "" $ promote) -- Moves focused window to master, others maintain order - , ("M-S-", addName "" $ rotSlavesDown) -- Rotate all windows except master and keep focus in place - , ("M-C-", addName "" $ rotAllDown) -- Rotate all the windows in the current stack + -- KB_GROUP Layouts + , ("M-", addName "Switch to next layout" $ sendMessage NextLayout) + , ("M-", addName "Toggle noborders/full" $ sendMessage (MT.Toggle NBFULL) >> sendMessage ToggleStruts) - -- KB_GROUP Layouts - , ("M-", addName "" $ sendMessage NextLayout) -- Switch to next layout - , ("M-", addName "" $ sendMessage (MT.Toggle NBFULL) >> sendMessage ToggleStruts) -- Toggles noborder/full + -- KB_GROUP Increase/decrease windows in the master pane or the stack + , ("M-S-", addName "Increase clients in master pane" $ sendMessage (IncMasterN 1)) + , ("M-S-", addName "Decrease clients in master pane" $ sendMessage (IncMasterN (-1))) + , ("M-C-", addName "Increase # of windows" $ increaseLimit) + , ("M-C-", addName "Decrease # of windows" $ decreaseLimit) - -- KB_GROUP Increase/decrease windows in the master pane or the stack - , ("M-S-", addName "" $ sendMessage (IncMasterN 1)) -- Increase # of clients master pane - , ("M-S-", addName "" $ sendMessage (IncMasterN (-1))) -- Decrease # of clients master pane - , ("M-C-", addName "" $ increaseLimit) -- Increase # of windows - , ("M-C-", addName "" $ decreaseLimit) -- Decrease # of windows + -- KB_GROUP Window resizing + , ("M-h", addName "Shrink window" $ sendMessage Shrink) + , ("M-l", addName "Expand window" $ sendMessage Expand) + , ("M-M1-j", addName "Shrink window vertically" $ sendMessage MirrorShrink) + , ("M-M1-k", addName "Expand window vertically" $ sendMessage MirrorExpand) - -- KB_GROUP Window resizing - , ("M-h", addName "Shrink window" $ sendMessage Shrink) -- Shrink horiz window width - , ("M-l", addName "Expand window" $ sendMessage Expand) -- Expand horiz window width - , ("M-M1-j", addName "Shrink window vertically" $ sendMessage MirrorShrink) -- Shrink vert window width - , ("M-M1-k", addName "Expand window vertically" $ sendMessage MirrorExpand) -- Expand vert window width + -- KB_GROUP Sublayouts + -- This is used to push windows to tabbed sublayouts, or pull them out of it. + , ("M-C-h", addName "" $ sendMessage $ pullGroup L) + , ("M-C-l", addName "" $ sendMessage $ pullGroup R) + , ("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 - -- This is used to push windows to tabbed sublayouts, or pull them out of it. - , ("M-C-h", addName "" $ sendMessage $ pullGroup L) - , ("M-C-l", addName "" $ sendMessage $ pullGroup R) - , ("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 Scratchpads + -- Toggle show/hide these programs. They run on a hidden workspace. + -- When you toggle them to show, it brings them to your current workspace. + -- Toggle them to hide and it sends them back to hidden workspace (NSP). + , ("M-s t", addName "Toggle scratchpad terminal" $ namedScratchpadAction myScratchPads "terminal") + , ("M-s m", addName "Toggle scratchpad mocp" $ namedScratchpadAction myScratchPads "mocp") + , ("M-s c", addName "Toggle scratchpad calculator" $ namedScratchpadAction myScratchPads "calculator") - -- KB_GROUP Scratchpads - -- Toggle show/hide these programs. They run on a hidden workspace. - -- When you toggle them to show, it brings them to your current workspace. - -- Toggle them to hide and it sends them back to hidden workspace (NSP). - , ("M-s t", addName "" $ namedScratchpadAction myScratchPads "terminal") - , ("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) + , ("M-u p", addName "" $ spawn "mocp --play") + , ("M-u l", addName "" $ spawn "mocp --next") + , ("M-u h", addName "" $ spawn "mocp --previous") + , ("M-u ", addName "" $ spawn "mocp --toggle-pause") - -- KB_GROUP Controls for mocp music player (SUPER-u followed by a key) - , ("M-u p", addName "" $ spawn "mocp --play") - , ("M-u l", addName "" $ spawn "mocp --next") - , ("M-u h", addName "" $ spawn "mocp --previous") - , ("M-u ", addName "" $ spawn "mocp --toggle-pause") + -- KB_GROUP Emacs (SUPER-e followed by a key) + , ("M-e e", addName "Emacsclient Dashboard" $ spawn (myEmacs ++ ("--eval '(dashboard-refresh-buffer)'"))) -- emacs dashboard + , ("M-e b", addName "Emacsclient Ibuffer" $ spawn (myEmacs ++ ("--eval '(ibuffer)'"))) -- list buffers + , ("M-e d", addName "Emacsclient Dired" $ spawn (myEmacs ++ ("--eval '(dired nil)'"))) -- dired + , ("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) - , ("M-e e", addName "" $ spawn (myEmacs ++ ("--eval '(dashboard-refresh-buffer)'"))) -- emacs dashboard - , ("M-e b", addName "" $ spawn (myEmacs ++ ("--eval '(ibuffer)'"))) -- list buffers - , ("M-e d", addName "" $ spawn (myEmacs ++ ("--eval '(dired nil)'"))) -- dired - , ("M-e i", addName "" $ spawn (myEmacs ++ ("--eval '(erc)'"))) -- erc irc client - , ("M-e n", addName "" $ spawn (myEmacs ++ ("--eval '(elfeed)'"))) -- elfeed rss - , ("M-e s", addName "" $ spawn (myEmacs ++ ("--eval '(eshell)'"))) -- eshell - , ("M-e t", addName "" $ spawn (myEmacs ++ ("--eval '(mastodon)'"))) -- mastodon.el - , ("M-e v", addName "" $ spawn (myEmacs ++ ("--eval '(+vterm/here nil)'"))) -- vterm if on Doom Emacs - , ("M-e w", addName "" $ spawn (myEmacs ++ ("--eval '(doom/window-maximize-buffer(eww \"distro.tube\"))'"))) -- eww browser if on Doom Emacs - , ("M-e a", addName "" $ spawn (myEmacs ++ ("--eval '(emms)' --eval '(emms-play-directory-tree \"~/Music/\")'"))) + -- KB_GROUP Multimedia Keys + , ("", addName "" $ spawn "mocp --play") + , ("", addName "" $ spawn "mocp --previous") + , ("", addName "" $ spawn "mocp --next") + , ("", addName "" $ spawn "amixer set Master toggle") + , ("", addName "" $ spawn "amixer set Master 5%- unmute") + , ("", addName "" $ spawn "amixer set Master 5%+ unmute") + , ("", addName "" $ spawn "qutebrowser https://www.youtube.com/c/DistroTube") + , ("", addName "" $ spawn "dm-websearch") + , ("", addName "" $ runOrRaise "thunderbird" (resource =? "thunderbird")) + , ("", addName "" $ runOrRaise "qalculate-gtk" (resource =? "qalculate-gtk")) + , ("", addName "" $ spawn "toggleeject") + , ("", 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 - , ("", addName "" $ spawn "mocp --play") - , ("", addName "" $ spawn "mocp --previous") - , ("", addName "" $ spawn "mocp --next") - , ("", addName "" $ spawn "amixer set Master toggle") - , ("", addName "" $ spawn "amixer set Master 5%- unmute") - , ("", addName "" $ spawn "amixer set Master 5%+ unmute") - , ("", addName "" $ spawn "qutebrowser https://www.youtube.com/c/DistroTube") - , ("", addName "" $ spawn "dm-websearch") - , ("", addName "" $ runOrRaise "thunderbird" (resource =? "thunderbird")) - , ("", addName "" $ runOrRaise "qalculate-gtk" (resource =? "qalculate-gtk")) - , ("", addName "" $ spawn "toggleeject") - , ("", 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 * Main @@ -658,52 +660,52 @@ This is the "main" of XMonad. This where everything in our configs comes togethe #+BEGIN_SRC haskell main :: IO () main = do - -- Launching three instances of xmobar on their monitors. - xmproc0 <- spawnPipe ("xmobar -x 0 $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") - -- the xmonad, ya know...what the WM is named after! - xmonad $ addDescrKeys ((mod4Mask, xK_F1), showKeybindings) myKeys $ ewmh def - { manageHook = myManageHook <+> manageDocks - , handleEventHook = docksEventHook - -- Uncomment this line to enable fullscreen support on things like YouTube/Netflix. - -- 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 - -- is to use a keybinding to toggle fullscreen noborders instead. (M-) - -- <+> fullscreenEventHook - , modMask = myModMask - , terminal = myTerminal - , startupHook = myStartupHook - , layoutHook = showWName' myShowWNameTheme $ myLayoutHook - , workspaces = myWorkspaces - , borderWidth = myBorderWidth - , normalBorderColor = myNormColor - , focusedBorderColor = myFocusColor - , logHook = dynamicLogWithPP $ namedScratchpadFilterOutWorkspacePP $ xmobarPP - -- XMOBAR SETTINGS - { ppOutput = \x -> hPutStrLn xmproc0 x -- xmobar on monitor 1 - >> hPutStrLn xmproc1 x -- xmobar on monitor 2 - >> hPutStrLn xmproc2 x -- xmobar on monitor 3 - -- Current workspace - , ppCurrent = xmobarColor color06 "" . wrap - ("") "" - -- Visible but not current workspace - , ppVisible = xmobarColor color06 "" . clickable - -- Hidden workspace - , ppHidden = xmobarColor color05 "" . wrap - ("") "" . clickable - -- Hidden workspaces (no windows) - , ppHiddenNoWindows = xmobarColor color05 "" . clickable - -- Title of active window - , ppTitle = xmobarColor color16 "" . shorten 60 - -- Separator character - , ppSep = " | " - -- Urgent workspace - , ppUrgent = xmobarColor color02 "" . wrap "!" "!" - -- Adding # of windows on current workspace to the bar - , ppExtras = [windowCount] - -- order of things in xmobar - , ppOrder = \(ws:l:t:ex) -> [ws,l]++ex++[t] - } - } -- `additionalKeysP` myKeys + -- Launching three instances of xmobar on their monitors. + xmproc0 <- spawnPipe ("xmobar -x 0 $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") + -- the xmonad, ya know...what the WM is named after! + xmonad $ addDescrKeys ((mod4Mask, xK_F1), showKeybindings) myKeys $ ewmh def + { manageHook = myManageHook <+> manageDocks + , handleEventHook = docksEventHook + -- Uncomment this line to enable fullscreen support on things like YouTube/Netflix. + -- 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 + -- is to use a keybinding to toggle fullscreen noborders instead. (M-) + -- <+> fullscreenEventHook + , modMask = myModMask + , terminal = myTerminal + , startupHook = myStartupHook + , layoutHook = showWName' myShowWNameTheme $ myLayoutHook + , workspaces = myWorkspaces + , borderWidth = myBorderWidth + , normalBorderColor = myNormColor + , focusedBorderColor = myFocusColor + , logHook = dynamicLogWithPP $ namedScratchpadFilterOutWorkspacePP $ xmobarPP + -- XMOBAR SETTINGS + { ppOutput = \x -> hPutStrLn xmproc0 x -- xmobar on monitor 1 + >> hPutStrLn xmproc1 x -- xmobar on monitor 2 + >> hPutStrLn xmproc2 x -- xmobar on monitor 3 + -- Current workspace + , ppCurrent = xmobarColor color06 "" . wrap + ("") "" + -- Visible but not current workspace + , ppVisible = xmobarColor color06 "" . clickable + -- Hidden workspace + , ppHidden = xmobarColor color05 "" . wrap + ("") "" . clickable + -- Hidden workspaces (no windows) + , ppHiddenNoWindows = xmobarColor color05 "" . clickable + -- Title of active window + , ppTitle = xmobarColor color16 "" . shorten 60 + -- Separator character + , ppSep = " | " + -- Urgent workspace + , ppUrgent = xmobarColor color02 "" . wrap "!" "!" + -- Adding # of windows on current workspace to the bar + , ppExtras = [windowCount] + -- order of things in xmobar + , ppOrder = \(ws:l:t:ex) -> [ws,l]++ex++[t] + } + } -- `additionalKeysP` myKeys #+END_SRC diff --git a/.xmonad/xmonad.hs b/.xmonad/xmonad.hs index 5c445f7..c551aaf 100644 --- a/.xmonad/xmonad.hs +++ b/.xmonad/xmonad.hs @@ -117,32 +117,32 @@ windowCount = gets $ Just . show . length . W.integrate' . W.stack . W.workspace myStartupHook :: X () myStartupHook = do - spawnOnce (mySoundPlayer ++ startupSound) - spawn "killall conky" -- kill current conky on each restart - spawn "killall trayer" -- kill current trayer on each restart + spawnOnce (mySoundPlayer ++ startupSound) + spawn "killall conky" -- kill current conky on each restart + spawn "killall trayer" -- kill current trayer on each restart - spawnOnce "lxsession" - spawnOnce "picom" - spawnOnce "nm-applet" - spawnOnce "volumeicon" - spawn "/usr/bin/emacs --daemon" -- emacs daemon for the emacsclient + spawnOnce "lxsession" + spawnOnce "picom" + spawnOnce "nm-applet" + spawnOnce "volumeicon" + 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 && 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 && 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") - spawnOnce "xargs xwallpaper --stretch < ~/.cache/wall" - -- spawnOnce "~/.fehbg &" -- set last saved feh wallpaper - -- spawnOnce "feh --randomize --bg-fill ~/wallpapers/*" -- feh set random wallpaper - -- spawnOnce "nitrogen --restore &" -- if you prefer nitrogen to feh - setWMName "LG3D" + spawnOnce "xargs xwallpaper --stretch < ~/.cache/wall" + -- spawnOnce "~/.fehbg &" -- set last saved feh wallpaper + -- spawnOnce "feh --randomize --bg-fill ~/wallpapers/*" -- feh set random wallpaper + -- spawnOnce "nitrogen --restore &" -- if you prefer nitrogen to feh + setWMName "LG3D" myColorizer :: Window -> Bool -> X (String, String) myColorizer = colorRangeFromClassName - (0x28,0x2c,0x34) -- lowest inactive bg - (0x28,0x2c,0x34) -- highest inactive bg - (0xc7,0x92,0xea) -- active bg - (0xc0,0xa7,0x9a) -- inactive fg - (0x28,0x2c,0x34) -- active fg + (0x28,0x2c,0x34) -- lowest inactive bg + (0x28,0x2c,0x34) -- highest inactive bg + (0xc7,0x92,0xea) -- active bg + (0xc0,0xa7,0x9a) -- inactive fg + (0x28,0x2c,0x34) -- active fg -- gridSelect menu layout mygridConfig :: p -> GSConfig Window @@ -167,18 +167,18 @@ spawnSelected' lst = gridselect conf lst >>= flip whenJust spawn } myAppGrid = [ ("Audacity", "audacity") - , ("Deadbeef", "deadbeef") - , ("Emacs", "emacsclient -c -a emacs") - , ("Firefox", "firefox") - , ("Geany", "geany") - , ("Geary", "geary") - , ("Gimp", "gimp") - , ("Kdenlive", "kdenlive") - , ("LibreOffice Impress", "loimpress") - , ("LibreOffice Writer", "lowriter") - , ("OBS", "obs") - , ("PCManFM", "pcmanfm") - ] + , ("Deadbeef", "deadbeef") + , ("Emacs", "emacsclient -c -a emacs") + , ("Firefox", "firefox") + , ("Geany", "geany") + , ("Geary", "geary") + , ("Gimp", "gimp") + , ("Kdenlive", "kdenlive") + , ("LibreOffice Impress", "loimpress") + , ("LibreOffice Writer", "lowriter") + , ("OBS", "obs") + , ("PCManFM", "pcmanfm") + ] myScratchPads :: [NamedScratchpad] 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. myShowWNameTheme :: SWNConfig myShowWNameTheme = def - { swn_font = "xft:Ubuntu:bold:size=60" - , swn_fade = 1.0 - , swn_bgcolor = "#1c1f24" - , swn_color = "#ffffff" - } + { swn_font = "xft:Ubuntu:bold:size=60" + , swn_fade = 1.0 + , swn_bgcolor = "#1c1f24" + , swn_color = "#ffffff" + } -- The layout hook -myLayoutHook = avoidStruts $ mouseResize $ windowArrange $ T.toggleLayouts floats +myLayoutHook = avoidStruts + $ mouseResize + $ windowArrange + $ T.toggleLayouts floats $ mkToggle (NBFULL ?? NOBORDERS ?? EOT) myDefaultLayout - where - myDefaultLayout = withBorder myBorderWidth tall - ||| magnify - ||| noBorders monocle - ||| floats - ||| noBorders tabs - ||| grid - ||| spirals - ||| threeCol - ||| threeRow - ||| tallAccordion - ||| wideAccordion + where + myDefaultLayout = withBorder myBorderWidth tall + ||| magnify + ||| noBorders monocle + ||| floats + ||| noBorders tabs + ||| grid + ||| spirals + ||| threeCol + ||| threeRow + ||| tallAccordion + ||| wideAccordion -- myWorkspaces = [" 1 ", " 2 ", " 3 ", " 4 ", " 5 ", " 6 ", " 7 ", " 8 ", " 9 "] myWorkspaces = [" dev ", " www ", " sys ", " doc ", " vbox ", " chat ", " mus ", " vid ", " gfx "] @@ -335,237 +338,235 @@ clickable ws = ""++ws++"" myManageHook :: XMonad.Query (Data.Monoid.Endo WindowSet) myManageHook = composeAll - -- 'doFloat' forces a window to float. Useful for dialog boxes and such. - -- 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 - -- name of my workspaces and the names would be very long if using clickable workspaces. - [ className =? "confirm" --> doFloat - , className =? "file_progress" --> doFloat - , className =? "dialog" --> doFloat - , className =? "download" --> doFloat - , className =? "error" --> doFloat - , className =? "Gimp" --> doFloat - , className =? "notification" --> doFloat - , className =? "pinentry-gtk-2" --> doFloat - , className =? "splash" --> doFloat - , className =? "toolbar" --> doFloat - , className =? "Yad" --> doCenterFloat - , title =? "Oracle VM VirtualBox Manager" --> doFloat - , title =? "Mozilla Firefox" --> doShift ( myWorkspaces !! 1 ) - , className =? "Brave-browser" --> doShift ( myWorkspaces !! 1 ) - , className =? "mpv" --> doShift ( myWorkspaces !! 7 ) - , className =? "Gimp" --> doShift ( myWorkspaces !! 8 ) - , className =? "VirtualBox Manager" --> doShift ( myWorkspaces !! 4 ) - , (className =? "firefox" <&&> resource =? "Dialog") --> doFloat -- Float Firefox Dialog - , isFullscreen --> doFullFloat - ] <+> namedScratchpadManageHook myScratchPads + -- 'doFloat' forces a window to float. Useful for dialog boxes and such. + -- 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 + -- name of my workspaces and the names would be very long if using clickable workspaces. + [ className =? "confirm" --> doFloat + , className =? "file_progress" --> doFloat + , className =? "dialog" --> doFloat + , className =? "download" --> doFloat + , className =? "error" --> doFloat + , className =? "Gimp" --> doFloat + , className =? "notification" --> doFloat + , className =? "pinentry-gtk-2" --> doFloat + , className =? "splash" --> doFloat + , className =? "toolbar" --> doFloat + , className =? "Yad" --> doCenterFloat + , title =? "Oracle VM VirtualBox Manager" --> doFloat + , title =? "Mozilla Firefox" --> doShift ( myWorkspaces !! 1 ) + , className =? "Brave-browser" --> doShift ( myWorkspaces !! 1 ) + , className =? "mpv" --> doShift ( myWorkspaces !! 7 ) + , className =? "Gimp" --> doShift ( myWorkspaces !! 8 ) + , className =? "VirtualBox Manager" --> doShift ( myWorkspaces !! 4 ) + , (className =? "firefox" <&&> resource =? "Dialog") --> doFloat -- Float Firefox Dialog + , isFullscreen --> doFullFloat + ] <+> namedScratchpadManageHook myScratchPads soundDir = "/opt/dtos-sounds/" -- The directory that has the sound files -startupSound = soundDir ++ "startup-01.mp3" -shutdownSound = soundDir ++ "shutdown-01.mp3" -dmenuSound = soundDir ++ "menu-01.mp3" +startupSound = soundDir ++ "startup-01.mp3" +shutdownSound = soundDir ++ "shutdown-01.mp3" +dmenuSound = soundDir ++ "menu-01.mp3" showKeybindings :: [((KeyMask, KeySym), NamedAction)] -> NamedAction showKeybindings x = addName "Show Keybindings" $ io $ do - h <- spawnPipe $ "yad --text-info --fontname=" ++ myFont ++ " --width 800 --height 600 --center --title \"XMonad keybindings\"" - hPutStr h (unlines $ showKm x) - hClose h - return () + h <- spawnPipe $ "yad --text-info --fontname=\"SauceCodePro Nerd Font Mono 12\" --width 800 --height 600 --center --title \"XMonad keybindings\"" + hPutStr h (unlines $ showKm x) + hClose h + return () myKeys :: XConfig l0 -> [((KeyMask, KeySym), NamedAction)] 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-", 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 - [ ("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-", 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 + , ("M-", addName "Launch terminal" $ spawn (myTerminal)) + , ("M-b", addName "Launch web browser" $ spawn (myBrowser)) + , ("M-M1-h", addName "Launch htop" $ spawn (myTerminal ++ " -e htop")) - -- KB_GROUP Useful programs to have a keybinding for launch - , ("M-", addName "Launch terminal" $ spawn (myTerminal)) - , ("M-b", addName "Launch web browser" $ spawn (myBrowser)) - , ("M-M1-h", addName "Launch htop" $ spawn (myTerminal ++ " -e htop")) + -- KB_GROUP Kill windows + , ("M-S-c", addName "Kill focused window" $ kill1) + , ("M-S-a", addName "Kill all windows on WS" $ killAll) - -- KB_GROUP Kill windows - , ("M-S-c", addName "Kill focused window" $ kill1) - , ("M-S-a", addName "Kill all windows on WS" $ killAll) + -- KB_GROUP Workspaces + , ("M-.", addName "Switch focus to next mon" $ nextScreen) + , ("M-,", addName "Switch focus to prev mon" $ prevScreen) + , ("M-S-" + , addName "Move window to next WS" $ shiftTo Next nonNSP >> moveTo Next nonNSP) + , ("M-S-" + , addName "Move window to prev WS" $ shiftTo Prev nonNSP >> moveTo Prev nonNSP) - -- KB_GROUP Workspaces - , ("M-.", addName "Switch focus to next mon" $ nextScreen) - , ("M-,", addName "Switch focus to prev mon" $ prevScreen) - , ("M-S-" - , addName "Move window to next WS" $ shiftTo Next nonNSP >> moveTo Next nonNSP) - , ("M-S-" - , addName "Move window to prev WS" $ shiftTo Prev nonNSP >> moveTo Prev nonNSP) + -- KB_GROUP Floating windows + , ("M-f", addName "Toggle float layout" $ sendMessage (T.Toggle "floats")) + , ("M-t", addName "Sink a floating window" $ withFocused $ windows . W.sink) + , ("M-S-t", addName "Sink all floated windows" $ sinkAll) - -- KB_GROUP Floating windows - , ("M-f", addName "Toggle float layout" $ sendMessage (T.Toggle "floats")) - , ("M-t", addName "Sink a floating window" $ withFocused $ windows . W.sink) - , ("M-S-t", addName "Sink all floated windows" $ sinkAll) + -- KB_GROUP Increase/decrease spacing (gaps) + , ("C-M1-j", addName "Decrease window spacing" $ decWindowSpacing 4) + , ("C-M1-k", addName "Increase window spacing" $ incWindowSpacing 4) + , ("C-M1-h", addName "Decrease screen spacing" $ decScreenSpacing 4) + , ("C-M1-l", addName "Increase screen spacing" $ incScreenSpacing 4) - -- KB_GROUP Increase/decrease spacing (gaps) - , ("C-M1-j", addName "Decrease window spacing" $ decWindowSpacing 4) - , ("C-M1-k", addName "Increase window spacing" $ incWindowSpacing 4) - , ("C-M1-h", addName "Decrease screen spacing" $ decScreenSpacing 4) - , ("C-M1-l", addName "Increase screen spacing" $ incScreenSpacing 4) + -- KB_GROUP Grid Select (CTR-g followed by a key) + , ("C-g g", addName "Select favorite apps" $ spawnSelected' myAppGrid) + , ("C-g t", addName "Goto selected window" $ goToSelected $ mygridConfig myColorizer) + , ("C-g b", addName "Bring selected window" $ bringSelected $ mygridConfig myColorizer) - -- KB_GROUP Grid Select (CTR-g followed by a key) - , ("C-g g", addName "Select favorite apps" $ spawnSelected' myAppGrid) - , ("C-g t", addName "Goto selected window" $ goToSelected $ mygridConfig myColorizer) - , ("C-g b", addName "Bring selected window" $ bringSelected $ mygridConfig myColorizer) + -- KB_GROUP Windows navigation + , ("M-m", addName "Move focus to master window" $ windows W.focusMaster) + , ("M-j", addName "Move focus to next window" $ windows W.focusDown) + , ("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-", addName "Move focused window to master" $ promote) + , ("M-S-", addName "Rotate all windows except master" $ rotSlavesDown) + , ("M-C-", addName "Rotate all windows current stack" $ rotAllDown) - -- KB_GROUP Windows navigation - , ("M-m", addName "" $ windows W.focusMaster) -- Move focus to the master window - , ("M-j", addName "" $ windows W.focusDown) -- Move focus to the next window - , ("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-", addName "" $ promote) -- Moves focused window to master, others maintain order - , ("M-S-", addName "" $ rotSlavesDown) -- Rotate all windows except master and keep focus in place - , ("M-C-", addName "" $ rotAllDown) -- Rotate all the windows in the current stack + -- KB_GROUP Layouts + , ("M-", addName "Switch to next layout" $ sendMessage NextLayout) + , ("M-", addName "Toggle noborders/full" $ sendMessage (MT.Toggle NBFULL) >> sendMessage ToggleStruts) - -- KB_GROUP Layouts - , ("M-", addName "" $ sendMessage NextLayout) -- Switch to next layout - , ("M-", addName "" $ sendMessage (MT.Toggle NBFULL) >> sendMessage ToggleStruts) -- Toggles noborder/full + -- KB_GROUP Increase/decrease windows in the master pane or the stack + , ("M-S-", addName "Increase clients in master pane" $ sendMessage (IncMasterN 1)) + , ("M-S-", addName "Decrease clients in master pane" $ sendMessage (IncMasterN (-1))) + , ("M-C-", addName "Increase # of windows" $ increaseLimit) + , ("M-C-", addName "Decrease # of windows" $ decreaseLimit) - -- KB_GROUP Increase/decrease windows in the master pane or the stack - , ("M-S-", addName "" $ sendMessage (IncMasterN 1)) -- Increase # of clients master pane - , ("M-S-", addName "" $ sendMessage (IncMasterN (-1))) -- Decrease # of clients master pane - , ("M-C-", addName "" $ increaseLimit) -- Increase # of windows - , ("M-C-", addName "" $ decreaseLimit) -- Decrease # of windows + -- KB_GROUP Window resizing + , ("M-h", addName "Shrink window" $ sendMessage Shrink) + , ("M-l", addName "Expand window" $ sendMessage Expand) + , ("M-M1-j", addName "Shrink window vertically" $ sendMessage MirrorShrink) + , ("M-M1-k", addName "Expand window vertically" $ sendMessage MirrorExpand) - -- KB_GROUP Window resizing - , ("M-h", addName "Shrink window" $ sendMessage Shrink) -- Shrink horiz window width - , ("M-l", addName "Expand window" $ sendMessage Expand) -- Expand horiz window width - , ("M-M1-j", addName "Shrink window vertically" $ sendMessage MirrorShrink) -- Shrink vert window width - , ("M-M1-k", addName "Expand window vertically" $ sendMessage MirrorExpand) -- Expand vert window width + -- KB_GROUP Sublayouts + -- This is used to push windows to tabbed sublayouts, or pull them out of it. + , ("M-C-h", addName "" $ sendMessage $ pullGroup L) + , ("M-C-l", addName "" $ sendMessage $ pullGroup R) + , ("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 - -- This is used to push windows to tabbed sublayouts, or pull them out of it. - , ("M-C-h", addName "" $ sendMessage $ pullGroup L) - , ("M-C-l", addName "" $ sendMessage $ pullGroup R) - , ("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 Scratchpads + -- Toggle show/hide these programs. They run on a hidden workspace. + -- When you toggle them to show, it brings them to your current workspace. + -- Toggle them to hide and it sends them back to hidden workspace (NSP). + , ("M-s t", addName "Toggle scratchpad terminal" $ namedScratchpadAction myScratchPads "terminal") + , ("M-s m", addName "Toggle scratchpad mocp" $ namedScratchpadAction myScratchPads "mocp") + , ("M-s c", addName "Toggle scratchpad calculator" $ namedScratchpadAction myScratchPads "calculator") - -- KB_GROUP Scratchpads - -- Toggle show/hide these programs. They run on a hidden workspace. - -- When you toggle them to show, it brings them to your current workspace. - -- Toggle them to hide and it sends them back to hidden workspace (NSP). - , ("M-s t", addName "" $ namedScratchpadAction myScratchPads "terminal") - , ("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) + , ("M-u p", addName "" $ spawn "mocp --play") + , ("M-u l", addName "" $ spawn "mocp --next") + , ("M-u h", addName "" $ spawn "mocp --previous") + , ("M-u ", addName "" $ spawn "mocp --toggle-pause") - -- KB_GROUP Controls for mocp music player (SUPER-u followed by a key) - , ("M-u p", addName "" $ spawn "mocp --play") - , ("M-u l", addName "" $ spawn "mocp --next") - , ("M-u h", addName "" $ spawn "mocp --previous") - , ("M-u ", addName "" $ spawn "mocp --toggle-pause") + -- KB_GROUP Emacs (SUPER-e followed by a key) + , ("M-e e", addName "Emacsclient Dashboard" $ spawn (myEmacs ++ ("--eval '(dashboard-refresh-buffer)'"))) -- emacs dashboard + , ("M-e b", addName "Emacsclient Ibuffer" $ spawn (myEmacs ++ ("--eval '(ibuffer)'"))) -- list buffers + , ("M-e d", addName "Emacsclient Dired" $ spawn (myEmacs ++ ("--eval '(dired nil)'"))) -- dired + , ("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) - , ("M-e e", addName "" $ spawn (myEmacs ++ ("--eval '(dashboard-refresh-buffer)'"))) -- emacs dashboard - , ("M-e b", addName "" $ spawn (myEmacs ++ ("--eval '(ibuffer)'"))) -- list buffers - , ("M-e d", addName "" $ spawn (myEmacs ++ ("--eval '(dired nil)'"))) -- dired - , ("M-e i", addName "" $ spawn (myEmacs ++ ("--eval '(erc)'"))) -- erc irc client - , ("M-e n", addName "" $ spawn (myEmacs ++ ("--eval '(elfeed)'"))) -- elfeed rss - , ("M-e s", addName "" $ spawn (myEmacs ++ ("--eval '(eshell)'"))) -- eshell - , ("M-e t", addName "" $ spawn (myEmacs ++ ("--eval '(mastodon)'"))) -- mastodon.el - , ("M-e v", addName "" $ spawn (myEmacs ++ ("--eval '(+vterm/here nil)'"))) -- vterm if on Doom Emacs - , ("M-e w", addName "" $ spawn (myEmacs ++ ("--eval '(doom/window-maximize-buffer(eww \"distro.tube\"))'"))) -- eww browser if on Doom Emacs - , ("M-e a", addName "" $ spawn (myEmacs ++ ("--eval '(emms)' --eval '(emms-play-directory-tree \"~/Music/\")'"))) - - -- KB_GROUP Multimedia Keys - , ("", addName "" $ spawn "mocp --play") - , ("", addName "" $ spawn "mocp --previous") - , ("", addName "" $ spawn "mocp --next") - , ("", addName "" $ spawn "amixer set Master toggle") - , ("", addName "" $ spawn "amixer set Master 5%- unmute") - , ("", addName "" $ spawn "amixer set Master 5%+ unmute") - , ("", addName "" $ spawn "qutebrowser https://www.youtube.com/c/DistroTube") - , ("", addName "" $ spawn "dm-websearch") - , ("", addName "" $ runOrRaise "thunderbird" (resource =? "thunderbird")) - , ("", addName "" $ runOrRaise "qalculate-gtk" (resource =? "qalculate-gtk")) - , ("", addName "" $ spawn "toggleeject") - , ("", 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 + -- KB_GROUP Multimedia Keys + , ("", addName "" $ spawn "mocp --play") + , ("", addName "" $ spawn "mocp --previous") + , ("", addName "" $ spawn "mocp --next") + , ("", addName "" $ spawn "amixer set Master toggle") + , ("", addName "" $ spawn "amixer set Master 5%- unmute") + , ("", addName "" $ spawn "amixer set Master 5%+ unmute") + , ("", addName "" $ spawn "qutebrowser https://www.youtube.com/c/DistroTube") + , ("", addName "" $ spawn "dm-websearch") + , ("", addName "" $ runOrRaise "thunderbird" (resource =? "thunderbird")) + , ("", addName "" $ runOrRaise "qalculate-gtk" (resource =? "qalculate-gtk")) + , ("", addName "" $ spawn "toggleeject") + , ("", 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")) main :: IO () main = do - -- Launching three instances of xmobar on their monitors. - xmproc0 <- spawnPipe ("xmobar -x 0 $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") - -- the xmonad, ya know...what the WM is named after! - xmonad $ addDescrKeys ((mod4Mask, xK_F1), showKeybindings) myKeys $ ewmh def - { manageHook = myManageHook <+> manageDocks - , handleEventHook = docksEventHook - -- Uncomment this line to enable fullscreen support on things like YouTube/Netflix. - -- 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 - -- is to use a keybinding to toggle fullscreen noborders instead. (M-) - -- <+> fullscreenEventHook - , modMask = myModMask - , terminal = myTerminal - , startupHook = myStartupHook - , layoutHook = showWName' myShowWNameTheme $ myLayoutHook - , workspaces = myWorkspaces - , borderWidth = myBorderWidth - , normalBorderColor = myNormColor - , focusedBorderColor = myFocusColor - , logHook = dynamicLogWithPP $ namedScratchpadFilterOutWorkspacePP $ xmobarPP - -- XMOBAR SETTINGS - { ppOutput = \x -> hPutStrLn xmproc0 x -- xmobar on monitor 1 - >> hPutStrLn xmproc1 x -- xmobar on monitor 2 - >> hPutStrLn xmproc2 x -- xmobar on monitor 3 - -- Current workspace - , ppCurrent = xmobarColor color06 "" . wrap - ("") "" - -- Visible but not current workspace - , ppVisible = xmobarColor color06 "" . clickable - -- Hidden workspace - , ppHidden = xmobarColor color05 "" . wrap - ("") "" . clickable - -- Hidden workspaces (no windows) - , ppHiddenNoWindows = xmobarColor color05 "" . clickable - -- Title of active window - , ppTitle = xmobarColor color16 "" . shorten 60 - -- Separator character - , ppSep = " | " - -- Urgent workspace - , ppUrgent = xmobarColor color02 "" . wrap "!" "!" - -- Adding # of windows on current workspace to the bar - , ppExtras = [windowCount] - -- order of things in xmobar - , ppOrder = \(ws:l:t:ex) -> [ws,l]++ex++[t] - } - } -- `additionalKeysP` myKeys + -- Launching three instances of xmobar on their monitors. + xmproc0 <- spawnPipe ("xmobar -x 0 $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") + -- the xmonad, ya know...what the WM is named after! + xmonad $ addDescrKeys ((mod4Mask, xK_F1), showKeybindings) myKeys $ ewmh def + { manageHook = myManageHook <+> manageDocks + , handleEventHook = docksEventHook + -- Uncomment this line to enable fullscreen support on things like YouTube/Netflix. + -- 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 + -- is to use a keybinding to toggle fullscreen noborders instead. (M-) + -- <+> fullscreenEventHook + , modMask = myModMask + , terminal = myTerminal + , startupHook = myStartupHook + , layoutHook = showWName' myShowWNameTheme $ myLayoutHook + , workspaces = myWorkspaces + , borderWidth = myBorderWidth + , normalBorderColor = myNormColor + , focusedBorderColor = myFocusColor + , logHook = dynamicLogWithPP $ namedScratchpadFilterOutWorkspacePP $ xmobarPP + -- XMOBAR SETTINGS + { ppOutput = \x -> hPutStrLn xmproc0 x -- xmobar on monitor 1 + >> hPutStrLn xmproc1 x -- xmobar on monitor 2 + >> hPutStrLn xmproc2 x -- xmobar on monitor 3 + -- Current workspace + , ppCurrent = xmobarColor color06 "" . wrap + ("") "" + -- Visible but not current workspace + , ppVisible = xmobarColor color06 "" . clickable + -- Hidden workspace + , ppHidden = xmobarColor color05 "" . wrap + ("") "" . clickable + -- Hidden workspaces (no windows) + , ppHiddenNoWindows = xmobarColor color05 "" . clickable + -- Title of active window + , ppTitle = xmobarColor color16 "" . shorten 60 + -- Separator character + , ppSep = " | " + -- Urgent workspace + , ppUrgent = xmobarColor color02 "" . wrap "!" "!" + -- Adding # of windows on current workspace to the bar + , ppExtras = [windowCount] + -- order of things in xmobar + , ppOrder = \(ws:l:t:ex) -> [ws,l]++ex++[t] + } + } -- `additionalKeysP` myKeys