aboutsummaryrefslogtreecommitdiff
path: root/status
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2025-08-15 17:46:28 +0200
committerSebastiano Tronto <sebastiano@tronto.net>2025-08-15 17:46:28 +0200
commitacc08eb7aa16d39a598a8bf8631deda1e79ff477 (patch)
tree767300e3a8b6a23913946166ae97cd925c7ec569 /status
parent424f6dabb0838f07d7c2ec8a738e5bc6264bf725 (diff)
downloadscripts-acc08eb7aa16d39a598a8bf8631deda1e79ff477.tar.gz
scripts-acc08eb7aa16d39a598a8bf8631deda1e79ff477.zip
Some changes for new system config
Diffstat (limited to '')
-rwxr-xr-xstatus2
-rwxr-xr-xstatus-alpine (renamed from status-void)0
-rwxr-xr-xstatus-linux45
3 files changed, 46 insertions, 1 deletions
diff --git a/status b/status
index 44935cd..66811b0 100755
--- a/status
+++ b/status
@@ -8,6 +8,6 @@ OpenBSD)
8 status-openbsd 8 status-openbsd
9 ;; 9 ;;
10*) 10*)
11 status-void 11 status-linux
12 ;; 12 ;;
13esac 13esac
diff --git a/status-void b/status-alpine
index fcc4c28..fcc4c28 100755
--- a/status-void
+++ b/status-alpine
diff --git a/status-linux b/status-linux
new file mode 100755
index 0000000..8d507c5
--- /dev/null
+++ b/status-linux
@@ -0,0 +1,45 @@
1#!/bin/sh
2
3# Prints some status info to stdout. Includes:
4# - date and time
5# - battery
6# - wifi (requires nmcli)
7# - past notifications (requires notify)
8
9# Usage: status [separator]
10
11sep=${1:-" | "}
12
13time=$(date +"%H:%M")
14date=$(date +"%d %B %Y, %A")
15
16if [ "$(pulsemixer --get-mute)" -eq 1 ]; then
17 volume="Audio muted"
18else
19 volume="Vol: $(pulsemixer --get-volume | awk '{print $1}')%"
20fi
21
22bat="/sys/class/power_supply/BAT0"
23if [ -d $bat ]; then
24 charge_status="$(cat $bat/status | awk '{print substr ($0, 0, 2)}')"
25 battery="Bat: $(cat $bat/capacity)% $charge_status"
26else
27 battery="No battery"
28fi
29
30# NetworkManager has a dreadful command line interface
31# It makes cry every time
32# pls help
33#nwline="$(nmcli device status | head -n 2 | tail -n 1)"
34#nwclean="$(echo "$nwline" | sed 's/ *$//' | sed 's/.* //')"
35#network="Network: $nwclean"
36
37# Thank you iwctl for saving us from this dreadful existence
38network="WiFi: $(iwctl station wlan0 show | grep 'Connected network' | awk '{print $3}')"
39
40noticount=$(notify show | wc -l)
41
42printf '%s' "$network$sep$volume$sep$battery$sep$date$sep$time"
43[ "$noticount" = "1" ] && printf '%s' "$sep$(notify show)"
44[ "$noticount" -gt "1" ] && printf '%s' "${sep}Unread items: $noticount"
45printf '\n'

Generated with cgit - Back to sebastiano.tronto.net