discord scratchpad

This commit is contained in:
Leon Kowarschick 2020-03-24 13:00:43 +01:00
parent 53e609c1c5
commit e19d170700
2 changed files with 13 additions and 11 deletions

View file

@ -57,9 +57,10 @@ scratchpads :: [NamedScratchpad]
scratchpads = scratchpads =
[ NS "terminal" launchTerminal (className =? "scratchpad_term") (customFloating $ W.RationalRect 0 0.7 1 0.3) [ NS "terminal" launchTerminal (className =? "scratchpad_term") (customFloating $ W.RationalRect 0 0.7 1 0.3)
, NS "ghci" launchGHCI (className =? "scratchpad_ghci") (customFloating $ W.RationalRect 0 0.7 1 0.3) , NS "ghci" launchGHCI (className =? "scratchpad_ghci") (customFloating $ W.RationalRect 0 0.7 1 0.3)
, NS "spotify" "spotify" (appName =? "spotify") defaultFloating
, NS "discord" "discord" (appName =? "discord") defaultFloating
, NS "whatsapp" launchWhatsapp (("WhatsApp" `isSuffixOf`) <$> title) defaultFloating , NS "whatsapp" launchWhatsapp (("WhatsApp" `isSuffixOf`) <$> title) defaultFloating
, NS "slack" "slack" (("Slack | " `isPrefixOf`) <$> title) defaultFloating , NS "slack" "slack" (("Slack | " `isPrefixOf`) <$> title) defaultFloating
, NS "spotify" "spotify" (appName =? "spotify") defaultFloating
] ]
where where
launchTerminal = myTerminal ++ " --class scratchpad_term" launchTerminal = myTerminal ++ " --class scratchpad_term"
@ -172,16 +173,17 @@ myKeys = [ ("M-C-k", sendMessage MirrorExpand >> sendMessage ShrinkSlave
safeSpawn "polybar-msg" ["cmd", "toggle"] -- toggle polybar visibility safeSpawn "polybar-msg" ["cmd", "toggle"] -- toggle polybar visibility
scratchpadSubmap :: X () scratchpadSubmap :: X ()
scratchpadSubmap = describedSubmap scratchpadSubmap = describedSubmap "Scratchpads"
[ ((myModMask, xK_n), "<M-n> terminal", namedScratchpadAction scratchpads "terminal") [ ((myModMask, xK_n), "<M-n> terminal", namedScratchpadAction scratchpads "terminal")
, ((myModMask, xK_h), "<M-h> ghci", namedScratchpadAction scratchpads "ghci") , ((myModMask, xK_h), "<M-h> ghci", namedScratchpadAction scratchpads "ghci")
, ((myModMask, xK_w), "<M-w> whatsapp", namedScratchpadAction scratchpads "whatsapp") , ((myModMask, xK_w), "<M-w> whatsapp", namedScratchpadAction scratchpads "whatsapp")
, ((myModMask, xK_s), "<M-s> slack", namedScratchpadAction scratchpads "slack") , ((myModMask, xK_s), "<M-s> slack", namedScratchpadAction scratchpads "slack")
, ((myModMask, xK_m), "<M-m> spotify", namedScratchpadAction scratchpads "spotify") , ((myModMask, xK_m), "<M-m> spotify", namedScratchpadAction scratchpads "spotify")
, ((myModMask, xK_d), "<M-m> discord", namedScratchpadAction scratchpads "discord")
] ]
mediaSubmap :: X () mediaSubmap :: X ()
mediaSubmap = describedSubmap mediaSubmap = describedSubmap "Media"
[ ((myModMask, xK_m), "<M-m> play/pause", spawn "playerctl play-pause") [ ((myModMask, xK_m), "<M-m> play/pause", spawn "playerctl play-pause")
, ((myModMask, xK_l), "<M-l> next", spawn "playerctl next") , ((myModMask, xK_l), "<M-l> next", spawn "playerctl next")
, ((myModMask, xK_l), "<M-h> previous", spawn "playerctl previous") , ((myModMask, xK_l), "<M-h> previous", spawn "playerctl previous")
@ -195,12 +197,12 @@ myKeys = [ ("M-C-k", sendMessage MirrorExpand >> sendMessage ShrinkSlave
, ("screenshot", spawn $ scriptFile "screenshot.sh") , ("screenshot", spawn $ scriptFile "screenshot.sh")
] ]
describedSubmap :: [((KeyMask, KeySym), String, X ())] -> X () describedSubmap :: String -> [((KeyMask, KeySym), String, X ())] -> X ()
describedSubmap mappings = showDzen hintText mySubMap describedSubmap title mappings = showDzen hintText mySubMap
where where
mySubMap = submap $ M.fromList $ map (\(k, _, f) -> (k, f)) mappings mySubMap = submap $ M.fromList $ map (\(k, _, f) -> (k, f)) mappings
descriptions = map (\(_,x,_) -> x) mappings descriptions = map (\(_,x,_) -> x) mappings
hintText = "\n" ++ unlines descriptions hintText = unlines (title : descriptions)
showDzen message action = do showDzen message action = do
let lineCount = show $ length $ lines message let lineCount = show $ length $ lines message
font = "-*-iosevka-medium-r-s*--16-87-*-*-*-*-iso10???-1" font = "-*-iosevka-medium-r-s*--16-87-*-*-*-*-iso10???-1"

Binary file not shown.