commit 15c9255807b029586e8fbde6d4af122f7907571b
parent 24f81bf57287030964fe5877deaa03753708ba1e
Author: awy <awy@awy.one>
Date: Sat, 7 Jun 2025 15:29:54 +0300
fix statusbar freeze when waiting for setsid program to exit
Diffstat:
22 files changed, 37 insertions(+), 37 deletions(-)
diff --git a/.local/bin/statusbar/sb-battery b/.local/bin/statusbar/sb-battery
@@ -13,7 +13,7 @@ case $BLOCK_BUTTON in
- Scroll to change adjust xbacklight." ;;
4) xbacklight -inc 10 ;;
5) xbacklight -dec 10 ;;
- 8) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;;
+ 8) setsid -f "$TERMINAL" -e "$EDITOR" "$0" >/dev/null 2>&1 ;;
esac
# Loop through all attached batteries and format the info
diff --git a/.local/bin/statusbar/sb-brightness b/.local/bin/statusbar/sb-brightness
@@ -16,7 +16,7 @@ case $BLOCK_BUTTON in
notify-send "π‘ Brightness module" "\- Shows current brightness level βοΈ."
;;
8)
- setsid -f "$TERMINAL" -e "$EDITOR" "$0"
+ setsid -f "$TERMINAL" -e "$EDITOR" "$0" >/dev/null 2>&1
;;
esac
diff --git a/.local/bin/statusbar/sb-clock b/.local/bin/statusbar/sb-clock
@@ -20,10 +20,10 @@ esac
case $BLOCK_BUTTON in
1) notify-send "This Month" "$(cal | sed "s/\<$(date +'%e'|tr -d ' ')\>/<b><span color='red'>&<\/span><\/b>/")" && notify-send "Appointments" "$(calcurse -d3)" ;;
- 2) setsid -f "$TERMINAL" -e calcurse ;;
+ 2) setsid -f "$TERMINAL" -e calcurse >/dev/null 2>&1 ;;
3) notify-send "π
Time/date module" "\- Left click to show upcoming appointments for the next three days via \`calcurse -d3\` and show the month via \`cal\`
- Middle click opens calcurse if installed" ;;
- 8) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;;
+ 8) setsid -f "$TERMINAL" -e "$EDITOR" "$0" >/dev/null 2>&1 ;;
esac
date "+%Y %b %d (%a) $icon%H:%M"
diff --git a/.local/bin/statusbar/sb-cpu b/.local/bin/statusbar/sb-cpu
@@ -2,11 +2,11 @@
case $BLOCK_BUTTON in
1) notify-send "π₯ CPU hogs" "$(ps axch -o cmd:15,%cpu --sort=-%cpu | head)\\n(100% per core)" ;;
- 2) setsid -f "$TERMINAL" -e htop ;;
+ 2) setsid -f "$TERMINAL" -e htop >/dev/null 2>&1 ;;
3) notify-send "π₯ CPU module " "\- Shows CPU temperature.
- Click to show intensive processes.
- Middle click to open htop." ;;
- 8) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;;
+ 8) setsid -f "$TERMINAL" -e "$EDITOR" "$0" >/dev/null 2>&1 ;;
esac
sensors | awk '/Core 0/ {print "π‘" $3}'
diff --git a/.local/bin/statusbar/sb-cpubars b/.local/bin/statusbar/sb-cpubars
@@ -9,10 +9,10 @@
cache=/tmp/cpubarscache
case $BLOCK_BUTTON in
- 2) setsid -f "$TERMINAL" -e htop ;;
+ 2) setsid -f "$TERMINAL" -e htop >/dev/null 2>&1 ;;
3) notify-send "πͺ¨ CPU load module" "Each bar represents
one CPU core";;
- 8) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;;
+ 8) setsid -f "$TERMINAL" -e "$EDITOR" "$0" >/dev/null 2>&1 ;;
esac
# id total idle
diff --git a/.local/bin/statusbar/sb-disk b/.local/bin/statusbar/sb-disk
@@ -11,7 +11,7 @@ case $BLOCK_BUTTON in
1) notify-send "π½ Disk space" "$(df -h --output=target,used,size)" ;;
3) notify-send "π½ Disk module" "\- Shows used hard drive space.
- Click to show all disk info." ;;
- 8) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;;
+ 8) setsid -f "$TERMINAL" -e "$EDITOR" "$0" >/dev/null 2>&1 ;;
esac
case "$location" in
diff --git a/.local/bin/statusbar/sb-doppler b/.local/bin/statusbar/sb-doppler
@@ -272,9 +272,9 @@ case $BLOCK_BUTTON in
showdoppler ;;
2) pickloc && getdoppler && showdoppler ;;
3) notify-send "πΊοΈ Doppler RADAR module" "\- Left click for local Doppler RADAR.
- - Middle click to update RADAR location.
- After $secs seconds, new clicks will also automatically update the doppler RADAR." ;;
- 8) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;;
+- Middle click to update RADAR location.
+After $secs seconds, new clicks will also automatically update the doppler RADAR." ;;
+ 8) setsid -f "$TERMINAL" -e "$EDITOR" "$0" >/dev/null 2>&1 ;;
esac
echo π
diff --git a/.local/bin/statusbar/sb-forecast b/.local/bin/statusbar/sb-forecast
@@ -41,14 +41,14 @@ showweather() {
}
case $BLOCK_BUTTON in
- 1) setsid -f "$TERMINAL" -e less -Sf "$weatherreport" ;;
+ 1) setsid -f "$TERMINAL" -e less -Sf "$weatherreport" >/dev/null 2>&1 ;;
2) getforecast && showweather ;;
3) notify-send "π Weather module" "\- Left click for full forecast.
- Middle click to update forecast.
β: Chance of rain/snow
π₯Ά: Daily low
π: Daily high" ;;
- 8) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;;
+ 8) setsid -f "$TERMINAL" -e "$EDITOR" "$0" >/dev/null 2>&1 ;;
esac
# shellcheck disable=SC2015
diff --git a/.local/bin/statusbar/sb-internet b/.local/bin/statusbar/sb-internet
@@ -5,7 +5,7 @@
# Show π if a vpn connection is active
case $BLOCK_BUTTON in
- 1) "$TERMINAL" -e nmtui; pkill -RTMIN+4 i3blocks ;;
+ 1) setsid -f "$TERMINAL" -e nmtui >/dev/null 2>&1 ; pkill -RTMIN+4 i3blocks ;;
3) notify-send "π Internet module" "\- Click to connect
β: wifi disabled
π‘: no wifi connection
@@ -14,7 +14,7 @@ case $BLOCK_BUTTON in
π: ethernet working
π: vpn is active
" ;;
- 8) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;;
+ 8) setsid -f "$TERMINAL" -e "$EDITOR" "$0" >/dev/null 2>&1 ;;
esac
# Wifi
diff --git a/.local/bin/statusbar/sb-kbselect b/.local/bin/statusbar/sb-kbselect
@@ -11,7 +11,7 @@ case $BLOCK_BUTTON in
pkill -RTMIN+30 "${STATUSBAR:-i3blocks}";;
3) notify-send "β¨ Keyboard/language module" "$(printf "%s" "\- Current layout: $(setxkbmap -query | grep -oP 'layout:\s*\K\w+')")
- Left click to change keyboard.";;
- 8) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;;
+ 8) setsid -f "$TERMINAL" -e "$EDITOR" "$0" >/dev/null 2>&1 ;;
esac
echo "$kb"
diff --git a/.local/bin/statusbar/sb-mailbox b/.local/bin/statusbar/sb-mailbox
@@ -4,13 +4,13 @@
# When clicked, brings up `neomutt`.
case $BLOCK_BUTTON in
- 1) setsid -w -f "$TERMINAL" -e neomutt; pkill -RTMIN+12 "${STATUSBAR:-i3blocks}" ;;
+ 1) setsid -w -f "$TERMINAL" -e neomutt ; pkill -RTMIN+12 "${STATUSBAR:-i3blocks}" ;;
2) setsid -f mailsync ;;
3) notify-send "π¬ Mail module" "\- Shows unread mail
- Shows π if syncing mail
- Left click opens neomutt
- Middle click syncs mail" ;;
- 8) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;;
+ 8) setsid -f "$TERMINAL" -e "$EDITOR" "$0" >/dev/null 2>&1 ;;
esac
unread="$(find "${XDG_DATA_HOME:-$HOME/.local/share}"/mail/*/[Ii][Nn][Bb][Oo][Xx]/new/* -type f | wc -l 2>/dev/null)"
diff --git a/.local/bin/statusbar/sb-memory b/.local/bin/statusbar/sb-memory
@@ -2,11 +2,11 @@
case $BLOCK_BUTTON in
1) notify-send "π§ Memory hogs" "$(ps axch -o cmd:15,%mem --sort=-%mem | head)" ;;
- 2) setsid -f "$TERMINAL" -e htop ;;
+ 2) setsid -f "$TERMINAL" -e htop >/dev/null 2>&1 ;;
3) notify-send "π§ Memory module" "\- Shows Memory Used/Total.
- Click to show memory hogs.
- Middle click to open htop." ;;
- 8) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;;
+ 8) setsid -f "$TERMINAL" -e "$EDITOR" "$0" >/dev/null 2>&1 ;;
esac
free --mebi | sed -n '2{p;q}' | awk '{printf ("π§ %sMB\n", ($3))}'
diff --git a/.local/bin/statusbar/sb-microphone b/.local/bin/statusbar/sb-microphone
@@ -10,7 +10,7 @@ case $BLOCK_BUTTON in
3) notify-send "π€ Microphone volume module" "\- Shows volume ποΈ, ο± if muted.
- Middle click to mute.
- Scroll to change." ;;
- 8) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;;
+ 8) setsid -f "$TERMINAL" -e "$EDITOR" "$0" >/dev/null 2>&1 ;;
esac
vol="$(wpctl get-volume @DEFAULT_AUDIO_SOURCE@)"
diff --git a/.local/bin/statusbar/sb-moonphase b/.local/bin/statusbar/sb-moonphase
@@ -33,5 +33,5 @@ case $BLOCK_BUTTON in
- π: Waning Gibbous
- π: Last Quarter
- π: Waning Crescent" ;;
- 8) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;;
+ 8) setsid -f "$TERMINAL" -e "$EDITOR" "$0" >/dev/null 2>&1 ;;
esac
diff --git a/.local/bin/statusbar/sb-music b/.local/bin/statusbar/sb-music
@@ -5,7 +5,7 @@ filter() { sed "/^volume:/d;s/\\[paused\\].*/βΈ/g;/\\[playing\\].*/d;/^ERROR/Q"
pidof -x sb-mpdup >/dev/null 2>&1 || sb-mpdup >/dev/null 2>&1 &
case $BLOCK_BUTTON in
- 1) mpc status | filter ; setsid -f "$TERMINAL" -e rmpc;; # right click, pause/unpause
+ 1) mpc status | filter ; setsid -f "$TERMINAL" -e rmpc >/dev/null 2>&1 < /dev/null;; # right click, pause/unpause
2) mpc toggle | filter ;; # right click, pause/unpause
3) mpc status | filter ; notify-send "π΅ Music module" "\- Shows mpd song playing.
- βΈ when paused.
@@ -14,6 +14,6 @@ case $BLOCK_BUTTON in
- Scroll changes track.";; # right click, pause/unpause
4) mpc prev | filter ;; # scroll up, previous
5) mpc next | filter ;; # scroll down, next
- 8) mpc status | filter ; setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;;
+ 8) mpc status | filter ; setsid -f "$TERMINAL" -e "$EDITOR" "$0" >/dev/null 2>&1 < /dev/null ;;
*) mpc status | filter ;;
esac
diff --git a/.local/bin/statusbar/sb-nettraf b/.local/bin/statusbar/sb-nettraf
@@ -7,7 +7,7 @@
case $BLOCK_BUTTON in
3) notify-send "π Network traffic module" "π»: Traffic received
πΊ: Traffic transmitted" ;;
- 8) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;;
+ 8) setsid -f "$TERMINAL" -e "$EDITOR" "$0" >/dev/null 2>&1 ;;
esac
update() {
diff --git a/.local/bin/statusbar/sb-news b/.local/bin/statusbar/sb-news
@@ -4,14 +4,14 @@
# When clicked, brings up `newsboat`.
case $BLOCK_BUTTON in
- 1) setsid "$TERMINAL" -e newsboat ;;
+ 1) setsid "$TERMINAL" -e newsboat >/dev/null 2>&1 ;;
2) setsid -f newsup >/dev/null && exit ;;
3) notify-send "π° News module" "\- Shows unread news items
- Shows π if updating with \`newsup\`
- Left click opens newsboat
- Middle click syncs RSS feeds
<b>Note:</b> Only one instance of newsboat (including updates) may be running at a time." ;;
- 8) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;;
+ 8) setsid -f "$TERMINAL" -e "$EDITOR" "$0" >/dev/null 2>&1 ;;
esac
cat /tmp/newsupdate 2>/dev/null || echo "$(newsboat -x print-unread | awk '{ if($1>0) print "π°" $1}')$(cat "${XDG_CONFIG_HOME:-$HOME/.config}"/newsboat/.update 2>/dev/null)"
diff --git a/.local/bin/statusbar/sb-pacpackages b/.local/bin/statusbar/sb-pacpackages
@@ -18,12 +18,12 @@
# Exec = /usr/bin/pkill -RTMIN+8 dwmblocks # Or i3blocks if using i3.
case $BLOCK_BUTTON in
- 1) setsid -f "$TERMINAL" -e sb-popupgrade ;;
+ 1) setsid -f "$TERMINAL" -e sb-popupgrade >/dev/null 2>&1 ;;
2) notify-send "$(/usr/bin/pacman -Qu)" ;;
3) notify-send "π Upgrade module" "π¦: number of upgradable packages
- Left click to upgrade packages
- Middle click to show upgradable packages" ;;
- 8) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;;
+ 8) setsid -f "$TERMINAL" -e "$EDITOR" "$0" >/dev/null 2>&1 ;;
esac
pacman -Qu | grep -Fcv "[ignored]" | sed "s/^/π¦/;s/^π¦0$//g"
diff --git a/.local/bin/statusbar/sb-price b/.local/bin/statusbar/sb-price
@@ -37,7 +37,7 @@ updateprice() { curl -sf \
updateme="1"
case $BLOCK_BUTTON in
- 1) setsid "$TERMINAL" -e less -Srf "$chartfile" ;;
+ 1) setsid "$TERMINAL" -e less -Srf "$chartfile" >/dev/null 2>&1 ;;
2) notify-send -u low "$icon Updating..." "Updating $name price..." ; updateme="1" ; showupdate="1" ;;
3) uptime="$(date -d "$filestat" '+%D at %T' | sed "s|$(date '+%D')|Today|")"
notify-send "$icon $name module" "\- <b>Exact price: \$$(cat "$pricefile")</b>
@@ -46,7 +46,7 @@ case $BLOCK_BUTTON in
- Shows π if updating prices.
- <b>Last updated:
$uptime</b>" ;;
- 8) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;;
+ 8) setsid -f "$TERMINAL" -e "$EDITOR" "$0" >/dev/null 2>&1 ;;
esac
[ -n "$updateme" ] &&
diff --git a/.local/bin/statusbar/sb-tasks b/.local/bin/statusbar/sb-tasks
@@ -10,10 +10,10 @@ num=$(tsp -l | awk -v numr=0 -v numq=0 '{if (/running/)numr++; if (/queued/)numq
# Handle mouse clicks
case $BLOCK_BUTTON in
- 1) setsid -f "$TERMINAL" -e tsp -l ;;
+ 1) setsid -f "$TERMINAL" -e tsp -l >/dev/null 2>&1 ;;
3) notify-send "Tasks module" "π€: number of running/queued background tasks
- Left click opens tsp" ;; # Right click
- 8) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;;
+ 8) setsid -f "$TERMINAL" -e "$EDITOR" "$0" >/dev/null 2>&1 ;;
esac
[ "$num" != "0(0)" ] &&
diff --git a/.local/bin/statusbar/sb-torrent b/.local/bin/statusbar/sb-torrent
@@ -11,7 +11,7 @@ s/.*%.*/M β¬οΈ/" |
sort -h | uniq -c | awk '{print $3 $1}' | paste -sd ' ' -
case $BLOCK_BUTTON in
- 1) setsid -f "$TERMINAL" -e stig ;;
+ 1) setsid -f "$TERMINAL" -e stig >/dev/null 2>&1 ;;
2) td-toggle ;;
3) notify-send "π± Torrent module" "\- Left click to open stig.
- Middle click to toggle transmission.
@@ -23,5 +23,5 @@ Module shows number of torrents:
π½: downloading
β
: done
π±: done and seeding" ;;
- 8) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;;
+ 8) setsid -f "$TERMINAL" -e "$EDITOR" "$0" >/dev/null 2>&1 ;;
esac
diff --git a/.local/bin/statusbar/sb-volume b/.local/bin/statusbar/sb-volume
@@ -10,7 +10,7 @@ case $BLOCK_BUTTON in
3) notify-send "π’ Volume module" "\- Shows volume π, π if muted.
- Middle click to mute.
- Scroll to change." ;;
- 8) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;;
+ 8) setsid -f "$TERMINAL" -e "$EDITOR" "$0" >/dev/null 2>&1 ;;
esac
vol="$(wpctl get-volume @DEFAULT_AUDIO_SINK@)"