Update xmonad configuration
diff --git a/modules/xmonad/XMonadLog.hs b/modules/xmonad/XMonadLog.hs
index 78b707b..b07485c 100644
--- a/modules/xmonad/XMonadLog.hs
+++ b/modules/xmonad/XMonadLog.hs
@@ -35,10 +35,10 @@
purple = "#c678dd"
red = "#e06c75"
in def { ppOutput = dbusOutput dbus
- , ppCurrent = wrapper blue
- , ppVisible = wrapper red
+ , ppCurrent = wrapper red
+ , ppVisible = wrapper blue
, ppUrgent = wrapper orange
- , ppHidden = wrapper red
+ , ppHidden = wrapper blue
, ppHiddenNoWindows = wrapper grey
, ppTitle = shorten 100 . wrapper purple
}
diff --git a/modules/xmonad/xmonad.hs b/modules/xmonad/xmonad.hs
index 660db50..b478be1 100644
--- a/modules/xmonad/xmonad.hs
+++ b/modules/xmonad/xmonad.hs
@@ -8,25 +8,38 @@
import XMonad.Hooks.EwmhDesktops
import XMonad.Hooks.ManageDocks
-import qualified DBus.Client as D
+import qualified DBus.Client as D
import XMonad.Hooks.DynamicLog
import XMonadLog
-import XMonad.Hooks.ManageHelpers (isInProperty, doLower)
+import Blaze.ByteString.Builder (toByteString)
+import Foreign.C
+import XMonad
+import XMonad.Hooks.DynamicProperty (dynamicPropertyChange)
+import XMonad.Hooks.ManageHelpers (doFullFloat, doLower,
+ isInProperty, doRectFloat)
+import XMonad.Hooks.UrgencyHook
+import XMonad.Layout.Drawer (propertyToQuery)
import XMonad.Layout.Gaps
import XMonad.Layout.Spacing
-import Foreign.C
-import Blaze.ByteString.Builder (toByteString)
-import XMonad.Layout.Drawer (propertyToQuery)
+import qualified XMonad.StackSet as W
+import XMonad.Util.Hacks
+import qualified XMonad as W
+import XMonad.Util.PureX (curScreenId, curScreen)
terminal = "kitty" -- Kitty, my beloved <3
launcher = "pkill rofi; rofi -show combi"
-networkManager = "wpa_cli select_network $(wpa_cli list_networks | tail -n +3 | rofi -dmenu -window-title 'Select Network' | awk '{print $1;}')"
+networkManager = "wpa_cli select_network $(wpa_cli list_networks | tail -n +3 | awk '!seen[$2]++' | rofi -dmenu -window-title 'Select Network' | awk '{print $1;}')"
+
+screenshot = "mkdir -p ~/Screenshots && maim | tee ~/Screenshots/\"$(date --rfc-3339=seconds)\".png | xclip -select clipboard -t image/png"
+selectScreenshot = "mkdir -p ~/Screenshots && maim -s | tee ~/Screenshots/\"$(date --rfc-3339=seconds)\".png | xclip -select clipboard -t image/png"
+
modifierKey = mod4Mask -- Use Super as our mod key
statusBar = "pkill polybar; polybar"
compositor = "pkill picom; picom"
-background = "pkill show; show ~/.xmonad/wallpaper.glsl"
+background = "pkill show; show ~/.xmonad/wallpaper.glsl > /dev/null"
+keybindings = "setxkbmap -option caps:none && xmodmap ~/.Xmodmap"
shift = shiftMask
@@ -34,32 +47,47 @@
spawn Main.statusBar
spawn Main.compositor
spawn background
+ spawn keybindings
main :: IO ()
main = XMonadLog.xmonadLog >>= main'
main' :: D.Client -> IO ()
-main' dbus = xmonad $ ewmh . ewmhFullscreen $ docks $ def
+main' dbus = xmonad
+ $ javaHack
+ $ ewmh . setEwmhActivateHook doAskUrgent
+ $ docks
+ $ def
{ modMask = modifierKey -- Use Super as our mod key
, borderWidth = 0
, XMonad.terminal = Main.terminal
, XMonad.startupHook = Main.startupHook
, XMonad.logHook = dynamicLogWithPP (polybarHook dbus)
- , XMonad.layoutHook = avoidStruts $
- smartSpacing 5 $
- gaps [(U, 5), (D, 5), (L, 5), (R, 5)] $
- layoutHook def
+ , XMonad.layoutHook = avoidStruts
+ $ smartSpacing 5
+ $ gaps [(U, 5), (D, 5), (L, 5), (R, 5)]
+ $ layoutHook def
, XMonad.manageHook = composeAll
- [ className =? "Show" --> doIgnore <+> doLower <+> doLower
- -- You can't check if "Show" is a desktop window,
- -- I believe it's because show doesn't instantly set
- -- desktop. Do not try. It is not worth it.
+ [ isInProperty "_NET_WM_WINDOW_TYPE" "_NET_WM_WINDOW_TYPE_DESKTOP"
+ --> doIgnore <+> doLower <+> doLower
] <+> manageHook def
+ , XMonad.handleEventHook = composeAll
+ [ windowedFullscreenFixEventHook
+ , dynamicPropertyChange "_NET_WM_WINDOW_TYPE"
+ (isInProperty "_NET_WM_WINDOW_TYPE" "_NET_WM_WINDOW_TYPE_DESKTOP"
+ --> doLower
+ <+> (ask >>= \w -> liftX (modifyWindowSet (W.delete w))
+ >> mempty)
+ <+> (ask >>= \w -> liftX (withDisplay $ \dpy -> io (moveResizeWindow dpy w 0 0 (fromIntegral $ displayWidth dpy $ defaultScreen dpy) (fromIntegral $ displayHeight dpy $ defaultScreen dpy))) >> mempty))
+ ]
+ <+> handleEventHook def
} `additionalKeys`
[ ((modifierKey, xK_d), spawn launcher)
, ((modifierKey, xK_n), spawn networkManager)
- , ((modifierKey .|. shift, xK_q), kill)
+ , ((modifierKey .|. Main.shift, xK_q), kill)
, ((modifierKey, xK_q), spawn "xmonad --restart")
- , ((modifierKey .|. shift, xK_c), io exitSuccess)
+ , ((modifierKey .|. Main.shift, xK_c), io exitSuccess)
+ , ((modifierKey .|. Main.shift, xK_s), spawn selectScreenshot)
+ , ((0, xK_Print), spawn screenshot)
]