diff --git a/user/wm/xmonad/startup.sh b/user/wm/xmonad/startup.sh index 43831be..f35568a 100755 --- a/user/wm/xmonad/startup.sh +++ b/user/wm/xmonad/startup.sh @@ -7,30 +7,21 @@ colorSecondary=$4 # ## Kill previous instances of applications (Prevents multiple instances of the following if XMonad is restarted durin the X session) killall xmobar -killall trayer killall nm-applet -killall nextcloud -killall xautolock -killall caffeine -killall syncthing-gtk -killall gtkcord4 -killall qjoypad # Launch necessary desktop applications -emacs --daemon & +autorandr; picom --animations --animation-window-mass 1 --animation-for-open-window zoom --animation-stiffness 200 --experimental-backends && # requires picom-pijulius xset r rate 350 50 & setxkbmap -option caps:escape & ~/.fehbg-stylix & +~/.config/xmobar/xmobar-st-check.sh & twmnd & alttab -w 1 -t 240x160 -i 64x64 -sc 1 -bg $colorBg -fg $colorFg -frame $colorSecondary -inact $colorFg & ##/usr/bin/trayer --edge top --align right --SetDockType true --SetPartialStrut true --expand true --widthtype request --transparent true --alpha 0 --height 28 --tint $trayertint --monitor "primary" & nm-applet & GOMAXPROCS=1 syncthing --no-browser & -rclone mount adantium-nextcloud:/ ~/Nextcloud & -syncthing-gtk -m & protonmail-bridge --noninteractive -~/.local/bin/setup-external-monitor.sh & -rm -rf ~/org & +emacs --daemon; rm -rf ~/org & gnome-keyring-daemon --daemonize --login & gnome-keyring-daemon --start --components=secrets & diff --git a/user/wm/xmonad/xmobar-st-check.sh.mustache b/user/wm/xmonad/xmobar-st-check.sh.mustache new file mode 100644 index 0000000..7423c26 --- /dev/null +++ b/user/wm/xmonad/xmobar-st-check.sh.mustache @@ -0,0 +1,7 @@ +#!/bin/sh +while true + do + curl localhost:8384 &> /dev/null || echo '❄ st off' > ~/.st-status; + curl localhost:8384 &> /dev/null && echo '↺ st on' > ~/.st-status; + sleep 5; + done diff --git a/user/wm/xmonad/xmobarrc.mustache b/user/wm/xmonad/xmobarrc.mustache index 6e798c5..0d9dcba 100644 --- a/user/wm/xmonad/xmobarrc.mustache +++ b/user/wm/xmonad/xmobarrc.mustache @@ -38,16 +38,18 @@ Config { font = "Inconsolata 16" ] 1 , Run DynNetwork [ "-t", "\xf0200 "] 1 + , Run Com "cat" + [ "/home/emmet/.st-status"] "syncthing" 10 , Run Com "echo" - [ "\xea77 st"] "syncthing" 0 + [ "\xea77 "] "syncthingsymbol" 0 , Run Com "echo" - [ "\xeb5c "] "currentthemesymbol" 0 + [ "\xeb5c "] "artsymbol" 0 , Run Com "cat" [ "/home/emmet/.currenttheme"] "currenttheme" 0 , Run Memory [ "-t", "\xf035b % ( GB)", "-d", "1", "--", "--scale", "1024"] 20 ] , sepChar = "%" , alignSep = "}{" - , template = " %battery% %bright%%default:Master% %memory% %currentthemesymbol%%currenttheme%}%XMonadLog%{%syncthing% %dynnetwork% %date% " + , template = " %battery% %bright%%default:Master% %memory% %artsymbol%%currenttheme%}%XMonadLog%{%syncthing% %dynnetwork% %date% " } } diff --git a/user/wm/xmonad/xmonad.hs b/user/wm/xmonad/xmonad.hs index 6248eab..ddf9624 100644 --- a/user/wm/xmonad/xmonad.hs +++ b/user/wm/xmonad/xmonad.hs @@ -229,6 +229,7 @@ myKeys conf@(XConfig {XMonad.modMask = modm}) = -- launch rofi ((modm, xK_semicolon), spawn ("rofi -show drun -show-icons")), ((modm, xK_p), spawn ("keepmenu")), + ((modm, xK_i), spawn ("networkmanager_dmenu")), -- close focused window ((modm, xK_q), kill), diff --git a/user/wm/xmonad/xmonad.nix b/user/wm/xmonad/xmonad.nix index f41ab6f..9717edf 100644 --- a/user/wm/xmonad/xmonad.nix +++ b/user/wm/xmonad/xmonad.nix @@ -11,6 +11,7 @@ home.packages = with pkgs; [ xmobar + networkmanagerapplet dunst pamixer autorandr @@ -49,6 +50,15 @@ extension = ""; }; + + home.file.".config/xmobar/xmobar-st-check.sh" = { + source = config.lib.stylix.colors { + template = builtins.readFile ./xmobar-st-check.sh.mustache; + extension = ".sh"; + }; + executable = true; + }; + services.autorandr.enable = true; programs.autorandr.enable = true; programs.autorandr.profiles = { diff --git a/user/wm/xmonad/xmonad.org b/user/wm/xmonad/xmonad.org index 79306ae..f18f35e 100644 --- a/user/wm/xmonad/xmonad.org +++ b/user/wm/xmonad/xmonad.org @@ -314,6 +314,7 @@ I have =rofi= bound to =S-;= for quick app access. -- launch rofi ((modm, xK_semicolon), spawn ("rofi -show drun -show-icons")), ((modm, xK_p), spawn ("keepmenu")), + ((modm, xK_i), spawn ("networkmanager_dmenu")), #+END_SRC **** Window Management Keybinds @@ -645,35 +646,26 @@ The autostart script kills all applications I am autostarting, which prevents mu # ## Kill previous instances of applications (Prevents multiple instances of the following if XMonad is restarted durin the X session) killall xmobar -killall trayer killall nm-applet -killall nextcloud -killall xautolock -killall caffeine -killall syncthing-gtk -killall gtkcord4 -killall qjoypad #+END_SRC Then, desktop applications are started in the background. #+BEGIN_SRC sh :tangle startup.sh :tangle-mode (identity #o755) # Launch necessary desktop applications -emacs --daemon & +autorandr; picom --animations --animation-window-mass 1 --animation-for-open-window zoom --animation-stiffness 200 --experimental-backends && # requires picom-pijulius xset r rate 350 50 & setxkbmap -option caps:escape & ~/.fehbg-stylix & +~/.config/xmobar/xmobar-st-check.sh & twmnd & alttab -w 1 -t 240x160 -i 64x64 -sc 1 -bg $colorBg -fg $colorFg -frame $colorSecondary -inact $colorFg & ##/usr/bin/trayer --edge top --align right --SetDockType true --SetPartialStrut true --expand true --widthtype request --transparent true --alpha 0 --height 28 --tint $trayertint --monitor "primary" & nm-applet & GOMAXPROCS=1 syncthing --no-browser & -rclone mount adantium-nextcloud:/ ~/Nextcloud & -syncthing-gtk -m & protonmail-bridge --noninteractive -~/.local/bin/setup-external-monitor.sh & -rm -rf ~/org & +emacs --daemon; rm -rf ~/org & gnome-keyring-daemon --daemonize --login & gnome-keyring-daemon --start --components=secrets & #+END_SRC @@ -756,21 +748,34 @@ Config { font = "Inconsolata 16" ] 1 , Run DynNetwork [ "-t", "\xf0200 "] 1 + , Run Com "cat" + [ "/home/emmet/.st-status"] "syncthing" 10 , Run Com "echo" - [ "\xea77 st"] "syncthing" 0 + [ "\xea77 "] "syncthingsymbol" 0 , Run Com "echo" - [ "\xeb5c "] "currentthemesymbol" 0 + [ "\xeb5c "] "artsymbol" 0 , Run Com "cat" [ "/home/emmet/.currenttheme"] "currenttheme" 0 , Run Memory [ "-t", "\xf035b % ( GB)", "-d", "1", "--", "--scale", "1024"] 20 ] , sepChar = "%" , alignSep = "}{" - , template = " %battery% %bright%%default:Master% %memory% %currentthemesymbol%%currenttheme%}%XMonadLog%{%syncthing% %dynnetwork% %date% " + , template = " %battery% %bright%%default:Master% %memory% %artsymbol%%currenttheme%}%XMonadLog%{%syncthing% %dynnetwork% %date% " } } #+END_SRC + +#+BEGIN_SRC shell :tangle xmobar-st-check.sh.mustache +#!/bin/sh +while true + do + curl localhost:8384 &> /dev/null || echo '❄ st off' > ~/.st-status; + curl localhost:8384 &> /dev/null && echo '↺ st on' > ~/.st-status; + sleep 5; + done +#+END_SRC + * Nix Integration In order to have Nix put my xmonad/xmobar configuration in the proper places, I have [[./xmonad.nix][xmonad.nix]], which I source in the =imports= block of my [[../../home.nix][home.nix]]. #+BEGIN_SRC nix :tangle xmonad.nix @@ -787,6 +792,7 @@ In order to have Nix put my xmonad/xmobar configuration in the proper places, I home.packages = with pkgs; [ xmobar + networkmanagerapplet dunst pamixer autorandr @@ -825,6 +831,15 @@ In order to have Nix put my xmonad/xmobar configuration in the proper places, I extension = ""; }; + + home.file.".config/xmobar/xmobar-st-check.sh" = { + source = config.lib.stylix.colors { + template = builtins.readFile ./xmobar-st-check.sh.mustache; + extension = ".sh"; + }; + executable = true; + }; + services.autorandr.enable = true; programs.autorandr.enable = true; programs.autorandr.profiles = {