Added missing exit codes

This commit is contained in:
anntnzrb 2020-12-03 23:50:10 -05:00
parent 25a925f1dc
commit ff9588637c
3 changed files with 4 additions and 4 deletions

View File

@ -3,7 +3,7 @@
# Notify me with notify-send if my battery is below 25%.
# You can set this to run via cron.
[ "$(cat /sys/class/power_supply/BAT0/status)" = "Charging" ] && exit
[ "$(cat /sys/class/power_supply/BAT0/status)" = "Charging" ] && exit 0
[ "$(cat /sys/class/power_supply/BAT0/capacity)" -lt 25 ] &&
export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$(id -u $USER)/bus &&
notify-send -u critical "Battery critically low."

View File

@ -3,11 +3,11 @@
# Set as a cron job to check for new RSS entries for newsboat.
# If newsboat is open, sends it an "R" key to refresh.
ping -q -c 1 example.org > /dev/null || exit
ping -q -c 1 example.org > /dev/null || exit 1
/usr/bin/notify-send "📰 Updating RSS feeds..."
pgrep -f newsboat$ && /usr/bin/xdotool key --window "$(/usr/bin/xdotool search --name newsboat)" R && exit
pgrep -f newsboat$ && /usr/bin/xdotool key --window "$(/usr/bin/xdotool search --name newsboat)" R && exit 0
echo 🔃 > /tmp/newsupdate
pkill -RTMIN+6 "${STATUSBAR:-dwmblocks}"

View File

@ -2,6 +2,6 @@
# entr command to run `queueandnotify` when newsboat queue is changed
[ "$(pgrep -x "$(basename "$0")" | wc -l)" -gt 2 ] && exit
[ "$(pgrep -x "$(basename "$0")" | wc -l)" -gt 2 ] && exit 1
echo "${XDG_DATA_HOME:-$HOME/.local/share}"/newsboat/queue | entr -p queueandnotify 2>/dev/null