From 65c8c2430e6c24835dccc90215a29a537a363b03 Mon Sep 17 00:00:00 2001 From: Swarsel Date: Sun, 15 Dec 2024 15:01:33 +0100 Subject: [PATCH] fix: config checker not working on generic sys --- SwarselSystems.org | 492 ++++++++++++++++---------------- profiles/optional/home/work.nix | 4 + scripts/waybarupdate.sh | 2 +- 3 files changed, 254 insertions(+), 244 deletions(-) diff --git a/SwarselSystems.org b/SwarselSystems.org index 07cdef4..48e3471 100644 --- a/SwarselSystems.org +++ b/SwarselSystems.org @@ -1879,7 +1879,7 @@ This scripts checks if there are uncommited changes in either my dotfile repo, m #+begin_src shell :tangle scripts/waybarupdate.sh CFG=$(git --git-dir="$HOME"/.dotfiles/.git --work-tree="$HOME"/.dotfiles/ status -s | wc -l) - CSE=$(git --git-dir="$HOME"/Documents/GitHub/CSE_TUWIEN/.git --work-tree="$HOME"/Documents/GitHub/CSE_TUWIEN/ status -s | wc -l) + CSE=$(git --git-dir="$DOCUMENT_DIR_PRIV"/CSE_TUWIEN/.git --work-tree="$DOCUMENT_DIR_PRIV"/CSE_TUWIEN/ status -s | wc -l) PASS=$(($(git --git-dir="$HOME"/.local/share/password-store/.git --work-tree="$HOME"/.local/share/password-store/ status -s | wc -l) + $(git --git-dir="$HOME"/.local/share/password-store/.git --work-tree="$HOME"/.local/share/password-store/ diff origin/main..HEAD | wc -l))) if [[ $CFG != 0 ]]; then @@ -8201,270 +8201,272 @@ The rest of the related configuration is found here: - [[#h:f93f66f9-6b8b-478e-b139-b2f382c1f25e][waybarupdate]] #+begin_src nix :tangle profiles/common/home/waybar.nix -{ self, config, lib, ... }: -{ - programs.waybar = { + { self, config, lib, ... }: + { + programs.waybar = { - enable = true; - systemd = { enable = true; - target = "sway-sessions.target"; - }; - settings = { - mainBar = { - layer = "top"; - position = "top"; - modules-left = [ "sway/workspaces" "custom/outer-right-arrow-dark" "sway/window" ]; - modules-center = [ "sway/mode" "privacy" "custom/github" "custom/configwarn" "custom/nix-updates" ]; - "sway/mode" = { - format = "{}"; - }; - - modules-right = config.swarselsystems.waybarModules; - - "custom/pseudobat" = lib.mkIf (!config.swarselsystems.isLaptop) { - format = ""; - on-click-right = "wlogout -p layer-shell"; - }; - - "custom/configwarn" = { - exec = "waybarupdate"; - interval = 60; - }; - - "custom/scratchpad-indicator" = { - interval = 3; - exec = "swaymsg -t get_tree | jq 'recurse(.nodes[]) | first(select(.name==\"__i3_scratch\")) | .floating_nodes | length | select(. >= 1)'"; - format = "{} "; - on-click = "swaymsg 'scratchpad show'"; - on-click-right = "swaymsg 'move scratchpad'"; - }; - - "custom/github" = { - format = "{}  "; - return-type = "json"; - interval = 60; - exec = "github-notifications"; - on-click = "xdg-open https://github.com/notifications"; - }; - - # "custom/nix-updates" = { - # exec = "update-checker"; - # on-click = "update-checker && notify-send 'The system has been updated'"; - # interval = "once"; - # tooltip = true; - # return-type = "json"; - # format = "{} {icon}"; - # format-icon = { - # "has-updates" = ""; - # "updated" = " "; - # }; - # }; - - idle_inhibitor = { - format = "{icon}"; - format-icons = { - activated = ""; - deactivated = ""; + systemd = { + enable = true; + target = "sway-sessions.target"; + }; + settings = { + mainBar = { + ipc = true; + id = "bar-0"; + layer = "top"; + position = "top"; + modules-left = [ "sway/workspaces" "custom/outer-right-arrow-dark" "sway/window" ]; + modules-center = [ "sway/mode" "privacy" "custom/github" "custom/configwarn" "custom/nix-updates" ]; + "sway/mode" = { + format = "{}"; }; - }; - "group/hardware" = { - orientation = "inherit"; - drawer = { - "transition-left-to-right" = false; + modules-right = config.swarselsystems.waybarModules; + + "custom/pseudobat" = lib.mkIf (!config.swarselsystems.isLaptop) { + format = ""; + on-click-right = "wlogout -p layer-shell"; }; - modules = [ - "tray" - "temperature" - "power-profiles-daemon" - "custom/left-arrow-light" - "custom/left-arrow-dark" - "custom/scratchpad-indicator" - "custom/left-arrow-light" - "disk" - "custom/left-arrow-dark" - "memory" - "custom/left-arrow-light" - "cpu" - "custom/left-arrow-dark" - "backlight/slider" - "idle_inhibitor" - ]; - }; - "backlight/slider" = { - min = 0; - max = 100; - orientation = "horizontal"; - device = "intel_backlight"; - }; - - power-profiles-daemon = { - format = "{icon}"; - tooltip-format = "Power profile: {profile}\nDriver: {driver}"; - tooltip = true; - format-icons = { - "default" = ""; - "performance" = ""; - "balanced" = ""; - "power-saver" = ""; + "custom/configwarn" = { + exec = "waybarupdate"; + interval = 60; }; - }; - temperature = { - hwmon-path = lib.mkIf (!config.swarselsystems.temperatureHwmon.isAbsolutePath) config.swarselsystems.temperatureHwmon.path; - hwmon-path-abs = lib.mkIf config.swarselsystems.temperatureHwmon.isAbsolutePath config.swarselsystems.temperatureHwmon.path; - input-filename = lib.mkIf config.swarselsystems.temperatureHwmon.isAbsolutePath config.swarselsystems.temperatureHwmon.input-filename; - critical-threshold = 80; - format-critical = " {temperatureC}°C"; - format = " {temperatureC}°C"; - - }; - - mpris = { - format = "{player_icon} {title} [{position}/{length}]"; - format-paused = "{player_icon} {title} [{position}/{length}]"; - player-icons = { - "default" = "▶ "; - "mpv" = "🎵 "; - "spotify" = " "; + "custom/scratchpad-indicator" = { + interval = 3; + exec = "swaymsg -t get_tree | jq 'recurse(.nodes[]) | first(select(.name==\"__i3_scratch\")) | .floating_nodes | length | select(. >= 1)'"; + format = "{} "; + on-click = "swaymsg 'scratchpad show'"; + on-click-right = "swaymsg 'move scratchpad'"; }; - status-icons = { - "paused" = " "; + + "custom/github" = { + format = "{}  "; + return-type = "json"; + interval = 60; + exec = "github-notifications"; + on-click = "xdg-open https://github.com/notifications"; }; - interval = 1; - title-len = 20; - artist-len = 20; - album-len = 10; - }; - "custom/left-arrow-dark" = { - format = ""; - tooltip = false; - }; - "custom/outer-left-arrow-dark" = { - format = ""; - tooltip = false; - }; - "custom/left-arrow-light" = { - format = ""; - tooltip = false; - }; - "custom/right-arrow-dark" = { - format = ""; - tooltip = false; - }; - "custom/outer-right-arrow-dark" = { - format = ""; - tooltip = false; - }; - "custom/right-arrow-light" = { - format = ""; - tooltip = false; - }; - "sway/workspaces" = { - disable-scroll = true; - format = "{name}"; - }; - "clock#1" = { - min-length = 8; - interval = 1; - format = "{:%H:%M:%S}"; - # on-click-right= "gnome-clocks"; - tooltip-format = "{:%Y %B}\n{calendar}"; - }; + # "custom/nix-updates" = { + # exec = "update-checker"; + # on-click = "update-checker && notify-send 'The system has been updated'"; + # interval = "once"; + # tooltip = true; + # return-type = "json"; + # format = "{} {icon}"; + # format-icon = { + # "has-updates" = ""; + # "updated" = " "; + # }; + # }; - "clock#2" = { - format = "{:%d. %B %Y}"; - # on-click-right= "gnome-clocks"; - tooltip-format = "{:%Y %B}\n{calendar}"; - }; + idle_inhibitor = { + format = "{icon}"; + format-icons = { + activated = ""; + deactivated = ""; + }; + }; - pulseaudio = { - format = "{icon} {volume:2}%"; - format-bluetooth = "{icon} {volume}%"; - format-muted = "MUTE"; - format-icons = { - headphones = ""; - default = [ - "" - "" + "group/hardware" = { + orientation = "inherit"; + drawer = { + "transition-left-to-right" = false; + }; + modules = [ + "tray" + "temperature" + "power-profiles-daemon" + "custom/left-arrow-light" + "custom/left-arrow-dark" + "custom/scratchpad-indicator" + "custom/left-arrow-light" + "disk" + "custom/left-arrow-dark" + "memory" + "custom/left-arrow-light" + "cpu" + "custom/left-arrow-dark" + "backlight/slider" + "idle_inhibitor" ]; }; - scroll-step = 1; - on-click = "pamixer -t"; - on-click-right = "pavucontrol"; - }; - memory = { - interval = 5; - format = " {}%"; - tooltip-format = "Memory: {used:0.1f}G/{total:0.1f}G\nSwap: {swapUsed}G/{swapTotal}G"; - }; - cpu = { - format = config.swarselsystems.cpuString; - min-length = 6; - interval = 5; - format-icons = [ "▁" "▂" "▃" "▄" "▅" "▆" "▇" "█" ]; - # on-click-right= "com.github.stsdc.monitor"; - on-click-right = "kitty -o confirm_os_window_close=0 btm"; + "backlight/slider" = { + min = 0; + max = 100; + orientation = "horizontal"; + device = "intel_backlight"; + }; - }; - "custom/vpn" = { - format = "()"; - exec = "echo '{\"class\": \"connected\"}'"; - exec-if = "test -d /proc/sys/net/ipv4/conf/tun0"; - return-type = "json"; - interval = 5; - }; - battery = { - states = { - "warning" = 60; - "error" = 30; - "critical" = 15; + power-profiles-daemon = { + format = "{icon}"; + tooltip-format = "Power profile: {profile}\nDriver: {driver}"; + tooltip = true; + format-icons = { + "default" = ""; + "performance" = ""; + "balanced" = ""; + "power-saver" = ""; + }; }; - interval = 5; - format = "{icon} {capacity}%"; - format-charging = "{capacity}% "; - format-plugged = "{capacity}% "; - format-icons = [ - "" - "" - "" - "" - "" - ]; - on-click-right = "wlogout -p layer-shell"; - }; - disk = { - interval = 30; - format = "Disk {percentage_used:2}%"; - path = "/"; - states = { - "warning" = 80; - "critical" = 90; + + temperature = { + hwmon-path = lib.mkIf (!config.swarselsystems.temperatureHwmon.isAbsolutePath) config.swarselsystems.temperatureHwmon.path; + hwmon-path-abs = lib.mkIf config.swarselsystems.temperatureHwmon.isAbsolutePath config.swarselsystems.temperatureHwmon.path; + input-filename = lib.mkIf config.swarselsystems.temperatureHwmon.isAbsolutePath config.swarselsystems.temperatureHwmon.input-filename; + critical-threshold = 80; + format-critical = " {temperatureC}°C"; + format = " {temperatureC}°C"; + + }; + + mpris = { + format = "{player_icon} {title} [{position}/{length}]"; + format-paused = "{player_icon} {title} [{position}/{length}]"; + player-icons = { + "default" = "▶ "; + "mpv" = "🎵 "; + "spotify" = " "; + }; + status-icons = { + "paused" = " "; + }; + interval = 1; + title-len = 20; + artist-len = 20; + album-len = 10; + }; + "custom/left-arrow-dark" = { + format = ""; + tooltip = false; + }; + "custom/outer-left-arrow-dark" = { + format = ""; + tooltip = false; + }; + "custom/left-arrow-light" = { + format = ""; + tooltip = false; + }; + "custom/right-arrow-dark" = { + format = ""; + tooltip = false; + }; + "custom/outer-right-arrow-dark" = { + format = ""; + tooltip = false; + }; + "custom/right-arrow-light" = { + format = ""; + tooltip = false; + }; + "sway/workspaces" = { + disable-scroll = true; + format = "{name}"; + }; + + "clock#1" = { + min-length = 8; + interval = 1; + format = "{:%H:%M:%S}"; + # on-click-right= "gnome-clocks"; + tooltip-format = "{:%Y %B}\n{calendar}"; + }; + + "clock#2" = { + format = "{:%d. %B %Y}"; + # on-click-right= "gnome-clocks"; + tooltip-format = "{:%Y %B}\n{calendar}"; + }; + + pulseaudio = { + format = "{icon} {volume:2}%"; + format-bluetooth = "{icon} {volume}%"; + format-muted = "MUTE"; + format-icons = { + headphones = ""; + default = [ + "" + "" + ]; + }; + scroll-step = 1; + on-click = "pamixer -t"; + on-click-right = "pavucontrol"; + }; + + memory = { + interval = 5; + format = " {}%"; + tooltip-format = "Memory: {used:0.1f}G/{total:0.1f}G\nSwap: {swapUsed}G/{swapTotal}G"; + }; + cpu = { + format = config.swarselsystems.cpuString; + min-length = 6; + interval = 5; + format-icons = [ "▁" "▂" "▃" "▄" "▅" "▆" "▇" "█" ]; + # on-click-right= "com.github.stsdc.monitor"; + on-click-right = "kitty -o confirm_os_window_close=0 btm"; + + }; + "custom/vpn" = { + format = "()"; + exec = "echo '{\"class\": \"connected\"}'"; + exec-if = "test -d /proc/sys/net/ipv4/conf/tun0"; + return-type = "json"; + interval = 5; + }; + battery = { + states = { + "warning" = 60; + "error" = 30; + "critical" = 15; + }; + interval = 5; + format = "{icon} {capacity}%"; + format-charging = "{capacity}% "; + format-plugged = "{capacity}% "; + format-icons = [ + "" + "" + "" + "" + "" + ]; + on-click-right = "wlogout -p layer-shell"; + }; + disk = { + interval = 30; + format = "Disk {percentage_used:2}%"; + path = "/"; + states = { + "warning" = 80; + "critical" = 90; + }; + tooltip-format = "{used} used out of {total} on {path} ({percentage_used}%)\n{free} free on {path} ({percentage_free}%)"; + }; + tray = { + icon-size = 20; + }; + network = { + interval = 5; + format-wifi = "{signalStrength}% "; + format-ethernet = ""; + format-linked = "{ifname} (No IP) "; + format-disconnected = "Disconnected ⚠"; + format-alt = "{ifname}: {ipaddr}/{cidr}"; + tooltip-format-ethernet = "{ifname} via {gwaddr}: {essid} {ipaddr}/{cidr}\n\n⇡{bandwidthUpBytes} ⇣{bandwidthDownBytes}"; + tooltip-format-wifi = "{ifname} via {gwaddr}: {essid} {ipaddr}/{cidr} \n{signaldBm}dBm @ {frequency}MHz\n\n⇡{bandwidthUpBytes} ⇣{bandwidthDownBytes}"; }; - tooltip-format = "{used} used out of {total} on {path} ({percentage_used}%)\n{free} free on {path} ({percentage_free}%)"; - }; - tray = { - icon-size = 20; - }; - network = { - interval = 5; - format-wifi = "{signalStrength}% "; - format-ethernet = ""; - format-linked = "{ifname} (No IP) "; - format-disconnected = "Disconnected ⚠"; - format-alt = "{ifname}: {ipaddr}/{cidr}"; - tooltip-format-ethernet = "{ifname} via {gwaddr}: {essid} {ipaddr}/{cidr}\n\n⇡{bandwidthUpBytes} ⇣{bandwidthDownBytes}"; - tooltip-format-wifi = "{ifname} via {gwaddr}: {essid} {ipaddr}/{cidr} \n{signaldBm}dBm @ {frequency}MHz\n\n⇡{bandwidthUpBytes} ⇣{bandwidthDownBytes}"; }; }; + style = builtins.readFile (self + /programs/waybar/style.css); }; - style = builtins.readFile (self + /programs/waybar/style.css); - }; -} + } #+end_src **** Firefox @@ -9368,6 +9370,10 @@ The rest of the settings is at [[#h:bbf2ecb6-c8ff-4462-b5d5-d45b28604ddf][work]] libguestfs-with-appliance ]; + home.sessionVariables = { + DOCUMENT_DIR_PRIV = lib.mkForce "${config.home.homeDirectory}/Documents/Private"; + DOCUMENT_DIR_WORK = lib.mkForce "${config.home.homeDirectory}/Documents/Work"; + }; programs = { git.userEmail = "leon.schwarzaeugl@imba.oeaw.ac.at"; diff --git a/profiles/optional/home/work.nix b/profiles/optional/home/work.nix index 5b637e8..8eef134 100644 --- a/profiles/optional/home/work.nix +++ b/profiles/optional/home/work.nix @@ -11,6 +11,10 @@ libguestfs-with-appliance ]; + home.sessionVariables = { + DOCUMENT_DIR_PRIV = lib.mkForce "${config.home.homeDirectory}/Documents/Private"; + DOCUMENT_DIR_WORK = lib.mkForce "${config.home.homeDirectory}/Documents/Work"; + }; programs = { git.userEmail = "leon.schwarzaeugl@imba.oeaw.ac.at"; diff --git a/scripts/waybarupdate.sh b/scripts/waybarupdate.sh index 18149df..02c6103 100644 --- a/scripts/waybarupdate.sh +++ b/scripts/waybarupdate.sh @@ -1,5 +1,5 @@ CFG=$(git --git-dir="$HOME"/.dotfiles/.git --work-tree="$HOME"/.dotfiles/ status -s | wc -l) -CSE=$(git --git-dir="$HOME"/Documents/GitHub/CSE_TUWIEN/.git --work-tree="$HOME"/Documents/GitHub/CSE_TUWIEN/ status -s | wc -l) +CSE=$(git --git-dir="$DOCUMENT_DIR_PRIV"/CSE_TUWIEN/.git --work-tree="$DOCUMENT_DIR_PRIV"/CSE_TUWIEN/ status -s | wc -l) PASS=$(($(git --git-dir="$HOME"/.local/share/password-store/.git --work-tree="$HOME"/.local/share/password-store/ status -s | wc -l) + $(git --git-dir="$HOME"/.local/share/password-store/.git --work-tree="$HOME"/.local/share/password-store/ diff origin/main..HEAD | wc -l))) if [[ $CFG != 0 ]]; then