From 85af9c3b461e269508fc0c5e48eae546c1a242b6 Mon Sep 17 00:00:00 2001 From: Trey Blancher Date: Tue, 9 Apr 2024 14:56:33 -0400 Subject: [PATCH] Settled updates --- xmonad.hs | 79 +++++++++++++++++++++++++++++-------------------------- 1 file changed, 42 insertions(+), 37 deletions(-) diff --git a/xmonad.hs b/xmonad.hs index 4a7e240..cd5f225 100755 --- a/xmonad.hs +++ b/xmonad.hs @@ -25,6 +25,8 @@ import XMonad.Hooks.FadeInactive import XMonad.Hooks.ManageDocks import XMonad.Hooks.ManageHelpers import XMonad.Hooks.SetWMName +import XMonad.Hooks.UrgencyHook + -- Layout import XMonad.Layout @@ -88,14 +90,14 @@ instance ExtensionClass RightScreen where genWorkspaces :: ScreenId -> [IS.PhysicalWorkspace] genWorkspaces sc = if sc == 3 - then IS.withScreen 0 ["pindrop"] ++ IS.withScreen 1 ["qb"] ++ IS.withScreen 2 ["shell", "VM"] + then IS.withScreen 0 ["pindrop"] ++ IS.withScreen 2 ["shell", "VM"] ++ IS.withScreen 1 ["qb"] else IS.withScreens sc ["shell", "qb", "pindrop", "VM"] -- End DynamicWorkspaces code (keybindings are below) -- getTopBar :: Int -> String getTopBar sc = if sc == 1 then "dzen2 -dock -p -x 0 -ta l -w 1024 -e 'onstart:lower;button2=togglehide;sigusr1=togglehide'" - else "dzen2 -dock -p -x 1920 -ta l -w 1024 -e 'onstart:lower;button2=togglehide;sigusr1=togglehide'" + else "dzen2 -dock -p -x 2880 -ta l -w 1024 -e 'onstart:lower;button2=togglehide;sigusr1=togglehide'" --getBarbicanBar :: Int -> String --getBarbicanBar sc = if sc == 1 @@ -155,16 +157,16 @@ toggleHomeScreens = do else if sc == 3 then do - spawn "xrandr --output eDP-1 --primary --auto --output DVI-I-3-2 --auto --left-of eDP-1 --output DVI-I-2-1 --auto --right-of eDP-1" + --spawn "xrandr --output eDP-1 --primary --auto --output DVI-I-3-2 --auto --left-of eDP-1 --output DVI-I-2-1 --auto --right-of eDP-1" -- spawn "xrandr --output eDP-1-1 --primary --auto --output DVI-I-2-1 --auto --left-of eDP-1-1 --output DVI-I-3-2 --auto --right-of eDP-1-1" - -- spawn "while true; do \n\ - -- \~/bin/battery; \n\ - -- \echo -n ' '; \n\ - -- \~/bin/temp.sh; \n\ - -- \echo -n ' '; \n\ - -- \date '+%a, %b %d %T'; \n\ - -- \sleep 1; \n\ - -- \done | dzen2 -dock -p -x 1602 -w 325 -h 24 -ta l -fn 'xos4 Terminus:style=Regular:Pixelsize=12' &" + --spawn "while true; do \n\ + -- \~/bin/battery; \n\ + -- \echo -n ' '; \n\ + -- \~/bin/temp.sh; \n\ + -- \echo -n ' '; \n\ + -- \date '+%a, %b %d %T'; \n\ + -- \sleep 1; \n\ + -- \done | dzen2 -dock -p -x 1602 -w 325 -h 24 -ta l -fn 'xos4 Terminus:style=Regular:Pixelsize=12' &" -- spawn "while true; do \n\ -- \~/bin/battery; \n\ -- \echo -n ' '; \n\ @@ -180,7 +182,7 @@ toggleHomeScreens = do \echo -n ' '; \n\ \date '+%a, %b %d %T'; \n\ \sleep 1; \n\ - \done | dzen2 -dock -p -x 5442 -w 325 -h 24 -ta l -fg #ebdbb2 -bg #282828 -fn 'xos4 Terminus:style=Regular:Pixelsize=12' &" + \done | dzen2 -dock -p -x 5399 -w 480 -h 24 -ta l -fg #ebdbb2 -bg #000000 -fn 'xft:monospace:style=Regular:Pixelsize=10' &" {- spawn "while true; do echo -n $(cat /tmp/temp); echo -n ' '; date '+%a, %b %d %T'; sleep 1; done | dzen2 -dock -p -x 1710 -w 210 -e 'onstart:lower;button2=togglehide' -h 24 -ta l -fg #aaaaaa -bg #282828 -fn Terminus-10 -xs 1 &" spawn "while true; do echo -n $(cat /tmp/temp); echo -n ' '; date '+%a, %b %d %T'; sleep 1; done | dzen2 -dock -p -x 3630 -w 210 -e 'onstart:lower;button2=togglehide' -h 24 -ta l -fg #aaaaaa -bg #282828 -fn Terminus-10 -xs 0 &" spawn "while true; do echo -n $(cat /tmp/temp); echo -n ' '; date '+%a, %b %d %T'; sleep 1; done | dzen2 -dock -p -x 5550 -w 210 -e 'onstart:lower;button2=togglehide' -h 24 -ta r -fg #aaaaaa -bg #282828 -fn Terminus-10 -xs 2 &" -} @@ -273,7 +275,7 @@ myTheme :: Theme myTheme = def { fontName = myFont } -myFont = "monospace:style=Regular:Pixelsize=18" +myFont = "xft:monospace:style=Regular:Pixelsize=18" fadeHook = fadeInactiveLogHook fadeAmount where fadeAmount = 0.8 @@ -284,6 +286,12 @@ makeLauncher yargs run exec close = concat --launcher = makeLauncher "-x -- -nf grey -nb black -fn 'xos4 Terminus:Pixelsize=8'" "eval" "\"exec " "\"" launcher = makeLauncher "-x" "eval" "\"exec " "\"" +startTrayer sc = do + if sc == 3 + then + "trayer --edge top --align right --widthtype request --margin 490 --expand false --SetDockType true --SetPartialStrut false --tint 0x000000 --transparent true --alpha 0 --height 24 --monitor 2" + else + "trayer --edge top --align right --widthtype request --margin 490 --expand false --SetDockType true --SetPartialStrut false --tint 0x000000 --transparent true --alpha 0 --height 24 --monitor 'primary'" main = do sc <- IS.countScreens dzenTopBar <- spawnPipe (getTopBar sc) @@ -294,7 +302,7 @@ main = do sc <- IS.countScreens --dzenSodiumBar <- spawnPipe (getSodiumBar sc) --dzenTennessineBar <- spawnPipe (getTennessineBar sc) --dzenBlancherBar <- spawnPipe (getBlancherBar sc) - xmonad $ desktopConfig { + xmonad $ ewmhFullscreen . ewmh $ def { workspaces = genWorkspaces (S sc) , terminal = myTerminal , focusFollowsMouse = True @@ -304,7 +312,7 @@ main = do sc <- IS.countScreens , layoutHook = avoidStruts $ layoutH , logHook = myLogHook dzenTopBar >> fadeHook >> updatePointer (0.5, 0.5) (0, 0) , borderWidth = 1 - , normalBorderColor = "#282828" + , normalBorderColor = "#000000" , focusedBorderColor = "#ebdbb2" , modMask = winKey , startupHook = myStartup @@ -316,24 +324,18 @@ main = do sc <- IS.countScreens myStartup :: X () myStartup = do --setWMName "LG3D" - --sc <- IS.countScreens + sc <- IS.countScreens toggleHomeScreens --spawn "xset dpms 600" spawn "xautolock -secure -time 10 -locker 'i3lock -c 000000'" - --if sc == 1 - -- then do + spawn (startTrayer sc) -- --spawn "trayer --edge top --align right --widthtype request --margin 318 --expand false --SetDockType true --SetPartialStrut false --tint 0x282828 --transparent true --alpha 0 --height 24 --monitor 'primary'" -- --spawn "stalonetray" -- --spawn "gnome-gmail-notifier" -- --spawn "xautolock -secure -time 10 -locker 'i3lock -c 000000 -i /home/trey/images/black.png'" -- - --else if sc == 3 - -- then do -- --spawn "trayer --edge top --align right --widthtype request --margin 318 --expand false --SetDockType true --SetPartialStrut false --tint 0x282828 --transparent true --alpha 0 --height 24 --monitor 2" - --else - -- return () - activateMyTerminal :: X () activateMyTerminal = do sc <- IS.countScreens @@ -358,14 +360,14 @@ myLogHook :: Handle -> X () --myLogHook h = dynamicLogWithPP $ defaultPP myLogHook h = dynamicLogWithPP $ IS.marshallPP (S 0) $ def { - ppCurrent = dzenColor "#8AE234" "#282828" . pad - , ppVisible = dzenColor "#555753" "#282828" . pad - , ppHidden = dzenColor "#ebdbb2" "#282828" . pad - , ppHiddenNoWindows = dzenColor "#555753" "#282828" . pad - , ppUrgent = dzenColor "#cc0000" "#282828" . pad + ppCurrent = dzenColor "#8AE234" "#000000" . pad + , ppVisible = dzenColor "#555753" "#000000" . pad + , ppHidden = dzenColor "#ebdbb2" "#000000" . pad + , ppHiddenNoWindows = dzenColor "#555753" "#000000" . pad + , ppUrgent = dzenColor "#cc0000" "#000000" . pad , ppWsSep = "." , ppSep = " | " - , ppLayout = dzenColor "#666600" "#282828" . + , ppLayout = dzenColor "#666600" "#000000" . (\x -> case x of "Tall" -> "^i(" ++ myBitmapsDir ++ "/tall.xbm)" "Mirror Tall" -> "^i(" ++ myBitmapsDir ++ "/mtall.xbm)" @@ -374,7 +376,7 @@ myLogHook h = dynamicLogWithPP $ IS.marshallPP (S 0) $ def "IM Grid" -> "IM" _ -> x ) - , ppTitle = ("" ++) . dzenColor "#ff6600" "#282828" . dzenEscape + , ppTitle = ("" ++) . dzenColor "#ff6600" "#000000" . dzenEscape , ppOutput = hPutStrLn h } @@ -442,12 +444,12 @@ myKeys = [ , ((controlMask .|. lAlt, xK_BackSpace), (spawnHere "xfdesktop --quit")) , ((controlMask .|. lAlt, xK_Delete), (spawnHere "pkill -9 chromium")) , ((controlMask .|. shiftMask, xK_Return), (spawnHere myTerminal)) - , ((controlMask .|. shiftMask, xK_3), spawn "scrot --exec 'mkdir -p ~/Desktop && mv $f ~/Desktop' && paplay ~/wav/camera.wav") - , ((controlMask .|. shiftMask, xK_4), unGrab >> spawn "scrot --exec 'mkdir -p ~/Desktop && mv $f ~/Desktop' --select && paplay ~/wav/camera.wav") + , ((controlMask .|. shiftMask, xK_3), spawn "scrot --exec 'mkdir -p ~/images && mv $f ~/images' && paplay ~/wav/camera.wav") + , ((controlMask .|. shiftMask, xK_4), unGrab >> spawn "scrot --exec 'mkdir -p ~/images && mv $f ~/images' --select && paplay ~/wav/camera.wav") , ((controlMask .|. winKey, xK_z), ifWindows (resource =? "Zoom") (mapM_ focus) (spawnHere "zoom")) -- windows (viewOnScreen 1 "ws") -- ifWindows (resource =? "altUrxvt") (mapM_ focus) (spawnHere altTerminal)) - , ((lAlt, xK_v), spawn "clipmenu && xdotool key Ctrl+v") + , ((lAlt, xK_v), spawn "CM_HISTLENGTH=20 clipmenu && xdotool key Ctrl+v") --, ((winKey .|. shiftMask, xK_v), do -- windows (viewOnScreen 1 "virtualbox") -- ifWindows (className =? "Gvim") (mapM_ focus) (spawnHere "gvim")) @@ -462,7 +464,7 @@ myKeys = [ --, ((winKey .|. shiftMask, xK_Return), spawnHere myTerminal) , ((winKey , xK_b), do spawnHere "pkill -USR1 dzen2" - spawnHere "pkill stalonetray" + spawnHere "pkill trayer" sendMessage $ ToggleStruts sendMessage $ ToggleGaps) --sendMessage $ ToggleStruts) @@ -470,7 +472,7 @@ myKeys = [ --, ((winKey , xK_g), ifWindows (className =? "Google-chrome") (mapM_ focus) (spawnHere "google-chrome")) , ((winKey , xK_g), do windows (viewOnScreen 0 "pindrop") - ifWindows (className =? "Google-chrome") (mapM_ focus) (spawnHere "vivaldi")) + ifWindows (className =? "Vivaldi-stable") (mapM_ focus) (spawnHere "vivaldi")) --, ((winKey , xK_r), do -- windows (viewOnScreen 1 "wb") -- ifWindows (className =? "Google-chrome-stable") (mapM_ focus) (spawnHere "google-chrome-stable")) @@ -482,7 +484,7 @@ myKeys = [ -- , ((winKey , xK_d ), ifWindows (className =? "Goldendict") (mapM_ killWindow) (spawnHere "goldendict")) -- , ((winKey , xK_d), ifWindows (className =? "Xfce4-dict") (mapM_ killWindow) (spawnHere "xfce4-dict")) , ((winKey , xK_d), ifWindows (className =? "Org.gnome.Dictionary") (mapM_ killWindow) (spawnHere "gnome-dictionary")) - , ((winKey , xK_f), spawnHere (myTerminal ++ " -e vifm . ~")) + --, ((winKey , xK_f), spawnHere (myTerminal ++ " -e vifm . ~")) --, ((winKey , xK_f), spawnHere ("export SHELL=/bin/bash && " ++ myTerminal ++ " -e mc")) --, ((winKey , xK_e), spawnHere ("export SHELL=/bin/bash && " ++ myTerminal ++ " -e mc")) -- key stroke matches Win+E (from Win7) , ((winKey , xK_o), do @@ -496,6 +498,9 @@ myKeys = [ -- windows (viewOnScreen 1 "hng") -- ifWindows (className =? "Skype") (mapM_ focus) (spawnHere "skype")) , ((winKey , xK_s), ifWindows (className =? "Pavucontrol") (mapM_ killWindow) (spawnHere "pavucontrol")) +-- , ((winKey , xK_t), do +-- spawn "pkill trayer" +-- spawn (startTrayer sc)) , ((winKey , xK_c), kill) --, ((winKey , xK_m), windows W.focusMaster) , ((winKey , xK_comma), sendMessage (IncMasterN 1)) @@ -521,7 +526,7 @@ myKeys = [ -- , ((winKey , xK_Print), spawnHere "xfce4-screenshooter") , ((winKey , xK_Left), prevWS) , ((winKey , xK_Right), nextWS) - , ((winKey , xK_Up), spawnHere "skippy-xd") + , ((winKey , xK_Up), spawnHere "skippy-xd --paging") --, ((0, xF86XK_Calculator), spawnHere "/home/trey/bin/calc") --, ((0, xF86XK_Calculator), ifWindows (className =? "Gcalctool") (mapM_ killWindow) (spawnHere "gcalctool")) , ((winKey , xK_y), spawn "dunstctl close-all")