2022-01-17 18:22:09 +01:00
|
|
|
{-# LANGUAGE BlockArguments #-}
|
|
|
|
|
2022-03-10 23:49:44 +01:00
|
|
|
import System.Environment
|
|
|
|
import System.Process
|
|
|
|
|
2022-01-17 18:22:09 +01:00
|
|
|
import Control.Monad (join)
|
|
|
|
import Data.Function ((&))
|
2022-03-10 23:49:44 +01:00
|
|
|
|
2022-01-17 18:22:09 +01:00
|
|
|
import XMonad
|
|
|
|
import XMonad.Actions.SpawnOn
|
2022-01-17 18:34:44 +01:00
|
|
|
import XMonad.Config (defaultConfig)
|
2022-01-17 18:22:09 +01:00
|
|
|
import XMonad.Config.Kde
|
|
|
|
import XMonad.Hooks.EwmhDesktops (ewmh, fullscreenEventHook)
|
|
|
|
import XMonad.Hooks.ManageDocks
|
|
|
|
import XMonad.Layout.Spacing
|
|
|
|
import XMonad.Layout.ThreeColumns
|
|
|
|
import XMonad.Util.EZConfig
|
|
|
|
|
|
|
|
kdeOn :: Bool
|
|
|
|
kdeOn = False
|
|
|
|
|
2022-01-17 18:34:44 +01:00
|
|
|
-- startingConfig = if kdeOn then kdeConfig else defaultConfig
|
2022-01-17 18:22:09 +01:00
|
|
|
|
|
|
|
main =
|
|
|
|
xmonad $
|
|
|
|
ewmh $
|
|
|
|
docks $
|
2022-01-17 18:34:44 +01:00
|
|
|
defaultConfig
|
2022-01-17 18:22:09 +01:00
|
|
|
{ modMask = mod4Mask,
|
|
|
|
layoutHook = myLayoutHook,
|
|
|
|
startupHook = startup,
|
|
|
|
manageHook = manageDocks <+> myManagerHook <+> manageHook kdeConfig,
|
|
|
|
handleEventHook = handleEventHook kdeConfig <+> fullscreenEventHook,
|
|
|
|
terminal = myTerminal,
|
|
|
|
workspaces = myWorkspaces
|
|
|
|
}
|
|
|
|
`additionalKeysP` keymap
|
|
|
|
where
|
|
|
|
myWorkspaces =
|
|
|
|
["1:dev", "2:browser", "3:chat", "4:terminal", "5", "6", "7", "8", "9", "0"]
|
|
|
|
|
|
|
|
appWorkspaceConfig =
|
|
|
|
[ (3, "Discord"),
|
|
|
|
(4, "alacritty"),
|
|
|
|
(2, "google-chrome-stable")
|
|
|
|
]
|
|
|
|
|
|
|
|
manageWorkspaces =
|
|
|
|
appWorkspaceConfig
|
|
|
|
& fmap \(workspaceId, name) -> do
|
2022-01-17 18:34:44 +01:00
|
|
|
let workspaceName = myWorkspaces !! (workspaceId - 1)
|
2022-01-17 18:22:09 +01:00
|
|
|
className =? name --> doShift workspaceName
|
|
|
|
|
|
|
|
kdeFloats =
|
|
|
|
[ "yakuake",
|
|
|
|
"Yakuake",
|
|
|
|
"Kmix",
|
|
|
|
"kmix",
|
|
|
|
"plasma",
|
|
|
|
"Plasma",
|
|
|
|
"plasma-desktop",
|
|
|
|
"Plasma-desktop",
|
|
|
|
"krunner",
|
|
|
|
"ksplashsimple",
|
|
|
|
"ksplashqml",
|
|
|
|
"ksplashx"
|
|
|
|
]
|
|
|
|
|
|
|
|
floatKdeStuff = [className =? name --> doFloat | name <- kdeFloats]
|
|
|
|
|
|
|
|
myManagerHook =
|
|
|
|
composeAll $
|
|
|
|
concat
|
|
|
|
[ if kdeOn then floatKdeStuff else [],
|
|
|
|
manageWorkspaces
|
|
|
|
]
|
|
|
|
|
|
|
|
myTerminal = "alacritty"
|
|
|
|
myBrowser = "google-chrome-stable"
|
|
|
|
|
|
|
|
-- TODO: find a way to bind all the program-opening-keybindings to a single sub-map
|
|
|
|
keymap =
|
|
|
|
[ ("M-p", spawn "rofi -show run"),
|
|
|
|
("M-g", spawn myBrowser),
|
2022-03-10 23:49:44 +01:00
|
|
|
("M-d", spawn "Discord")
|
2022-01-17 18:22:09 +01:00
|
|
|
]
|
|
|
|
|
|
|
|
uniformBorder = join $ join $ join Border
|
|
|
|
border = uniformBorder 4
|
|
|
|
spacingHook = spacingRaw True border True border True
|
|
|
|
|
|
|
|
tall = Tall 1 (3 / 100) (1 / 2)
|
|
|
|
threeCols = ThreeCol 1 (3 / 100) (1 / 2)
|
|
|
|
|
|
|
|
layouts = tall ||| threeCols ||| Full
|
|
|
|
myLayoutHook = desktopLayoutModifiers $ spacingHook layouts
|
|
|
|
|
|
|
|
startup :: X ()
|
|
|
|
startup = do
|
2022-03-13 11:46:00 +01:00
|
|
|
-- The file is dynamically set in wallpaper.nix
|
|
|
|
spawn "xwallpaper --zoom ~/.config/wallpaper"
|
2022-03-10 23:49:44 +01:00
|
|
|
|