diff options
Diffstat (limited to 'scripts/system/sysinfo')
| -rwxr-xr-x | scripts/system/sysinfo | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/scripts/system/sysinfo b/scripts/system/sysinfo new file mode 100755 index 0000000..5cb2d07 --- /dev/null +++ b/scripts/system/sysinfo @@ -0,0 +1,37 @@ +#!/bin/sh + +get_message() { + + # Date + echo "Date: $(date +"%a %b %d")" + echo "Time: $(date +"%I:%M:%S")" + + # Volume + echo "$(wpctl get-volume @DEFAULT_SINK@ | awk -F' ' '{ printf "%s %s%% %s", $1, ($2 * 100), $3; }')" + + # Brightness + echo "Brightness: $(brightnessctl -m | cut -d, -f 4)" + + # Battery + echo "$(cat /sys/class/power_supply/BAT0/status): $(cat /sys/class/power_supply/BAT0/capacity)%" + + # 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}" +} + +message=$(get_message) + +if [ "$TERM" = "linux" ]; then + notify-send "System Info" "$message" +else + echo "$message" +fi |
