aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xnotify2
-rwxr-xr-xstatus-alpine41
-rwxr-xr-xstatus-linux8
3 files changed, 5 insertions, 46 deletions
diff --git a/notify b/notify
index 48b7eee..38e1793 100755
--- a/notify
+++ b/notify
@@ -17,7 +17,7 @@ usage() {
17touch "$file" 17touch "$file"
18case "$1" in 18case "$1" in
19 push) 19 push)
20 echo "(Notified $date) $2" >> "$file" 20 echo "[$date $2]" >> "$file"
21 $update 21 $update
22 ;; 22 ;;
23 clean) 23 clean)
diff --git a/status-alpine b/status-alpine
deleted file mode 100755
index fcc4c28..0000000
--- a/status-alpine
+++ /dev/null
@@ -1,41 +0,0 @@
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="Volume: $(pulsemixer --get-volume | awk '{print $1}')%"
20fi
21
22bat="/sys/class/power_supply/BAT0"
23if [ -d $bat ]; then
24 battery="Battery: $(cat $bat/capacity)% $(cat $bat/status)"
25else
26 battery="No battery"
27fi
28
29# NetworkManager has a dreadful command line interface
30# It makes cry every time
31# pls help
32nwline="$(nmcli device status | head -n 2 | tail -n 1)"
33nwclean="$(echo "$nwline" | sed 's/ *$//' | sed 's/.* //')"
34network="Network: $nwclean"
35
36noticount=$(notify show | wc -l)
37
38printf '%s' "$network$sep$volume$sep$battery$sep$date$sep$time"
39[ "$noticount" = "1" ] && printf '%s' "$sep$(notify show)"
40[ "$noticount" -gt "1" ] && printf '%s' "${sep}Unread items: $noticount"
41printf '\n'
diff --git a/status-linux b/status-linux
index 8d507c5..d881228 100755
--- a/status-linux
+++ b/status-linux
@@ -11,10 +11,10 @@
11sep=${1:-" | "} 11sep=${1:-" | "}
12 12
13time=$(date +"%H:%M") 13time=$(date +"%H:%M")
14date=$(date +"%d %B %Y, %A") 14date=$(date +"%a %d %b")
15 15
16if [ "$(pulsemixer --get-mute)" -eq 1 ]; then 16if [ "$(pulsemixer --get-mute)" -eq 1 ]; then
17 volume="Audio muted" 17 volume="Muted"
18else 18else
19 volume="Vol: $(pulsemixer --get-volume | awk '{print $1}')%" 19 volume="Vol: $(pulsemixer --get-volume | awk '{print $1}')%"
20fi 20fi
@@ -35,11 +35,11 @@ fi
35#network="Network: $nwclean" 35#network="Network: $nwclean"
36 36
37# Thank you iwctl for saving us from this dreadful existence 37# Thank you iwctl for saving us from this dreadful existence
38network="WiFi: $(iwctl station wlan0 show | grep 'Connected network' | awk '{print $3}')" 38network="$(iwctl station wlan0 show | grep 'Connected network' | awk '{print $3}')"
39 39
40noticount=$(notify show | wc -l) 40noticount=$(notify show | wc -l)
41 41
42printf '%s' "$network$sep$volume$sep$battery$sep$date$sep$time" 42printf '%s' "$network$sep$volume$sep$battery$sep$date$sep$time"
43[ "$noticount" = "1" ] && printf '%s' "$sep$(notify show)" 43[ "$noticount" = "1" ] && printf '%s' "$sep$(notify show)"
44[ "$noticount" -gt "1" ] && printf '%s' "${sep}Unread items: $noticount" 44[ "$noticount" -gt "1" ] && printf '%s' "${sep} [$noticount]"
45printf '\n' 45printf '\n'

Generated with cgit - Back to sebastiano.tronto.net