From d11298e3866e606e7a828557e2fccbb74d05123f Mon Sep 17 00:00:00 2001 From: Luddifee Date: Tue, 27 Jul 2021 17:20:10 +0200 Subject: [PATCH] general update --- .../{xmobar-pc.config => xmobar-pc-0.config} | 22 +++++------- .config/xmobar/xmobar-pc-1.config | 24 +++++++++++++ .xmonad/xmonad-laptop.hs | 22 +++--------- .xmonad/xmonad-pc.hs | 34 +++++++------------ scripts/setup-pc | 3 +- 5 files changed, 52 insertions(+), 53 deletions(-) rename .config/xmobar/{xmobar-pc.config => xmobar-pc-0.config} (50%) create mode 100644 .config/xmobar/xmobar-pc-1.config diff --git a/.config/xmobar/xmobar-pc.config b/.config/xmobar/xmobar-pc-0.config similarity index 50% rename from .config/xmobar/xmobar-pc.config rename to .config/xmobar/xmobar-pc-0.config index 41075f4..f3add40 100644 --- a/.config/xmobar/xmobar-pc.config +++ b/.config/xmobar/xmobar-pc-0.config @@ -1,28 +1,24 @@ Config { font = "xft:monospace" - , additionalFonts = [] - , borderColor = "black" - , border = TopB , bgColor = "#303030" , fgColor = "grey" - , alpha = 255 , position = Static { xpos = 0 , ypos = 0, width = 2560, height = 30 } - , textOffset = -1 - , iconOffset = -1 , lowerOnStart = True - , pickBroadest = False - , persistent = False , hideOnStart = False - , iconRoot = "." , allDesktops = True - , overrideRedirect = True + , persistent = True + , iconRoot = "." , commands = [ - Run Cpu ["-L","3","-H","50", "--normal","green","--high","red"] 10 + Run Cpu ["-L","3","-H","50"] 5 , Run Memory ["-t","Mem: %"] 10 , Run Com "uname" ["-s","-r"] "" 36000 + , Run Weather "EDDN" [ "-t",": °C" ] 3600 , Run Date "%H:%M - %d.%m.%Y" "date" 10 + , Run DynNetwork [ "-S","True","-t", ": , " ] 10 + , Run Volume "default" "Master" [] 2 + ] 10 ] , sepChar = "%" , alignSep = "}{" - , template = " %cpu% | %memory%}\ - \{ %date% | %uname% " + , template = " %cpu% | %memory% | %default:Master% }\ + \{ %dynnetwork% | %EDDN% | %date% | %uname% " } diff --git a/.config/xmobar/xmobar-pc-1.config b/.config/xmobar/xmobar-pc-1.config new file mode 100644 index 0000000..b342d8c --- /dev/null +++ b/.config/xmobar/xmobar-pc-1.config @@ -0,0 +1,24 @@ +Config { font = "xft:monospace" + , bgColor = "#303030" + , fgColor = "grey" + , position = Static { xpos = 2560 , ypos = 0, width = 2560, height = 30 } + , lowerOnStart = True + , hideOnStart = False + , allDesktops = True + , persistent = True + , iconRoot = "." + , commands = [ + Run Cpu ["-L","3","-H","50"] 5 + , Run Memory ["-t","Mem: %"] 10 + , Run Com "uname" ["-s","-r"] "" 36000 + , Run Weather "EDDN" [ "-t",": °C" ] 3600 + , Run Date "%H:%M - %d.%m.%Y" "date" 10 + , Run DynNetwork [ "-S","True","-t", ": , " ] 10 + , Run Volume "default" "Master" [] 2 + ] 10 + ] + , sepChar = "%" + , alignSep = "}{" + , template = " %cpu% | %memory% | %default:Master% }\ + \{ %dynnetwork% | %EDDN% | %date% | %uname% " +} diff --git a/.xmonad/xmonad-laptop.hs b/.xmonad/xmonad-laptop.hs index 2104143..0418977 100644 --- a/.xmonad/xmonad-laptop.hs +++ b/.xmonad/xmonad-laptop.hs @@ -87,26 +87,14 @@ myKeys = [ ------------------------------------------------------------------------ -- Mouse bindings: default actions bound to mouse events -- -myMouseBindings (XConfig {XMonad.modMask = modm}) = - M.fromList $ +myMouseBindings XConfig {XMonad.modMask = modm} = + M.fromList -- mod-button1, Set the window to floating mode and move by dragging - [ ( (modm, button1), - ( \w -> - focus w >> mouseMoveWindow w - >> windows W.shiftMaster - ) - ), + [ ((modm, button1), \w -> focus w >> mouseMoveWindow w >> windows W.shiftMaster), -- mod-button2, Raise the window to the top of the stack - ((modm, button2), (\w -> focus w >> windows W.shiftMaster)), + ((modm, button2), \w -> focus w >> windows W.shiftMaster), -- mod-button3, Set the window to floating mode and resize by dragging - ( (modm, button3), - ( \w -> - focus w >> mouseResizeWindow w - >> windows W.shiftMaster - ) - ) - -- you may also bind events to the mouse scroll wheel (button4 and button5) - ] + ((modm, button3), \w -> focus w >> mouseResizeWindow w >> windows W.shiftMaster) ] diff --git a/.xmonad/xmonad-pc.hs b/.xmonad/xmonad-pc.hs index 81f589f..16793d9 100644 --- a/.xmonad/xmonad-pc.hs +++ b/.xmonad/xmonad-pc.hs @@ -9,6 +9,8 @@ import XMonad.Util.SpawnOnce import XMonad.Util.EZConfig import XMonad.Layout.Spacing + +import XMonad.Hooks.DynamicBars import XMonad.Hooks.ManageDocks import qualified XMonad.StackSet as W @@ -51,10 +53,10 @@ myKeys = [ ("M-S-d" , spawn myAppMenuThemes), ("M-i" , spawn myBrowser), ("M-S-i" , spawn myAltBrowser), - + -- killing, exiting and suspending keybindings ("M-q" , kill), - ("M-S-q" , io (exitWith ExitSuccess)), + ("M-S-q" , io exitSuccess), ("M-S-s" , spawn "systemctl suspend"), -- restarting and recompiling keybindings @@ -83,26 +85,14 @@ clipBoardScreenshotCommand = "bash -c \"gnome-screenshot -af /tmp/screenshot && ------------------------------------------------------------------------ -- Mouse bindings: default actions bound to mouse events -- -myMouseBindings (XConfig {XMonad.modMask = modm}) = - M.fromList $ +myMouseBindings XConfig {XMonad.modMask = modm} = + M.fromList -- mod-button1, Set the window to floating mode and move by dragging - [ ( (modm, button1), - ( \w -> - focus w >> mouseMoveWindow w - >> windows W.shiftMaster - ) - ), + [ ((modm, button1), \w -> focus w >> mouseMoveWindow w >> windows W.shiftMaster), -- mod-button2, Raise the window to the top of the stack - ((modm, button2), (\w -> focus w >> windows W.shiftMaster)), + ((modm, button2), \w -> focus w >> windows W.shiftMaster), -- mod-button3, Set the window to floating mode and resize by dragging - ( (modm, button3), - ( \w -> - focus w >> mouseResizeWindow w - >> windows W.shiftMaster - ) - ) - -- you may also bind events to the mouse scroll wheel (button4 and button5) - ] + ((modm, button3), \w -> focus w >> mouseResizeWindow w >> windows W.shiftMaster) ] @@ -128,7 +118,7 @@ myStartupHook = do main = do xmproc0 <- spawnPipe "nitrogen --restore" xmproc1 <- spawnPipe "killall picom; picom &" - xmproc2 <- spawnPipe "killall xmobar; xmobar ~/.config/xmobar/xmobar.config" + xmproc2 <- spawnPipe "killall xmobar; xmobar ~/.config/xmobar/xmobar0.config; xmobar ~/.config/xmobar/xmobar1.config" xmonad $ docks defaults defaults = def { @@ -140,10 +130,10 @@ defaults = def { workspaces = myWorkspaces, normalBorderColor = myNormalBorderColor, focusedBorderColor = myFocusedBorderColor, - + -- bindings mouseBindings = myMouseBindings, - + -- hooks layoutHook = myLayoutHook, manageHook = myManageHook, diff --git a/scripts/setup-pc b/scripts/setup-pc index 10415fc..cf23d40 100755 --- a/scripts/setup-pc +++ b/scripts/setup-pc @@ -6,7 +6,8 @@ source $BASEDIR/basic-setup mkdir -p ~/.xmonad mkdir -p ~/.config/xmobar cp $FILEDIR/.xmonad/xmonad-pc.hs ~/.xmonad/xmonad.hs -cp $FILEDIR/.config/xmobar/xmobar-pc.config ~/.config/xmobar/xmobar.config +cp $FILEDIR/.config/xmobar/xmobar-pc-0.config ~/.config/xmobar/xmobar0.config +cp $FILEDIR/.config/xmobar/xmobar-pc-1.config ~/.config/xmobar/xmobar0.config # download nvidia driver mkdir -p ~/Downloads