File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed
Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ show_help() {
3030 notification with given ID
3131 history-rm ID Remove the notification from
3232 history with given ID.
33- is-paused Check if pause level is greater than 0
33+ is-paused [-e] Check if pause level is greater than 0, optionally with exit code instead of text output
3434 set-paused true|false|toggle Set the pause status
3535 get-pause-level Get the current pause level
3636 set-pause-level level Set the pause level
@@ -117,7 +117,20 @@ case "${1:-}" in
117117 fi
118118 ;;
119119 " is-paused" )
120- property_get paused | ( read -r _ _ paused; printf " %s\n" " ${paused} " ; )
120+ exit=false
121+ if [ " ${2:- } " = " -e" ]; then
122+ exit=true
123+ fi
124+ property_get paused | {
125+ read -r _ _ paused
126+ if [ " $exit " = " false" ]; then
127+ printf " %s\n" " ${paused} "
128+ else
129+ if [ " ${paused} " = " false" ]; then
130+ exit 1
131+ fi
132+ fi
133+ }
121134 ;;
122135 " set-paused" )
123136 [ " ${2:- } " ] \
You can’t perform that action at this time.
0 commit comments