From b975c0a90dce97c8d96ab464d69575a9d8c150b3 Mon Sep 17 00:00:00 2001 From: azahi Date: Tue, 12 Jun 2018 22:59:58 +0300 Subject: Add X.Custom and split existing code in modules --- src/XMonad/Custom/Scratchpads.hs | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 src/XMonad/Custom/Scratchpads.hs (limited to 'src/XMonad/Custom/Scratchpads.hs') diff --git a/src/XMonad/Custom/Scratchpads.hs b/src/XMonad/Custom/Scratchpads.hs new file mode 100644 index 0000000..9d82ed5 --- /dev/null +++ b/src/XMonad/Custom/Scratchpads.hs @@ -0,0 +1,40 @@ +module XMonad.Custom.Scratchpads + ( scratchpads + ) where + +import XMonad.Core +import qualified XMonad.Custom.Misc as CM +import XMonad.ManageHook +import qualified XMonad.StackSet as S +import XMonad.Util.NamedScratchpad + +spawnTerminalWith :: String -> String -> String +spawnTerminalWith t c = CM.term CM.customApplications ++ " -title " ++ t ++ " -e " ++ c + +floatingNSP :: ManageHook +floatingNSP = customFloating $ S.RationalRect x y w h + where + x = (1 - w) / 2 + y = (1 - h) / 2 + w = 1 / 2 + h = 1 / 2.5 + +scratchpads :: [NamedScratchpad] +scratchpads = + [ NS "console" + (spawnTerminalWith "NSPConsole" "~/.xmonad/bin/nsp-console.sh") + (title =? "NSPConsole") + floatingNSP + , NS "volume" + (spawnTerminalWith "NSPVolume" (CM.mixer CM.customApplications)) + (title =? "NSPVolume") + floatingNSP + , NS "music" + (spawnTerminalWith "NSPMusic" "~/.bin/mp") + (title =? "NSPMusic") + floatingNSP + , NS "top" + (spawnTerminalWith "NSPTop" (CM.top CM.customApplications)) + (title =? "NSPTop") + floatingNSP + ] -- cgit 1.4.1