aboutsummaryrefslogtreecommitdiff
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
parent424f6dabb0838f07d7c2ec8a738e5bc6264bf725 (diff)
downloadscripts-acc08eb7aa16d39a598a8bf8631deda1e79ff477.tar.gz
scripts-acc08eb7aa16d39a598a8bf8631deda1e79ff477.zip
Some changes for new system config
Diffstat (limited to '')
-rw-r--r--Makefile2
-rwxr-xr-xdmenu-dwm-sessionmanager12
-rwxr-xr-xstatus2
-rwxr-xr-xstatus-alpine (renamed from status-void)0
-rwxr-xr-xstatus-linux45
5 files changed, 54 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index 294d055..dabf0e3 100644
--- a/Makefile
+++ b/Makefile
@@ -32,8 +32,8 @@ SCRIPTS = 2fa \
32 share \ 32 share \
33 spawn \ 33 spawn \
34 status \ 34 status \
35 status-linux \
35 status-openbsd \ 36 status-openbsd \
36 status-void \
37 templess \ 37 templess \
38 terminal \ 38 terminal \
39 trash \ 39 trash \
diff --git a/dmenu-dwm-sessionmanager b/dmenu-dwm-sessionmanager
index dafe853..03343a0 100755
--- a/dmenu-dwm-sessionmanager
+++ b/dmenu-dwm-sessionmanager
@@ -5,6 +5,13 @@
5 5
6# Usage: dmenu-dwm-sessionmanager [-m menu] 6# Usage: dmenu-dwm-sessionmanager [-m menu]
7 7
8#sudo=sudo
9sudo=doas
10wmname="dwm"
11shutdown_cmd="$sudo poweroff"
12reboot_cmd="$sudo reboot"
13closewm_cmd="pkill $wmname"
14
8menu="dmenu -i" 15menu="dmenu -i"
9prompt="Do you want to quit?" 16prompt="Do you want to quit?"
10 17
@@ -25,11 +32,6 @@ while getopts "m:" opt; do
25done 32done
26shift $((OPTIND - 1)) 33shift $((OPTIND - 1))
27 34
28wmname="dwm"
29shutdown_cmd="sudo shutdown -h now"
30reboot_cmd="sudo reboot"
31closewm_cmd="pkill $wmname"
32
33value=$(printf 'Shutdown\nReboot\nQuit dwm\n' | $menu -p "$prompt") 35value=$(printf 'Shutdown\nReboot\nQuit dwm\n' | $menu -p "$prompt")
34 36
35if [ "$value" = "Shutdown" ]; then 37if [ "$value" = "Shutdown" ]; then
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