aboutsummaryrefslogtreecommitdiff
path: root/.config/XMonad/lib/Hooks.hs
blob: 99bb5308f3e6ea78186b7b17f28703998e5be9a6 (plain)
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
53
54
55
56
57
module Hooks where

import XMonad

import XMonad.Layout.Spacing
import XMonad.Layout.WindowNavigation as WN
import XMonad.Layout.Maximize
import XMonad.Layout.NoBorders

import XMonad.Layout.BinarySpacePartition as BSP
import XMonad.Layout.Grid
import XMonad.Layout.Tabbed

import XMonad.Hooks.SetWMName
import XMonad.Hooks.ManageDocks
import XMonad.Hooks.ManageHelpers
import XMonad.Hooks.StatusBar.PP

import XMonad.Util.SpawnOnce
import XMonad.Util.Cursor
import XMonad.Util.NamedScratchpad

import Defaults
import Scratchpads

myLemonbarPP  = def {
  ppCurrent = wrap ("%{B" ++ wsVisibleOccupiedBG ++ "}%{F" ++ wsVisibleOccupiedFG ++ "}   ") "   %{B-}%{F-}"
  -- , ppVisibleNoWindows = wrap ("%{B" ++ wsVisibleBG ++ "}%{F" ++ wsVisibleFG ++ "}   ") "   %{B-}%{F-}"
  -- , ppVisibleNoWindows = wrap "" ""
  -- , ppVisible = wrap ("%{B" ++ wsVisibleBG ++ "}%{F" ++ wsVisibleFG ++ "}   ") "   %{B-}%{F-}"
  , ppHidden = wrap ("%{B" ++ wsOccupiedBG ++ "}%{F" ++ wsOccupiedFG ++ "}   ") "   %{B-}%{F-}"
  , ppHiddenNoWindows = wrap ("%{B" ++ wsEmptyBG ++ "}%{F" ++ wsEmptyFG ++ "}   ") "   %{B-}%{F-}"
  , ppTitle = wrap ("%{B" ++ titleBG ++ "}%{F" ++ titleFG ++ "}   ") "   %{B-}%{F-}"
  , ppWsSep = ""
  , ppSep =  ""
  , ppOrder  = \(ws:_:t:_) -> ["%{l}"++t++"","%{r}"++ws++""]
  }

myManageHook = namedScratchpadManageHook myScratchpads
  <+> manageDocks <+> composeAll [
    className =? "discord"     --> doShift ( myWorkspaces !! 9 )
    , isFullscreen -->  doFullFloat
  ]

myLayoutHook = avoidStruts $ maximize $ windowNavigation $ smartBorders $ myGap $
    emptyBSP ||| tabbed shrinkText myTabTheme ||| Grid

myStartupHook = do
  spawnOnce "xmodmap /home/zt/.Xmodmap"
  spawnOnce "picom"
  spawnOnce "dunst"
  spawnOnce "polystart"
  spawnOnce "nitrogen --restore"
  spawnOnce "cbatticon"
  setWMName "LG3D"
  setDefaultCursor xC_left_ptr