summaryrefslogtreecommitdiff
path: root/scripts/sysinfo
diff options
context:
space:
mode:
authorJack Jamison <jackqjamison@gmail.com>2026-01-13 22:15:53 -0500
committerJack Jamison <jackqjamison@gmail.com>2026-01-13 22:15:53 -0500
commit05fb99140b5541c3f3e3648fa1c8170e229118cd (patch)
tree2ff28c4cd8b5ab8a53451bf1df64a49f66687485 /scripts/sysinfo
parent53b5c6f41f9139c67eb347b5f7b9c35477ab6650 (diff)
changes
Diffstat (limited to 'scripts/sysinfo')
-rwxr-xr-xscripts/sysinfo41
1 files changed, 41 insertions, 0 deletions
diff --git a/scripts/sysinfo b/scripts/sysinfo
new file mode 100755
index 0000000..1daf4c7
--- /dev/null
+++ b/scripts/sysinfo
@@ -0,0 +1,41 @@
+#!/bin/sh
+
+batperc=$(cat /sys/class/power_supply/BAT0/capacity)
+batstate=$(cat /sys/class/power_supply/BAT0/status)
+brightness=$(brightnessctl -m | cut -d, -f 4)
+
+network_info() {
+ device=$(ip a | grep "state UP" | awk -F': ' '{ printf($2) }')
+ case "${device}" in
+ wlan*)
+ network=$(iwctl station ${device} show | grep 'Connected network' \
+ | awk -F' ' '{ printf($3) }')
+ echo "${device}: ${network}"
+ ;;
+ eth*)
+ echo "${device}: ${network}"
+ ;;
+ esac
+}
+
+get_volume() {
+ wpctl get-volume @DEFAULT_SINK@ | awk -F' ' '{ printf "%s %s%% %s", $1, ($2 * 100), $3; }'
+}
+
+if [ "$TERM" = "linux" ]; then
+ notify-send \
+ "System Info:" \
+ "\
+Time: $(date "+%I:%M:%S")
+$(get_volume)
+Brightness: ${brightness}
+${batstate}: ${batperc}%
+$(network_info)"
+else
+ echo "\
+Time: $(date "+%I:%M:%S")
+$(get_volume)
+Brightness: ${brightness}%
+${batstate}: ${batperc}%
+$(network_info)"
+fi