summaryrefslogtreecommitdiff
path: root/scripts/system/sysinfo
diff options
context:
space:
mode:
authorJack Jamison <jackqjamison@gmail.com>2026-05-22 20:51:22 -0400
committerJack Jamison <jackqjamison@gmail.com>2026-05-22 20:51:22 -0400
commit8d71a22569315b56144799b96f7d2dec7cc0f1c9 (patch)
tree102e0575499c9e4c825af4463da9a129189b6e1d /scripts/system/sysinfo
parent825e81343502ae9ad15a70c7f52634617d865b6d (diff)
better scripts and sleep toggle
Diffstat (limited to 'scripts/system/sysinfo')
-rwxr-xr-xscripts/system/sysinfo31
1 files changed, 21 insertions, 10 deletions
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