diff options
| author | Sam Nystrom <sam@samnystrom.dev> | 2023-04-12 15:17:04 -0500 |
|---|---|---|
| committer | Sam Nystrom <sam@samnystrom.dev> | 2023-04-12 15:17:04 -0500 |
| commit | b57135c563247a13d2a8536645cf51b66c419335 (patch) | |
| tree | 531d996f3af969d7fe96e7e082d4e6cc3a896ba8 /bin | |
| parent | 9e2b664fa3c7afbe9cb71c66cb699cd47632835e (diff) | |
fix(bin): kill statusbar after somebar exits
Diffstat (limited to 'bin')
| -rwxr-xr-x | bin/dwl-init.sh | 16 | ||||
| -rwxr-xr-x | bin/dwl.sh | 13 | ||||
| -rwxr-xr-x | bin/status.sh | 11 |
3 files changed, 27 insertions, 13 deletions
diff --git a/bin/dwl-init.sh b/bin/dwl-init.sh new file mode 100755 index 0000000..3afae87 --- /dev/null +++ b/bin/dwl-init.sh @@ -0,0 +1,16 @@ +#!/bin/sh + +set -eu + +WALLPAPER=/home/samn/wallpaper.jpg + +trap 'kill 0' SIGINT + +swaybg -i "$WALLPAPER" & +swayidle -w \ + timeout 300 "swaylock -f -i $WALLPAPER" \ + before-sleep "swaylock -f -i $WALLPAPER" & +status.sh & +somebar + +wait @@ -1,12 +1,7 @@ #!/bin/sh -eu -WALLPAPER=/home/samn/wallpaper.jpg - -dwl -s "\ - swaybg -i "$WALLPAPER" \ - & somebar - & status.sh - & swayidle -w \ - timeout 300 \"swaylock -f -i $WALLPAPER\" \ - before-sleep \"swaylock -f -i $WALLPAPER\"" +export XCURSOR_PATH=/usr/share/icons +export XCURSOR_SIZE=24 +export XCURSOR_THEME=Catppuccin-Macchiato-Dark-Cursors +dbus-run-session -- dwl -s dwl-init.sh diff --git a/bin/status.sh b/bin/status.sh index 7ad178e..24f0f59 100755 --- a/bin/status.sh +++ b/bin/status.sh @@ -14,8 +14,7 @@ pulseaudio() { } network() { - # ssid=$(iwgetid -r) - ssid= + ssid=$(iwgetid -r) if [ -n "$ssid" ]; then symbol="直" else @@ -45,7 +44,11 @@ clock() { echo "<span foreground=\"#7dc4e4\"> $(date '+%b %d %H:%M')</span>" } -while true; do - sleep 0.2 +until [ -e "$XDG_RUNTIME_DIR/somebar-0" ]; do + true +done + +while [ -e "$XDG_RUNTIME_DIR/somebar-0" ]; do somebar -c status "$(pulseaudio) | $(network) | $(brightness) | $(battery) | $(clock)" || true + sleep 0.2 done |
