Fix indentation and use tabs for indents
This commit is contained in:
parent
b8aa8c15e8
commit
2e301b1d39
42
dunstctl
42
dunstctl
@ -45,11 +45,11 @@ property_set() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
invert_boolean() {
|
invert_boolean() {
|
||||||
if [ "${1}" = "true" ]; then
|
if [ "${1}" = "true" ]; then
|
||||||
printf "%s\n" "false"
|
printf "%s\n" "false"
|
||||||
elif [ "${1}" = "false" ]; then
|
elif [ "${1}" = "false" ]; then
|
||||||
printf "%s\n" "true"
|
printf "%s\n" "true"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
command -v dbus-send >/dev/null 2>/dev/null || \
|
command -v dbus-send >/dev/null 2>/dev/null || \
|
||||||
@ -73,28 +73,28 @@ case "${1:-}" in
|
|||||||
method_call "${DBUS_IFAC_DUNST}.NotificationShow" >/dev/null
|
method_call "${DBUS_IFAC_DUNST}.NotificationShow" >/dev/null
|
||||||
;;
|
;;
|
||||||
"is-paused")
|
"is-paused")
|
||||||
running=$(property_get running | ( read -r _ _ running; printf "%s\n" "${running}"; ))
|
running=$(property_get running | ( read -r _ _ running; printf "%s\n" "${running}"; ))
|
||||||
# invert boolean to indiciate pause status rather than running one
|
# invert boolean to indiciate pause status rather than running one
|
||||||
paused=$(invert_boolean "${running}")
|
paused=$(invert_boolean "${running}")
|
||||||
printf "%s\n" "${paused}"
|
printf "%s\n" "${paused}"
|
||||||
;;
|
;;
|
||||||
"set-paused")
|
"set-paused")
|
||||||
[ "${2:-}" ] \
|
[ "${2:-}" ] \
|
||||||
|| die "No status parameter specified. Please give either 'true', 'false' or 'toggle' as paused parameter."
|
|| die "No status parameter specified. Please give either 'true', 'false' or 'toggle' as paused parameter."
|
||||||
[ "${2}" = "true" ] || [ "${2}" = "false" ] || [ "${2}" = "toggle" ] \
|
[ "${2}" = "true" ] || [ "${2}" = "false" ] || [ "${2}" = "toggle" ] \
|
||||||
|| die "Please give either 'true', 'false' or 'toggle' as paused parameter."
|
|| die "Please give either 'true', 'false' or 'toggle' as paused parameter."
|
||||||
if [ "${2}" = "toggle" ]; then
|
if [ "${2}" = "toggle" ]; then
|
||||||
running=$(property_get running | ( read -r _ _ running; printf "%s\n" "${running}"; ))
|
running=$(property_get running | ( read -r _ _ running; printf "%s\n" "${running}"; ))
|
||||||
if [ "${running}" = "true" ]; then
|
if [ "${running}" = "true" ]; then
|
||||||
property_set running variant:boolean:false
|
property_set running variant:boolean:false
|
||||||
else
|
else
|
||||||
property_set running variant:boolean:true
|
property_set running variant:boolean:true
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
# invert boolean to indiciate running status rather than pause one
|
# invert boolean to indiciate running status rather than pause one
|
||||||
running=$(invert_boolean "${2}")
|
running=$(invert_boolean "${2}")
|
||||||
property_set running variant:boolean:"${running}"
|
property_set running variant:boolean:"${running}"
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
"help"|"--help"|"-h")
|
"help"|"--help"|"-h")
|
||||||
show_help
|
show_help
|
||||||
|
Loading…
x
Reference in New Issue
Block a user