use STATUSBAR variable safely

This commit is contained in:
Luke Smith 2019-11-24 08:10:31 -05:00
parent 499e222fd7
commit 3a91dc30f2
No known key found for this signature in database
GPG key ID: 4C50B54A911F6252
8 changed files with 10 additions and 10 deletions

View file

@ -8,7 +8,7 @@ notify-send "📦 Repository Sync" "Checking for package updates..."
sudo pacman -Syyuw --noconfirm || notify-send "Error downloading updates.
Check your internet connection, if pacman is already running, or run update manually to see errors."
pkill -RTMIN+8 i3blocks
pkill -RTMIN+8 "${STATUSBAR:?}"
if pacman -Qu | grep -v "\[ignored\]"
then

View file

@ -9,8 +9,8 @@ ping -q -c 1 1.1.1.1 > /dev/null || exit
pgrep -x newsboat >/dev/null && /usr/bin/xdotool key --window "$(/usr/bin/xdotool search --name newsboat)" R && exit
echo 🔃 > /tmp/newsupdate
pkill -RTMIN+6 i3blocks
pkill -RTMIN+6 "${STATUSBAR:?}"
/usr/bin/newsboat -x reload
rm -f /tmp/newsupdate
pkill -RTMIN+6 i3blocks
pkill -RTMIN+6 "${STATUSBAR:?}"
/usr/bin/notify-send "📰 RSS feed update complete."

View file

@ -11,7 +11,7 @@
updateicon() { \
echo "$1" > /tmp/recordingicon
pkill -RTMIN+9 i3blocks
pkill -RTMIN+9 "${STATUSBAR:?}"
}
killrecording() {
@ -20,7 +20,7 @@ killrecording() {
kill -15 "$recpid"
rm -f /tmp/recordingpid
updateicon ""
pkill -RTMIN+9 i3blocks
pkill -RTMIN+9 "${STATUSBAR:?}"
# even after SIGTERM, ffmpeg may still run, so SIGKILL it.
sleep 3
kill -9 "$recpid"

View file

@ -3,5 +3,5 @@
# This loop will update the mpd statusbar module whenever a command changes the
# music player's status. mpd must be running on X's start for this to work.
while : ; do
mpc idle >/dev/null && pkill -RTMIN+11 dwmblocks || break
mpc idle >/dev/null && pkill -RTMIN+11 "${STATUSBAR:?}" || break
done

View file

@ -3,7 +3,7 @@
printf "Beginning upgrade.\\n"
yay -Syu
pkill -RTMIN+8 i3blocks
pkill -RTMIN+8 "${STATUSBAR:?}"
printf "\\nUpgrade complete.\\nPress <Enter> to exit window.\\n\\n"
read -r

View file

@ -7,4 +7,4 @@ else
ifinstalled transmission-cli || exit
[ "$(printf "No\\nYes" | dmenu -i -p "Start transmission daemon?")" = "Yes" ] && transmission-daemon && notify-send "tranmission-daemon started."
fi
sleep 3 && pkill -RTMIN+7 i3blocks
sleep 3 && pkill -RTMIN+7 "${STATUSBAR:?}"

View file

@ -1,6 +1,6 @@
#!/usr/bin/env sh
ifinstalled transmission-remote-cli transmission-cli || exit
! pgrep -x transmission-da >/dev/null && transmission-daemon && notify-send "Starting torrent daemon..." && sleep 3 && pkill -RTMIN+7 i3blocks
! pgrep -x transmission-da >/dev/null && transmission-daemon && notify-send "Starting torrent daemon..." && sleep 3 && pkill -RTMIN+7 "${STATUSBAR:?}"
$TERMINAL -e transmission-remote-cli

View file

@ -4,6 +4,6 @@
# transmission-daemon sometimes fails to take remote requests in its first moments.
pgrep -x transmission-da || (transmission-daemon && notify-send "Starting transmission daemon..." && sleep 3 && pkill -RTMIN+7 i3blocks)
pgrep -x transmission-da || (transmission-daemon && notify-send "Starting transmission daemon..." && sleep 3 && pkill -RTMIN+7 "${STATUSBAR:?}")
transmission-remote -a "$@" && notify-send "🔽 Torrent added."