From 729e030dd25da2e36fa5a1312b8ecb3415dc1675 Mon Sep 17 00:00:00 2001 From: Azat Bahawi Date: Tue, 23 Nov 2021 03:19:06 +0300 Subject: Huge update --- src/lib/XMonad/Custom/Scratchpads.hs | 50 ++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 src/lib/XMonad/Custom/Scratchpads.hs (limited to 'src/lib/XMonad/Custom/Scratchpads.hs') diff --git a/src/lib/XMonad/Custom/Scratchpads.hs b/src/lib/XMonad/Custom/Scratchpads.hs new file mode 100644 index 0000000..5570435 --- /dev/null +++ b/src/lib/XMonad/Custom/Scratchpads.hs @@ -0,0 +1,50 @@ +-- | +-- Module : XMonad.Custom.Scratchpads +-- Description : Scratchpads configuration +-- Copyright : (c) Azat Bahawi 2018-2021 +-- SPDX-License-Identifier : GPL-3.0-or-later +-- Maintainer : azahi@teknik.io +-- Stability : experimental +-- Portability : non-portable +-- + +module XMonad.Custom.Scratchpads + ( scratchpads + ) where + +import XMonad.Core +import XMonad.Custom.Misc as C +import XMonad.ManageHook +import qualified XMonad.StackSet as S +import XMonad.Util.NamedScratchpad + +spawnTerminalWith :: String -> String -> String +spawnTerminalWith t c = term applications ++ " -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/scripts/nsp-console.sh") + (title =? "NSPConsole") + floatingNSP + , NS "volume" + (spawnTerminalWith "NSPVolume" (C.mixer C.applications)) + (title =? "NSPVolume") + floatingNSP + , NS "music" + (spawnTerminalWith "NSPMusic" (C.player C.applications)) + (title =? "NSPMusic") + floatingNSP + , NS "top" + (spawnTerminalWith "NSPTop" (C.top C.applications)) + (title =? "NSPTop") + floatingNSP + ] -- cgit 1.4.1