Update sound and brightness scripts
This commit is contained in:
parent
c331844f0d
commit
7b473511a1
@ -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
|
||||||
|
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user