about summary refs log tree commit diff
path: root/src/XMonad/Custom/Scratchpads.hs
blob: b5296cc2dcfcac04daf40aa6964aa07b4da95a5f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
-----------------------------------------------------------------------------
-- |
-- Module      :  XMonad.Custom.Scratchpads
-- Copyright   :  (c) azahi 2018
-- License     :  BSD3-style (see LICENSE)
--
-- Maintainer  :  azahi@teknik.io
-- Stability   :  unstable
-- Portability :  unportable
--
------------------------------------------------------------------------

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
    ]

Consider giving Nix/NixOS a try! <3