{-# LANGUAGE BlockArguments #-} import System.Environment import System.Process import Control.Monad (join) import Data.Function ((&)) import XMonad import XMonad.Actions.SpawnOn import XMonad.Config (defaultConfig) 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 -- startingConfig = if kdeOn then kdeConfig else defaultConfig main = xmonad $ ewmh $ docks $ defaultConfig { 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 let workspaceName = myWorkspaces !! (workspaceId - 1) 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 ] spawnTerminal = do spawn "fish -c 'alacritty --config-file ~/.config/alacritty/themes/$THEME.yml'" 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), ("M-s", spawnTerminal), ("M-d", spawn "Discord") ] 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 spawn "xwallpaper --zoom ./background.jpg" -- spawn "Discord" -- spawn "google-chrome-stable" -- spawn "alacritty"