From 8d71a22569315b56144799b96f7d2dec7cc0f1c9 Mon Sep 17 00:00:00 2001 From: Jack Jamison Date: Fri, 22 May 2026 20:51:22 -0400 Subject: better scripts and sleep toggle --- scripts/system/sysinfo | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) (limited to 'scripts/system/sysinfo') diff --git a/scripts/system/sysinfo b/scripts/system/sysinfo index 5cb2d07..34f23b4 100755 --- a/scripts/system/sysinfo +++ b/scripts/system/sysinfo @@ -17,21 +17,32 @@ get_message() { # Network Info net_device=$(ip a | grep "state UP" | awk -F': ' '{ printf($2) }') - case "${net_device}" in - wlan*) - connected_network=$(iwctl station ${net_device} show | grep 'Connected network' \ - | awk -F' ' '{ printf($3) }') - ;; - eth*) - ;; - esac - echo "${net_device}: ${connected_network}" + if ! [ -z $net_device ]; then + case "${net_device}" in + wlan*) + connected_network=$(iwctl station ${net_device} show | grep 'Connected network' \ + | awk -F' ' '{ printf($3) }') + ;; + eth*) + ;; + esac + echo "${net_device}: ${connected_network}" + else + echo "Network: DOWN" + fi + + echo "" + + # Idle monitor status + pgrep --quiet swayidle && echo "Idle Sleep: Enabled" || echo "Idle Sleep: Disabled" } message=$(get_message) if [ "$TERM" = "linux" ]; then - notify-send "System Info" "$message" + replace_id=$(cat $XDG_RUNTIME_DIR/sysinfoid) + [ ! -z $replace_id ] && replace_arg="-r $replace_id" + notify-send $replace_arg -p "System Info" "$message" > $XDG_RUNTIME_DIR/sysinfoid else echo "$message" fi -- cgit v1.2.3