Update sound and brightness scripts

This commit is contained in:
Alexander Rosenberg 2024-08-24 16:49:55 -07:00
parent c331844f0d
commit 7b473511a1
Signed by: Zander671
GPG Key ID: 5FD0394ADBD72730
2 changed files with 9 additions and 3 deletions

View File

@ -2,7 +2,10 @@
SAVE_FILE="${HOME}/.cache/brightness-control-cache" SAVE_FILE="${HOME}/.cache/brightness-control-cache"
let really_notify=1
notify-brightness() { notify-brightness() {
((${really_notify})) || return
brightness="$(brightnessctl -m | sed 's/,/ /g' | awk '{print $4}' | tr -d '\n' | tr -d '%')" 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%" 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 print-usage
fi fi
if [[ "${1}" == -n ]]; then
really_notify=0
shift 1
fi
ammount='5%' ammount='5%'
value='50%' value='50%'
if [ "${#}" -gt 1 ]; then if [ "${#}" -gt 1 ]; then

View File

@ -19,9 +19,7 @@ function print_help {
let notify=1 let notify=1
function notify_vol { function notify_vol {
if ! ((${notify})); then ((${notify})) || return
return
fi
let vol="$(pamixer --get-volume)" let vol="$(pamixer --get-volume)"
local icon local icon
if [[ "$(pamixer --get-mute)" == 'true' ]]; then if [[ "$(pamixer --get-mute)" == 'true' ]]; then