``` -- IMPORTS import XMonad hiding ( (|||) ) -- jump to layout import XMonad.Prompt import XMonad.Prompt.Shell import XMonad.Layout.LayoutCombinators (JumpToLayout(..), (|||)) -- jump to layout import XMonad.Config.Desktop import XMonad.Util.SpawnOnce import XMonad.Util.Run import XMonad.Util.EZConfig (additionalKeysP) import XMonad.Util.NamedWindows import XMonad.Hooks.ManageDocks import XMonad.Hooks.EwmhDesktops import XMonad.Hooks.ManageHelpers import XMonad.Hooks.DynamicLog import XMonad.Hooks.UrgencyHook import qualified XMonad.StackSet as W import qualified Data.Map as M -- actions import XMonad.Actions.CopyWindow -- for dwm window style tagging import XMonad.Actions.SpawnOn import XMonad.Actions.UpdateFocus -- layout import XMonad.Layout.Renamed (renamed, Rename(Replace)) import XMonad.Layout.NoBorders import XMonad.Layout.Spacing import XMonad.Layout.Grid import XMonad.Layout.GridVariants -- import XMonad.Layout.ResizableTile -- import XMonad.Layout.BinarySpacePartition -- The preferred terminal program, which is used in a binding below and by -- certain contrib modules. -- myTerminal :: String myScratchterm :: String myTerminal = "st" myScratchterm = "st" -- Whether focus follows the mouse pointer. myFocusFollowsMouse :: Bool myFocusFollowsMouse = False -- Whether clicking on a window to focus also passes the click to the window -- myClickJustFocuses :: Bool -- myClickJustFocuses = true -- Width of the window border in pixels. -- myBorderWidth = 2 -- modMask lets you specify which modkey you want to use. The default -- is mod1Mask ("left alt"). You may also consider using mod3Mask -- ("right alt"), which does not conflict with emacs keybindings. The -- "windows key" is usually mod4Mask. -- myModMask :: KeyMask myModMask = mod4Mask -- The default number of workspaces (virtual screens) and their names. -- By default we use numeric strings, but any string may be used as a -- workspace name. The number of workspaces is determined by the length -- of this list. -- -- A tagging example: -- -- > workspaces = ["web", "irc", "code" ] ++ map show [4..9] -- xmobarEscape :: [Char] -> [Char] xmobarEscape = concatMap doubleLts where doubleLts '<' = "<<" doubleLts x = [x] myWorkspaces :: [String] myWorkspaces = clickable . map xmobarEscape $ ["1:Main", "2:LS", "3:BS", "4:RS", "5:Gaming", "6:Misc", "7:Misc+", "8:Hidden", "9:Panic"] where -- Make workspaces clickable. Needs xdotool. clickable l = [ "" ++ ws ++ "" | (i,ws) <- zip [1..9] l, let n = i ] -- -- Border colors for unfocused and focused windows, respectively. -- myNormalBorderColor :: String myFocusedBorderColor :: String myppCurrent :: String myppVisible :: String myppHidden :: String myppHiddenNoWindows :: String myppTitle :: String myppUrgent :: String myNormalBorderColor = "#181817" myFocusedBorderColor = "#00FF00" myppCurrent = "#cb4b16" myppVisible = "#cb4b16" myppHidden = "#268bd2" myppHiddenNoWindows = "#93A1A1" myppTitle = "#FDF6E3" myppUrgent = "#DC322F" -- Desktop notifications data LibNotifyUrgencyHook = LibNotifyUrgencyHook deriving (Read, Show) instance UrgencyHook LibNotifyUrgencyHook where urgencyHook LibNotifyUrgencyHook w = do name <- getName w Just idx <- W.findTag w <$> gets windowset safeSpawn "notify-send" [show name, "workspace " ++ idx] -- -- Key bindings. Add, modify or remove key bindings here. -- myKeys :: [([Char], X ())] myKeys = [("M-" ++ m ++ k, windows $ f i) | (i, k) <- zip myWorkspaces (map show [1 :: Int ..]) , (f, m) <- [(W.greedyView, ""), (W.shift, "S-"), (copy, "S-C-")]] ++ [ ("M-", spawn myTerminal) -- open terminal , ("C-A-t", spawn myTerminal) , ("M-x", kill1) -- close current program , ("M-e", spawn "thunar") -- file manager , ("M-f", sendMessage $ JumpToLayout "Full") -- fullscreen mode , ("M-g", sendMessage $ JumpToLayout "GridRation (4/3)") -- normal "grid" mode , ("M-w", spawn "rofi -show run") -- rofi launch menu ] -- -- Autostart - Programs that are started automatically -- myStartupHook :: X () myStartupHook = do spawn "sh ~/.screenlayout/screen.sh &" spawnOnce "ckb-next --background" spawnOnce "stalonetray &" spawnOnce "nm-applet" spawn "xmodmap -e 'keycode 169 = ccedilla Ccedilla' &" spawnOnce "dunst &" spawnOnce "element-desktop &" spawnOnce "xset s off &" spawnOnce "xset -dpms &" spawnOnce "/home/byjumperx4/.local/bin/pentablet &" spawn "nitrogen --restore &" spawnOnce "python3 /opt/youtube-local/server.py" -- spawnOnce "xmobar" spawnOnce "xcompmgr -scC" -- -- Default layout for windows -- myLayoutHook = avoidStruts $ (spaced ||| Full) where spaced = spacingRaw False (Border 3 0 3 0) True (Border 0 3 0 3) True $ GridRatio (4/3) myTheme = "#252524" ------------------------------------------------------------------------ -- Now run xmonad with all the defaults we set up. -- Run xmonad with the settings you specify. No need to modify this. -- main :: IO () main = do xmproc <- spawnPipe "xmobar ~/.xmobarrc" xmonad $ withUrgencyHook NoUrgencyHook $ def { manageHook = manageSpawn <+> manageDocks <+> manageHook desktopConfig , startupHook = myStartupHook , layoutHook = myLayoutHook , handleEventHook = handleEventHook desktopConfig <+> fullscreenEventHook , focusFollowsMouse = False , workspaces = myWorkspaces , borderWidth = myBorderWidth , terminal = myTerminal , modMask = myModMask , normalBorderColor = myNormalBorderColor , focusedBorderColor = myFocusedBorderColor , logHook = dynamicLogWithPP $ xmobarPP { ppOutput = hPutStrLn xmproc , ppTitle = xmobarColor myTheme "" . shorten 50 , ppCurrent = xmobarColor myTheme "" . wrap "{" "}" } } `additionalKeysP` myKeys ```