From b069c185c1e25213d77507c3897fcf9df9d8a25b Mon Sep 17 00:00:00 2001 From: afonsofrancof Date: Wed, 4 Oct 2023 01:05:31 +0100 Subject: [PATCH] [MAJOR] Cleanup xmonad config --- .config/xmonad/hie.yaml | 8 + .config/xmonad/lib/Colors/Teal.hi | Bin 2203 -> 2212 bytes .config/xmonad/lib/Colors/Teal.o | Bin 8368 -> 8368 bytes .config/xmonad/xmonad.hs | 73 +++------ .config/xmonad/xmonad.norg | 237 ------------------------------ 5 files changed, 32 insertions(+), 286 deletions(-) create mode 100644 .config/xmonad/hie.yaml delete mode 100644 .config/xmonad/xmonad.norg diff --git a/.config/xmonad/hie.yaml b/.config/xmonad/hie.yaml new file mode 100644 index 0000000..6c02501 --- /dev/null +++ b/.config/xmonad/hie.yaml @@ -0,0 +1,8 @@ +cradle: + stack: + - path: ./xmonad.hs + component: ./xmonad.hs + - path: ./xmonad-git/ + component: xmonad:lib + - path: ./xmonad-contrib-git/ + component: xmonad-contrib:lib diff --git a/.config/xmonad/lib/Colors/Teal.hi b/.config/xmonad/lib/Colors/Teal.hi index 5645fbb107f88af53c4ba0acf459f80f1f4b3098..fe0b1d147fd4edfec3819df46a18c3f0e31a21d4 100644 GIT binary patch delta 1018 zcmX|8ZBSHI7=F*$4=y0=Vg{mwwY!v2dt6pxqo$bvsWoY2WGC!LGhE@YY~8(gz4th? zJN^KxA1h^2hs?AYNsv|SM@@#4+Dsp$K~SrN)5lDO2^BgfjYEm!Oy|PTojLD3=Xsww z@AE$QU|wHdJDUHd#aihr55UCD=^uWa85qkQPW29abf&NK3IdRN0j!PU*a5_Ktbgy^ ztEIx>E0SLYB)&JOHNUHf%Z-u>C&_1B+Y+wK93Eg-&Zz*fLEuxEgj2~rkF z*&runa5%w|w;J$rz;^&%0r*b9`G5-muLN8OcoksLEdqQO;9|gQ0N)Mx9>6ZZ zZonQWxfe?AgSGcV=>t&uAb1IQ*MYALz>l8A0N6j7`laWCg9px@MdRILbEE0O4?V(@ zW&P~%(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XeJAj*GvTd3HAeD-G#$rpeAu9;c?6(RNM!gJN7j~dJ}8gdMyHw>42 zsfVavVl90`CaPhCc0ZWh_ac{k{yUoH!81SpAK8+t`+ZlQTeiI)g%$Md~U)20(4@tLI3~& diff --git a/.config/xmonad/xmonad.hs b/.config/xmonad/xmonad.hs index 299e38b..d5ece24 100644 --- a/.config/xmonad/xmonad.hs +++ b/.config/xmonad/xmonad.hs @@ -59,10 +59,10 @@ myClickJustFocuses = False windowCount :: X (Maybe String) windowCount = gets $ Just . show . length . W.integrate' . W.stack . W.workspace . W.current . windowset -myNormalBorderColor = "#008080" +myNormalBorderColor = "#534783" myFocusedBorderColor = "#01F9C6" -myBorderWidth = 2 +myBorderWidth = 1 myWorkspaces = ["main","web","text","code","social","monitoring"] myWorkspaceIndices = zip myWorkspaces [1..] @@ -112,18 +112,11 @@ myMouseBindings (XConfig {XMonad.modMask = modm}) = M.fromList $ , ((modm, button3), (\w -> focus w >> mouseResizeWindow w >> windows W.shiftMaster))] -myLayout = avoidStruts(tiled ||| Mirror tiled ||| Full) - where - tiled = Tall nmaster delta ratio - nmaster = 1 - ratio = 1/2 - delta = 3/100 - myManageHook = composeAll [ className =? "MPlayer" --> doFloat , className =? "Gimp" --> doFloat , resource =? "desktop_window" --> doIgnore - , className =? "QjackCtl" --> doFloat + , className =? "QjackCtl" --> doFloat , resource =? "kdesktop" --> doIgnore , className =? "firefox" --> doShift (myWorkspaces !! 1) , className =? "Code" --> doShift (myWorkspaces !! 3) @@ -146,65 +139,47 @@ myStartupHook = do spawnOnce "picom &" setWMName "LG3D" spawnOnce "nm-applet" - spawnOnce ("xsetroot -cursor_name left_ptr") - spawnOnce ("killall trayer ;sleep 1 && trayer --monitor 0 --edge top --align right --margin 4 --widthtype request --padding 8 --iconspacing 12 --SetDockType true --SetPartialStrut true --expand true --transparent true --alpha 0 --tint 0x2B2E37 --height 30 --distance 5 &") - spawnOnce ("slimbookbattery --minimize") - spawnOnce ("slimbookintelcontroller") - spawnOnce ("nextcloud") + spawnOnce "xsetroot -cursor_name left_ptr" + spawnOnce "killall trayer ;sleep 1 && trayer --monitor 0 --edge top --align right --margin 4 --widthtype request --padding 8 --iconspacing 12 --SetDockType true --SetPartialStrut true --expand true --transparent true --alpha 0 --tint 0x2B2E37 --height 30 --distance 5 &" + spawnOnce "slimbookbattery --minimize" + spawnOnce "slimbookintelcontroller" + spawnOnce "nextcloud" spawnOnOnce "web" myWebBrowser spawnOnOnce "main" myTerminalTmux -myStatusBarSpawner :: Applicative f => ScreenId -> f StatusBarConfig -myStatusBarSpawner (S s) = do - pure $ statusBarPropTo ("_XMONAD_LOG_" ++ show s) - ("xmobar -x " ++ show s ++ " ~/.config/xmobar/xmobarrc" ++ show s) - (pure $ myXmobarPP (S s)) +mySB = statusBarProp "/home/afonso/.local/bin/xmobar /home/afonso/.config/xmobar/xmobarrc" (pure myXmobarPP) - -myXmobarPP :: ScreenId -> PP -myXmobarPP s = def - { ppSep = "" - , ppWsSep = "" - , ppCurrent = xmobarColor cyan "" . const wsIconFull - , ppVisible = xmobarColor grey4 "" . const wsIconFull - , ppVisibleNoWindows = Just (xmobarColor grey4 "" . const wsIconFull) - , ppHidden = xmobarColor grey2 "" . const wsIconHidden - , ppHiddenNoWindows = xmobarColor grey2 "" . const wsIconEmpty - , ppUrgent = xmobarColor orange "" . const wsIconFull - , ppOrder = \(ws : _ : _ : extras) -> ws : extras - , ppExtras = [ wrapL " " " " $ layoutColorIsActive s (logLayoutOnScreen s) - ,titleColorIsActive s (shortenL 81 $ logTitleOnScreen s) - ] - } +myXmobarPP :: PP +myXmobarPP = def + { ppSep = "" + , ppWsSep = "" + , ppCurrent = xmobarColor cyan "" . const wsIconFull + , ppVisible = xmobarColor grey4 "" . const wsIconFull + , ppHidden = xmobarColor grey4 "" . const wsIconFull + , ppHiddenNoWindows = xmobarColor grey4 "" . const wsIconFull + , ppOrder = \(ws : _ : _ : extras) -> ws : extras + } where wsIconFull = " \xf111 " - wsIconHidden = " \xf111 " - wsIconEmpty = " \xf10c " - titleColorIsActive n l = do - c <- withWindowSet $ return . W.screen . W.current - if n == c then xmobarColorL cyan "" l else xmobarColorL grey3 "" l - layoutColorIsActive n l = do - c <- withWindowSet $ return . W.screen . W.current - if n == c then wrapL "" l else wrapL "" l myConfig = def { terminal = myTerminal, - focusFollowsMouse = myFocusFollowsMouse, - clickJustFocuses = myClickJustFocuses, + focusFollowsMouse = True, + clickJustFocuses = False, borderWidth = myBorderWidth, modMask = myModMask, workspaces = myWorkspaces, normalBorderColor = myNormalBorderColor, focusedBorderColor = myFocusedBorderColor, - layoutHook = smartBorders . spacingWithEdge 15 $ myLayout, + layoutHook = avoidStruts $ smartBorders . smartSpacingWithEdge 5 $ layoutHook def, manageHook = manageSpawn <+> myManageHook <+> manageHook def, - handleEventHook = myEventHook <+> fullscreenEventHook <+> swallowEventHook (className=?"Alacritty") (return True), + handleEventHook = myEventHook <+> fullscreenEventHook, startupHook = myStartupHook } main :: IO () -main = xmonad . ewmh . ewmhFullscreen . dynamicSBs myStatusBarSpawner . docks $ additionalKeysP (removeKeysP myConfig myRemoveKeys) myKeys \ No newline at end of file +main = xmonad . ewmh . ewmhFullscreen . withSB mySB . docks $ additionalKeysP (removeKeysP myConfig myRemoveKeys) myKeys diff --git a/.config/xmonad/xmonad.norg b/.config/xmonad/xmonad.norg deleted file mode 100644 index 7bb4474..0000000 --- a/.config/xmonad/xmonad.norg +++ /dev/null @@ -1,237 +0,0 @@ -@document.meta -title: Xmonad Config -authors: Afonso Franco -categories: configs -tangle: /home/afonso/.config/xmonad/xmonad.hs -@end - -* Overrides -@code haskell -{-# OPTIONS_GHC -Wno-deprecations #-} -@end -* Imports -@code haskell - -import XMonad - ---Utils -import XMonad.Util.EZConfig (additionalKeysP,removeKeysP) -import XMonad.Util.Loggers (logLayoutOnScreen, logTitleOnScreen, shortenL, wrapL, xmobarColorL) -import XMonad.Util.Run -import XMonad.Util.SpawnOnce - ---Hooks -import XMonad.Hooks.DynamicLog -import XMonad.Hooks.SetWMName -import XMonad.Hooks.StatusBar -import XMonad.Hooks.EwmhDesktops -import XMonad.Hooks.ManageDocks -import XMonad.Hooks.ManageHelpers -import XMonad.Hooks.WindowSwallowing - ---Actions -import XMonad.Actions.SpawnOn -import XMonad.Actions.UpdateFocus (focusUnderPointer) - ---Layouts -import XMonad.Layout.NoBorders -import XMonad.Layout.Spacing - - --- MultiMonitorFocusHook -import Control.Monad (when) -import Data.Foldable (find) -import Foreign.C (CInt) -import Data.Maybe (fromMaybe) -import Data.Monoid (All (All)) - ---Miscellaneous -import qualified XMonad.StackSet as W -import qualified Data.Map as M -import System.Exit - ---Color Scheme -import Colors.Teal - -@end -* Variables -@code haskell - -myTerminal = "kitty" -myTerminalTmux = myTerminal ++ " -e tmux a" -myTextEditor = "nvim" -myWebBrowser = "firefox" -myModMask = mod4Mask - -myFocusFollowsMouse :: Bool -myFocusFollowsMouse = True - -myClickJustFocuses :: Bool -myClickJustFocuses = False - -windowCount :: X (Maybe String) -windowCount = gets $ Just . show . length . W.integrate' . W.stack . W.workspace . W.current . windowset - -myNormalBorderColor = "#008080" -myFocusedBorderColor = "#01F9C6" - -myBorderWidth = 2 - -myWorkspaces = ["main","web","text","code","social","monitoring"] -myWorkspaceIndices = zip myWorkspaces [1..] - - @end - -* Keybinds -@code haskell -myKeys :: [(String, X ())] -myKeys = - [ ("M-x" ,spawn myTerminalTmux ) - , ("M-p", spawn "rofi -show drun -show-icons") - , ("M-S-p", spawn "rofi -show p -modi p:rofi-power-menu") - , ("M-s", spawn "selected=$(ls ~/scripts/|rofi -dmenu -p \"Run: \") && bash ~/.config/rofi/scripts/$selected") - , ("M-b", spawn myWebBrowser) - , ("", spawn "flameshot gui") - , ("", spawn "pamixer set --toggle-mute") - , ("", spawn "pamixer -d 5") - , ("", spawn "pamixer -i 5") - , ("", spawn "lux -a 10%") - , ("", spawn "lux -s 10%") - , ("M-n", spawn $ myTerminal ++ " -e nmtui") - , ("M-q", kill) - , ("M-S-", sendMessage NextLayout) - , ("M-", windows W.focusDown) - , ("M-", windows W.focusUp ) - , ("M-m", windows W.focusMaster ) - , ("M-", windows W.swapMaster) - , ("M-h", sendMessage Shrink) - , ("M-l", sendMessage Expand) - , ("M-t", withFocused $ windows . W.sink) - , ("M-S-u", io (exitWith ExitSuccess)) - , ("M-u", spawn "xmonad --recompile; xmonad --restart") - ] - ++ - [("M-" ++ m ++ (show k), windows $ f i) - | (i, k) <- myWorkspaceIndices - , (f, m) <- [(W.greedyView, "0"), (W.shift, "S-")]] - ++ - [("M-" ++ m ++ key, screenWorkspace sc >>= flip whenJust (windows . f)) - | (key, sc) <- zip ["w", "e", "r"] [0..] - , (f, m) <- [(W.view, "0"), (W.shift, "S-")]] - -myRemoveKeys = ["M-S-","M-S-p","M-S-c","M-","M-n","M-S-q"] - -myMouseBindings (XConfig {XMonad.modMask = modm}) = M.fromList $ - [ ((modm, button1), (\w -> focus w >> mouseMoveWindow w - >> windows W.shiftMaster)) - , ((modm, button2), (\w -> focus w >> windows W.shiftMaster)) - , ((modm, button3), (\w -> focus w >> mouseResizeWindow w - >> windows W.shiftMaster))] - @end -* Layouts -@code haskell -myLayout = avoidStruts(tiled ||| Mirror tiled ||| Full) - where - tiled = Tall nmaster delta ratio - nmaster = 1 - ratio = 1/2 - delta = 3/100 -@end -* Hooks -@code haskell -myManageHook = composeAll - [ className =? "MPlayer" --> doFloat - , className =? "Gimp" --> doFloat - , resource =? "desktop_window" --> doIgnore - , className =? "QjackCtl" --> doFloat - , resource =? "kdesktop" --> doIgnore - , className =? "firefox" --> doShift (myWorkspaces !! 1) - , className =? "Code" --> doShift (myWorkspaces !! 3) - , className =? "discord" --> doShift (myWorkspaces !! 4) - , title =? "JetBrains Toolbox" --> doShift (myWorkspaces !! 3) - , className =? "main" --> doFloat - , className =? "Mailspring" --> doShift (myWorkspaces !! 5) - , className =? "Xmessage" --> doFloat - , title =? "Steam - News" --> doFloat - , title =? "Friends List" --> doFloat - , isFullscreen --> doFullFloat] - - -myEventHook = ewmhDesktopsEventHook - -myStartupHook = do - spawnOnce "pasystray" - spawnOnce "nitrogen --restore &" - spawnOnce "playerctld" - spawnOnce "picom &" - setWMName "LG3D" - spawnOnce "nm-applet" - spawnOnce ("xsetroot -cursor_name left_ptr") - spawnOnce ("killall trayer ;sleep 1 && trayer --monitor 0 --edge top --align right --margin 4 --widthtype request --padding 8 --iconspacing 12 --SetDockType true --SetPartialStrut true --expand true --transparent true --alpha 0 --tint 0x2B2E37 --height 30 --distance 5 &") - spawnOnce ("slimbookbattery --minimize") - spawnOnce ("slimbookintelcontroller") - spawnOnce ("nextcloud") - spawnOnOnce "web" myWebBrowser - spawnOnOnce "main" myTerminalTmux -@end -* XMobar Config -@code haskell - -myStatusBarSpawner :: Applicative f => ScreenId -> f StatusBarConfig -myStatusBarSpawner (S s) = do - pure $ statusBarPropTo ("_XMONAD_LOG_" ++ show s) - ("xmobar -x " ++ show s ++ " ~/.config/xmobar/xmobarrc" ++ show s) - (pure $ myXmobarPP (S s)) - - -myXmobarPP :: ScreenId -> PP -myXmobarPP s = def - { ppSep = "" - , ppWsSep = "" - , ppCurrent = xmobarColor cyan "" . const wsIconFull - , ppVisible = xmobarColor grey4 "" . const wsIconFull - , ppVisibleNoWindows = Just (xmobarColor grey4 "" . const wsIconFull) - , ppHidden = xmobarColor grey2 "" . const wsIconHidden - , ppHiddenNoWindows = xmobarColor grey2 "" . const wsIconEmpty - , ppUrgent = xmobarColor orange "" . const wsIconFull - , ppOrder = \(ws : _ : _ : extras) -> ws : extras - , ppExtras = [ wrapL " " " " $ layoutColorIsActive s (logLayoutOnScreen s) - ,titleColorIsActive s (shortenL 81 $ logTitleOnScreen s) - ] - } - where - wsIconFull = " \xf111 " - wsIconHidden = " \xf111 " - wsIconEmpty = " \xf10c " - titleColorIsActive n l = do - c <- withWindowSet $ return . W.screen . W.current - if n == c then xmobarColorL cyan "" l else xmobarColorL grey3 "" l - layoutColorIsActive n l = do - c <- withWindowSet $ return . W.screen . W.current - if n == c then wrapL "" l else wrapL "" l - @end -* Config Variables binding -@code haskell - -myConfig = def - { - terminal = myTerminal, - focusFollowsMouse = myFocusFollowsMouse, - clickJustFocuses = myClickJustFocuses, - borderWidth = myBorderWidth, - modMask = myModMask, - workspaces = myWorkspaces, - normalBorderColor = myNormalBorderColor, - focusedBorderColor = myFocusedBorderColor, - layoutHook = smartBorders . spacingWithEdge 15 $ myLayout, - manageHook = manageSpawn <+> myManageHook <+> manageHook def, - handleEventHook = myEventHook <+> fullscreenEventHook <+> swallowEventHook (className=?"Alacritty") (return True), - startupHook = myStartupHook - } -@end -* Main -@code haskell - -main :: IO () -main = xmonad . ewmh . ewmhFullscreen . dynamicSBs myStatusBarSpawner . docks $ additionalKeysP (removeKeysP myConfig myRemoveKeys) myKeys -@end