xmonad-config/xmonad.hs

564 lines
18 KiB
Haskell
Raw Normal View History

2020-03-13 20:50:13 -04:00
{-# LANGUAGE MultiWayIf #-}
{-# LANGUAGE LambdaCase #-}
2019-10-27 23:41:53 -04:00
module Main (main) where
2020-03-13 20:50:13 -04:00
import ACPI
import SendXMsg
import Control.Monad (forM_, void, when)
2020-03-06 09:25:06 -05:00
import System.Exit
2020-02-07 22:28:50 -05:00
import System.IO
2020-03-06 09:25:06 -05:00
import Data.List (sortBy, sortOn)
2020-02-16 01:01:24 -05:00
import Data.Maybe (fromMaybe, isJust)
import Data.Monoid (All(..))
import Graphics.X11.Xlib.Atom
import Graphics.X11.Xlib.Extras
import Graphics.X11.Types
2020-03-13 20:50:13 -04:00
import Text.Read (readMaybe)
2019-10-27 23:41:53 -04:00
import XMonad
2020-02-07 22:28:50 -05:00
import XMonad.Actions.CopyWindow
import XMonad.Actions.CycleWS
import XMonad.Actions.DynamicWorkspaces
import XMonad.Actions.PhysicalScreens
import XMonad.Actions.Volume
2020-02-07 22:28:50 -05:00
-- import XMonad.Config.Desktop
2020-02-13 19:57:19 -05:00
import XMonad.Hooks.DynamicLog
2020-02-07 22:28:50 -05:00
import XMonad.Hooks.EwmhDesktops
2020-02-08 16:01:15 -05:00
import XMonad.Hooks.ManageDocks
2020-02-07 22:28:50 -05:00
-- import XMonad.Layout.IndependentScreens
2020-02-12 22:40:21 -05:00
import XMonad.Hooks.ManageHelpers
2020-02-07 22:28:50 -05:00
-- import XMonad.Layout.BinarySpacePartition (emptyBSP)
2020-02-27 16:04:10 -05:00
-- import XMonad.Layout.DragPane
-- import XMonad.Layout.IM
-- import XMonad.Layout.LayoutCombinators hiding ((|||))
2020-02-20 00:04:44 -05:00
import XMonad.Layout.Named
import XMonad.Layout.NoBorders
2020-02-20 00:04:44 -05:00
import XMonad.Layout.NoFrillsDecoration
import XMonad.Layout.PerWorkspace
2020-02-27 16:04:10 -05:00
-- import XMonad.Layout.ResizableTile
import XMonad.Layout.Tabbed
2020-02-07 22:28:50 -05:00
-- import XMonad.Layout.ToggleLayouts (ToggleLayout(..), toggleLayouts)
import XMonad.Prompt
import XMonad.Prompt.ConfirmPrompt
2020-02-19 10:17:44 -05:00
-- import XMonad.Prompt.XMonad
2020-02-07 22:28:50 -05:00
-- import XMonad.Prompt.Shell
2019-10-27 23:41:53 -04:00
import XMonad.Util.EZConfig
2020-02-07 22:28:50 -05:00
import XMonad.Util.NamedActions
import XMonad.Util.Run
2020-02-27 23:37:19 -05:00
-- import XMonad.Util.WindowProperties
2020-02-07 22:28:50 -05:00
import qualified XMonad.StackSet as W
2019-10-27 23:41:53 -04:00
main = do
2020-02-13 19:57:19 -05:00
h <- spawnPipe "xmobar"
2020-03-13 20:50:40 -04:00
spawn "powermon"
2020-02-07 22:28:50 -05:00
xmonad
$ ewmh
$ addDescrKeys' ((myModMask, xK_F1), showKeybindings) myKeys
$ def { terminal = myTerm
, modMask = myModMask
, layoutHook = myLayouts
2020-02-12 22:40:21 -05:00
, manageHook = myManageHook <+> manageDocks <+> manageHook def
, handleEventHook = myEventHook <+> docksEventHook <+> handleEventHook def
2020-02-08 16:01:15 -05:00
, startupHook = docksStartupHook <+> startupHook def
2020-02-12 22:40:21 -05:00
, workspaces = myWorkspaces
, logHook = myLoghook h
2020-02-24 14:56:37 -05:00
, clickJustFocuses = False
, focusFollowsMouse = False
2020-02-07 22:28:50 -05:00
}
2019-10-27 23:41:53 -04:00
2020-02-20 00:04:44 -05:00
myTopBarTheme = def
{ fontName = myFont
, inactiveBorderColor = "#999999"
, inactiveColor = "#999999"
, inactiveTextColor = "#999999"
, activeBorderColor = "#d6d6d6"
, activeColor = "#d6d6d6"
, activeTextColor = "#d6d6d6"
2020-02-20 00:04:44 -05:00
-- , urgentBorderColor = red
-- , urgentTextColor = yellow
, decoHeight = 20
}
2020-02-27 16:04:10 -05:00
myTabbedTheme = def
{ fontName = myFont
, activeColor = "#d6d6d6"
, activeTextColor = "black"
, activeBorderColor = "#d6d6d6"
, inactiveColor = "#999999"
, inactiveTextColor = "#333333"
, inactiveBorderColor = "#999999"
}
myWorkspaces = map show [1..10 :: Int]
2020-02-12 22:40:21 -05:00
myVMWorkspace = "VM"
2020-02-27 16:04:10 -05:00
myGimpWorkspace = "GIMP"
myLayouts = onWorkspace myVMWorkspace (noBorders Full)
2020-02-27 16:04:10 -05:00
-- $ onWorkspace myGimpWorkspace gimpLayout
$ tall ||| single ||| full
2020-02-20 00:04:44 -05:00
where
addTopBar = noFrillsDeco shrinkText myTopBarTheme
tall = named "Tall"
$ avoidStruts
$ addTopBar
$ noBorders
$ Tall 1 0.03 0.5
2020-02-27 16:04:10 -05:00
single = named "Tabbed"
-- $ addTopBar
2020-02-20 00:04:44 -05:00
$ avoidStruts
$ noBorders
2020-02-27 23:37:07 -05:00
$ tabbedAlways shrinkText myTabbedTheme
full = named "Full"
2020-03-06 09:25:06 -05:00
$ noBorders Full
2020-02-27 16:04:10 -05:00
-- gimpLayout = named "Gimp Layout"
-- $ avoidStruts
-- $ (tabbedAlways shrinkText defaultTheme) ****||* Full
-- -- $ withIM (11/64) (Or (Title "Toolbox") (Title "Tool Options"))
-- -- $ (tabbedAlways shrinkText defaultTheme)
2019-10-27 23:41:53 -04:00
-- | Format workspace and layout in loghook
-- The format will be like "[<1> 2 3] 4 5 | LAYOUT" where each digit
-- is the workspace and LAYOUT is the current layout. Each workspace
-- in the brackets is currently visible and the order reflects the
-- physical location of each screen. The "<>" is the workspace
-- that currently has focus
myLoghook h = withWindowSet $ io . hPutStrLn h . myWindowSetXinerama
2020-02-16 01:01:36 -05:00
myWindowSetXinerama ws = wsString ++ sep ++ layout
where
2020-02-16 01:05:54 -05:00
wsString = xmobarColor "#444444" "" $ onscreen ++ offscreen'
offscreen' = if offscreen == "" then "" else " " ++ offscreen
2020-02-16 01:01:36 -05:00
sep = xmobarColor "#888888" "" " : "
onscreen = xmobarColor "#5574ad" visColor
$ wrap " " " "
$ unwords
$ map (fmtTags . W.tag . W.workspace)
. sortBy compareXCoord
$ W.current ws : W.visible ws
fmtTags t = if t == W.currentTag ws
then xmobarColor "#2c2c2c" visColor t
else t
offscreen = unwords
$ map W.tag
. filter (isJust . W.stack)
2020-03-06 09:25:06 -05:00
. sortOn W.tag
2020-02-16 01:01:36 -05:00
$ W.hidden ws
visColor = "#8fc7ff"
layout = description . W.layout . W.workspace . W.current $ ws
compareXCoord s0 s1 = compare x0 x1
where
2020-03-06 09:25:06 -05:00
(_, Rectangle x0 _ _ _) = getScreenIdAndRectangle s0
(_, Rectangle x1 _ _ _) = getScreenIdAndRectangle s1
2020-02-12 22:40:21 -05:00
myManageHook = composeOne
-- assume virtualbox is not run with the toolbar in fullscreen mode
-- as this makes a new window that confusingly must go over the
-- actual VM window
[ className =? "VirtualBoxVM" -?> doShift "VM"
2020-02-19 10:17:44 -05:00
-- the seafile applet
2020-02-14 17:00:18 -05:00
, className =? "Seafile Client" -?> doFloat
2020-03-04 20:57:20 -05:00
-- gnucash
, (className =? "Gnucash" <&&> title =? "Transaction Import Assistant") -?> doFloat
-- xsane
, className =? "Xsane" -?> doFloat
2020-02-19 10:17:44 -05:00
-- all of GIMP
2020-02-27 23:37:19 -05:00
, className =? "Gimp" -?> doFloat
-- , title =? "GIMP Startup" -?> doIgnore
2020-02-19 10:17:44 -05:00
-- plots and graphics created by R
2020-02-14 17:00:18 -05:00
, className =? "R_x11" -?> doFloat
2020-02-12 22:40:21 -05:00
, className =? "mpv" -?> doFloat
2020-02-19 10:17:44 -05:00
-- the floating windows created by the brave browser
, stringProperty "WM_NAME" =? "Brave" -?> doFloat
2020-02-23 19:22:32 -05:00
, (stringProperty "WM_WINDOW_ROLE" =? "pop-up"
<&&> className =? "Brave-browser") -?> doFloat
2020-02-19 10:17:44 -05:00
-- the dialog windows created by the zotero addon in Google Docs
2020-02-18 18:13:29 -05:00
, (className =? "Zotero" <&&> resource =? "Toplevel") -?> doFloat
2020-02-12 22:40:21 -05:00
, isDialog -?> doCenterFloat
]
2020-02-07 22:28:50 -05:00
-- This is a giant hack to "listen" for applications that close. Some
-- apps like Virtualbox go on their own workspace which is dynamically
-- created. But I want said workspace to disappear when the app
-- closes. This is actually hard. We can't just listen to
-- DestroyWindow events as VBox will "destroy" windows when it
-- switches to fullscreen and back. We also can't just monitor the
-- process from the window since WindowDestroy events don't have PIDs
-- attached to them. Therefore, the hack to make this all work is to
-- make a script fire when VirtualBox (and other apps that I want to
-- control in this manner) close. This script fires a bogus
-- ClientMessage event to the root window. This event will have a
-- BITMAP atom (which should do nothing) and a "magic string" in the
-- data field that can be intercepted here. When this event is
-- registered here, close the dynamic workspaces that are empty.
2020-03-06 09:25:06 -05:00
myEventHook ClientMessageEvent { ev_message_type = t, ev_data = d }
| t == bITMAP = do
2020-03-13 20:50:13 -04:00
let (magic, tag) = splitXMsg d
2020-03-14 14:54:23 -04:00
if | magic == magicStringWS -> removeEmptyWorkspaceByTag' tag
2020-03-13 20:50:13 -04:00
| magic == acpiMagic -> do
let acpiTag = readMaybe tag :: Maybe ACPIEvent
forM_ acpiTag $ \case
Power -> myPowerPrompt
Sleep -> confirmPrompt myPromptTheme "suspend?" runSuspend
LidClose -> do
status <- io isDischarging
forM_ status $ \s -> runScreenLock >> when s runSuspend
| otherwise -> return ()
return (All True)
| otherwise = return (All True)
2020-03-06 09:25:06 -05:00
myEventHook _ = return (All True)
removeEmptyWorkspaceByTag' tag = do
-- TODO this function works by first hiding the workspace to be
-- removed and then removing it. This won't work if there are no
-- other hidden workspaces to take it's place. So, need to scan
-- through the list of workspaces and swap the first one that is
-- empty with the workspace to be removed. If it actually is empty,
-- this will be enough to make it disappear.
removeEmptyWorkspaceByTag tag
-- themes
myFont = "xft:DejaVu Sans:size=11:autohint=false"
-- base00 = "#657b83"
-- base01 = "#586e75"
-- base02 = "#073642"
2020-02-16 01:43:27 -05:00
-- base03 = "#002b36"
-- base0 = "#839496"
-- base1 = "#93a1a1"
-- base2 = "#eee8d5"
2020-02-16 01:43:27 -05:00
-- base3 = "#fdf6e3"
-- yellow = "#b58900"
-- orange = "#cb4b16"
2020-02-16 01:43:27 -05:00
-- red = "#dc322f"
-- magenta = "#d33682"
-- violet = "#6c71c4"
2020-02-16 01:43:27 -05:00
-- blue = "#268bd2"
-- cyan = "#2aa198"
-- green = "#859900"
-- gap = 10
-- topbar = 10
-- border = 0
2020-02-16 01:43:27 -05:00
-- prompt = 20
-- status = 20
2020-02-16 01:43:27 -05:00
-- active = blue
-- activeWarn = red
-- inactive = base02
-- focusColor = blue
-- unfocusColor = base02
myPromptTheme = def
{ font = myFont
2020-02-16 01:43:27 -05:00
, bgColor = "#eeeeee"
, fgColor = "#282828"
, fgHLight = "white"
, bgHLight = "#268bd2"
, borderColor = "white"
, promptBorderWidth = 0
2020-02-16 01:43:27 -05:00
, height = 30
, position = CenteredAt 0.5 0.5
}
2020-02-16 01:43:27 -05:00
-- hotPromptTheme = myPromptTheme
-- { bgColor = red
-- , fgColor = base3
-- , position = Top
-- }
2020-02-16 01:01:24 -05:00
-- TODO is there a better way to get the prompt to say what I want?
data PowerPrompt = PowerPrompt
instance XPrompt PowerPrompt where
showXPrompt PowerPrompt = "Select Option: "
2020-03-14 14:54:23 -04:00
runScreenLock :: X ()
runScreenLock = spawn "screenlock"
runPowerOff :: X ()
2020-03-13 20:50:13 -04:00
runPowerOff = spawn "systemctl poweroff"
2020-03-14 14:54:23 -04:00
runSuspend :: X ()
2020-03-13 20:50:13 -04:00
runSuspend = spawn "systemctl suspend"
2020-03-14 14:54:23 -04:00
runHibernate :: X ()
2020-03-13 20:50:13 -04:00
runHibernate = spawn "systemctl hibernate"
2020-03-14 14:54:23 -04:00
runReboot :: X ()
2020-03-13 20:50:13 -04:00
runReboot = spawn "systemctl reboot"
2020-03-14 14:54:23 -04:00
myPowerPrompt :: X ()
2020-02-16 01:01:24 -05:00
myPowerPrompt = mkXPrompt PowerPrompt conf comps
$ fromMaybe (return ())
. (`lookup` commands)
where
2020-03-06 09:25:06 -05:00
comps = mkComplFunFromList' (map fst commands)
2020-02-16 01:43:27 -05:00
conf = myPromptTheme
2020-02-16 01:01:24 -05:00
commands =
2020-03-13 20:50:13 -04:00
[ ("poweroff", runPowerOff)
, ("suspend", runScreenLock >> runSuspend)
, ("hibernate", runScreenLock >> runHibernate)
, ("reboot", runReboot)
]
2020-02-16 01:01:24 -05:00
2020-03-14 14:54:23 -04:00
myQuitPrompt :: X ()
myQuitPrompt = confirmPrompt myPromptTheme "quit?" $ io exitSuccess
2020-03-14 14:54:23 -04:00
-- shell commands
2020-03-14 14:54:23 -04:00
formatCmd :: String -> [String] -> String
formatCmd cmd args = unwords $ cmd : args
2020-03-14 14:54:23 -04:00
spawnCmd :: String -> [String] -> X ()
spawnCmd cmd args = spawn $ formatCmd cmd args
2020-02-07 22:28:50 -05:00
2020-03-14 14:54:23 -04:00
(#!&&) :: String -> String -> String
cmdA #!&& cmdB = cmdA ++ " && " ++ cmdB
2020-02-07 22:28:50 -05:00
2020-03-14 14:54:23 -04:00
infixr 0 #!&&
magicStringWS :: String
magicStringWS = "%%%%%"
spawnCmdOwnWS :: String -> [String] -> String -> X ()
spawnCmdOwnWS cmd args ws = spawn
$ formatCmd cmd args
#!&& formatCmd "xit-event" [magicStringWS, ws]
spawnKill :: [String] -> X ()
spawnKill cmds = spawn $ formatCmd "killall" cmds
myTerm :: String
2020-02-07 22:28:50 -05:00
myTerm = "urxvt"
2020-03-14 14:54:23 -04:00
runTerm :: X ()
runTerm = spawn myTerm
runCalc :: X ()
runCalc = spawnCmd myTerm ["-e", "R"]
myDmenuCmd :: String
myDmenuCmd = "rofi"
-- TODO this almost works except when a workspace with no windows is
-- focuses. In this case, rofi considers the root window to be focused
-- and will showup wherever the mouse pointer is. Need a way to get
-- the focused workspace and translate that to a monitor number for
-- rofi to consume
myDmenuArgs :: [String]
myDmenuArgs = ["-m", "-4"] -- show rofi with the focused window
spawnDmenuCmd :: [String] -> X ()
spawnDmenuCmd args = spawnCmd myDmenuCmd $ myDmenuArgs ++ args
runCmdMenu :: X ()
runCmdMenu = spawnDmenuCmd ["-show", "run"]
runAppMenu :: X ()
runAppMenu = spawnDmenuCmd ["-show", "drun"]
runClipMenu :: X ()
runClipMenu = spawnDmenuCmd
[ "-modi", "\"clipboard:greenclip print\""
, "-show", "clipboard"
, "-run-command", "'{cmd}'"
, "-theme-str", "'#element.selected.normal { background-color: #00c44e; }'"
]
runWinMenu :: X ()
runWinMenu = spawnDmenuCmd ["-show", "window"]
runNetMenu :: X ()
runNetMenu = spawnCmd "networkmanager_dmenu" myDmenuArgs
runDevMenu :: X ()
runDevMenu = spawn "rofi-devices"
runBrowser :: X ()
runBrowser = spawn "brave"
runEditor :: X ()
runEditor = spawnCmd "emacsclient"
["-c", "-e", "(select-frame-set-input-focus (selected-frame))\""]
runFileManager :: X ()
runFileManager = spawn "pcmanfm"
-- TODO this will steal focus from the current window (and puts it
-- in the root window?) ...need to fix
2020-03-14 14:54:23 -04:00
runScreenCap :: X ()
runScreenCap = spawn "flameshot gui"
-- myWindowCap = "screencap -w" --external script
2020-02-07 22:28:50 -05:00
2020-03-14 14:54:23 -04:00
runVBox :: X ()
runVBox = spawnCmdOwnWS "vbox-start win8raw" [] myVMWorkspace
runGimp :: X ()
runGimp = spawnCmdOwnWS "gimp" [] myGimpWorkspace
runCleanup :: X ()
runCleanup = spawnKill ["xmobar", "powermon"]
runRestart :: X ()
runRestart = spawnCmd "xmonad" ["--restart"]
runRecompile :: X ()
runRecompile = spawnCmd "xmonad" ["--recompile"]
myMultimediaCtl :: String
myMultimediaCtl = "playerctl"
runTogglePlay :: X ()
runTogglePlay = spawnCmd myMultimediaCtl ["play-pause"]
runPrevTrack :: X ()
runPrevTrack = spawnCmd myMultimediaCtl ["previous"]
runNextTrack :: X ()
runNextTrack = spawnCmd myMultimediaCtl ["next"]
2020-03-14 14:54:23 -04:00
runStopPlay :: X ()
runStopPlay = spawnCmd myMultimediaCtl ["stop"]
2020-03-14 14:54:23 -04:00
runVolumeDown :: X ()
runVolumeDown = void (lowerVolume 2)
2020-03-14 14:54:23 -04:00
runVolumeUp :: X ()
runVolumeUp = void (lowerVolume 2)
runVolumeMute :: X ()
runVolumeMute = void toggleMute
runToggleBluetooth :: X ()
runToggleBluetooth = spawn "togglebt"
runIncBacklight :: X ()
runIncBacklight = spawnCmd "adj_backlight" ["up"]
runDecBacklight :: X ()
runDecBacklight = spawnCmd "adj_backlight" ["down"]
runMinBacklight :: X ()
runMinBacklight = spawnCmd "adj_backlight" ["min"]
runMaxBacklight :: X ()
runMaxBacklight = spawnCmd "adj_backlight" ["max"]
showWorkspace tag = windows $ W.view tag
-- keybindings
2020-02-14 23:00:45 -05:00
2020-02-07 22:28:50 -05:00
showKeybindings :: [((KeyMask, KeySym), NamedAction)] -> NamedAction
showKeybindings x = addName "Show Keybindings" $ io $ do
h <- spawnPipe "zenity --text-info --font=DejaVu Sans"
hPutStr h (unlines $ showKm x)
hClose h
return ()
2020-03-14 14:54:23 -04:00
myModMask :: KeyMask
myModMask = mod4Mask
mkNamedSubmap
:: XConfig l
-> String
-> [(String, NamedAction)]
-> [((KeyMask, KeySym), NamedAction)]
2020-02-07 22:28:50 -05:00
mkNamedSubmap c sectionName bindings =
(subtitle sectionName:) $ mkNamedKeymap c bindings
-- NOTE: the following bindings are used by dunst:
-- "M-~", "M-<esc>", "M-S-<esc>", "M-S-."
2020-03-14 14:54:23 -04:00
myKeys :: XConfig Layout -> [((KeyMask, KeySym), NamedAction)]
2020-02-07 22:28:50 -05:00
myKeys c =
2020-02-19 10:17:44 -05:00
mkNamedSubmap c "Window Layouts"
2020-02-07 22:28:50 -05:00
[ ("M-j", addName "focus down" $ windows W.focusDown)
, ("M-k", addName "focus up" $ windows W.focusUp)
, ("M-m", addName "focus master" $ windows W.focusMaster)
2020-02-19 10:17:44 -05:00
, ("M-S-j", addName "swap down" $ windows W.swapDown)
2020-02-07 22:28:50 -05:00
, ("M-S-k", addName "swap up" $ windows W.swapUp)
2020-02-19 10:17:44 -05:00
, ("M-S-m", addName "swap master" $ windows W.swapMaster)
2020-03-14 14:54:23 -04:00
-- TODO this will decrement past 0?
2020-02-19 10:17:44 -05:00
, ("M-C-j", addName "remove master window" $ sendMessage (IncMasterN (-1)))
, ("M-C-k", addName "add master window" $ sendMessage (IncMasterN 1))
, ("M-<Return>", addName "next layout" $ sendMessage NextLayout)
, ("M-S-<Return>", addName "reset layout" $ setLayout $ XMonad.layoutHook c)
2020-02-07 22:28:50 -05:00
, ("M-t", addName "sink tiling" $ withFocused $ windows . W.sink)
2020-02-19 10:17:44 -05:00
, ("M--", addName "shrink" $ sendMessage Shrink)
2020-02-07 22:28:50 -05:00
, ("M-=", addName "expand" $ sendMessage Expand)
] ++
mkNamedSubmap c "Workspaces"
2020-02-12 22:40:21 -05:00
-- NOTE this assumes that there are workspaces bound to numbers
([ (mods ++ show i, addName (msg ++ " " ++ show i) $ windows $ f w)
2020-02-07 22:28:50 -05:00
| (w, i) <- zip (XMonad.workspaces c) [1..] :: [(String, Int)]
, (mods, msg, f) <-
[ ("M-", "switch to workspace", W.view)
, ("M-S-", "move client to workspace", W.shift)]
] ++
2020-03-14 14:54:23 -04:00
[ ("M-v", addName "switch to VM workspace" $ showWorkspace myVMWorkspace)
, ("M-M1-g", addName "switch to Gimp workspace" $ showWorkspace myGimpWorkspace)
2020-02-12 22:40:21 -05:00
]) ++
2020-02-07 22:28:50 -05:00
mkNamedSubmap c "Screens"
[ ("M-l", addName "move up screen" nextScreen)
, ("M-h", addName "move down screen" prevScreen)
, ("M-C-l", addName "move client up screen" $ shiftNextScreen >> nextScreen)
, ("M-C-h", addName "move client down screen" $ shiftPrevScreen >> prevScreen)
, ("M-S-l", addName "shift up screen" $ swapNextScreen >> nextScreen)
, ("M-S-h", addName "shift down screen" $ swapPrevScreen >> prevScreen)
] ++
mkNamedSubmap c "Actions"
[ ("M-q", addName "close window" kill1)
2020-03-14 14:54:23 -04:00
, ("M-r", addName "run program" runCmdMenu)
, ("M-C-s", addName "capture screen area" runScreenCap)
-- , ("M-C-S-s", addName "capture focused window" $ spawn myWindowCap)
2020-03-14 14:54:23 -04:00
, ("M-<Delete>", addName "lock screen" runScreenLock)
2020-02-07 22:28:50 -05:00
] ++
mkNamedSubmap c "Launchers"
2020-03-14 14:54:23 -04:00
[ ("<XF86Search>", addName "select/launch app" runAppMenu)
, ("M-g", addName "launch clipboard manager" runClipMenu)
, ("M-a", addName "launch network selector" runNetMenu)
, ("M-w", addName "launch window selector" runWinMenu)
, ("M-u", addName "launch device selector" runDevMenu)
, ("M-C-e", addName "launch editor" runEditor)
, ("M-C-w", addName "launch browser" runBrowser)
, ("M-C-t", addName "launch terminal" runTerm)
, ("M-C-q", addName "launch calc" runCalc)
, ("M-C-f", addName "launch file manager" runFileManager)
, ("M-C-v", addName "launch windows VM" $ runVBox >> appendWorkspace myVMWorkspace)
, ("M-C-g", addName "launch GIMP" $ runGimp >> appendWorkspace myGimpWorkspace)
2020-02-07 22:28:50 -05:00
] ++
2020-02-09 12:40:57 -05:00
mkNamedSubmap c "Multimedia"
2020-03-14 14:54:23 -04:00
[ ("<XF86AudioPlay>", addName "toggle play/pause" runTogglePlay)
, ("<XF86AudioPrev>", addName "previous track" runPrevTrack)
, ("<XF86AudioNext>", addName "next track" runNextTrack)
, ("<XF86AudioStop>", addName "stop" runStopPlay)
, ("<XF86AudioLowerVolume>", addName "volume down" runVolumeDown)
, ("<XF86AudioRaiseVolume>", addName "volume up" runVolumeUp)
, ("<XF86AudioMute>", addName "volume mute" runVolumeMute)
, ("M-C-b", addName "toggle bluetooth" runToggleBluetooth)
2020-02-09 12:40:57 -05:00
] ++
2020-02-07 22:28:50 -05:00
mkNamedSubmap c "System"
2020-03-14 14:54:23 -04:00
[ ("M-.", addName "backlight up" runIncBacklight)
, ("M-,", addName "backlight down" runDecBacklight)
, ("M-M1-,", addName "backlight min" runMaxBacklight)
, ("M-M1-.", addName "backlight max" runMinBacklight)
, ("M-<F2>", addName "restart xmonad" $ runCleanup >> runRestart)
, ("M-S-<F2>", addName "recompile xmonad" $ runCleanup >> runRecompile)
2020-02-16 01:43:27 -05:00
, ("M-<End>", addName "power menu" myPowerPrompt)
2020-03-14 14:54:23 -04:00
, ("M-<Home>", addName "quit xmonad" myQuitPrompt)
2019-10-27 23:41:53 -04:00
]