diff --git a/brightness-control.sh b/brightness-control.sh index f6f6011..19565b4 100755 --- a/brightness-control.sh +++ b/brightness-control.sh @@ -2,7 +2,10 @@ SAVE_FILE="${HOME}/.cache/brightness-control-cache" +let really_notify=1 + notify-brightness() { + ((${really_notify})) || return brightness="$(brightnessctl -m | sed 's/,/ /g' | awk '{print $4}' | tr -d '\n' | tr -d '%')" notify-send -h string:x-canonical-private-synchronous:brightness-control-sh -t 4000 -u normal -a "Brightness" -h int:value:"$brightness" "$brightness%" } @@ -30,6 +33,11 @@ if [ "$#" -lt 1 ]; then print-usage fi +if [[ "${1}" == -n ]]; then + really_notify=0 + shift 1 +fi + ammount='5%' value='50%' if [ "${#}" -gt 1 ]; then diff --git a/sound-control.sh b/sound-control.sh index af7545f..593e963 100755 --- a/sound-control.sh +++ b/sound-control.sh @@ -19,9 +19,7 @@ function print_help { let notify=1 function notify_vol { - if ! ((${notify})); then - return - fi + ((${notify})) || return let vol="$(pamixer --get-volume)" local icon if [[ "$(pamixer --get-mute)" == 'true' ]]; then