mirror of
https://github.com/gunchev/home_bin.git
synced 2025-11-20 12:15:46 +00:00
Added kb_led_inc.sh and kb_led_dec.sh (I use because KDE increments by 3/10=0)
This commit is contained in:
parent
f8c71d3ffa
commit
0fe8795d35
2 changed files with 20 additions and 0 deletions
10
kb_led_dec.sh
Executable file
10
kb_led_dec.sh
Executable file
|
|
@ -0,0 +1,10 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
cur=$(dbus-send --print-reply=literal --type=method_call --system --dest=org.freedesktop.UPower /org/freedesktop/UPower/KbdBacklight org.freedesktop.UPower.KbdBacklight.GetBrightness | sed s/...int32.//g)
|
||||||
|
max=$(dbus-send --print-reply=literal --type=method_call --system --dest=org.freedesktop.UPower /org/freedesktop/UPower/KbdBacklight org.freedesktop.UPower.KbdBacklight.GetMaxBrightness | sed s/...int32.//g)
|
||||||
|
|
||||||
|
val=$(($cur - 1))
|
||||||
|
if (($val >= 0)); then
|
||||||
|
dbus-send --print-reply=literal --type=method_call --system --dest=org.freedesktop.UPower /org/freedesktop/UPower/KbdBacklight org.freedesktop.UPower.KbdBacklight.SetBrightness int32:$val
|
||||||
|
notify-send -t 500 -i /usr/share/icons/HighContrast/scalable/devices/input-keyboard.svg "Brightness $val/$max"
|
||||||
|
fi
|
||||||
10
kb_led_inc.sh
Executable file
10
kb_led_inc.sh
Executable file
|
|
@ -0,0 +1,10 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
cur=$(dbus-send --print-reply=literal --type=method_call --system --dest=org.freedesktop.UPower /org/freedesktop/UPower/KbdBacklight org.freedesktop.UPower.KbdBacklight.GetBrightness | sed s/...int32.//g)
|
||||||
|
max=$(dbus-send --print-reply=literal --type=method_call --system --dest=org.freedesktop.UPower /org/freedesktop/UPower/KbdBacklight org.freedesktop.UPower.KbdBacklight.GetMaxBrightness | sed s/...int32.//g)
|
||||||
|
|
||||||
|
val=$(($cur + 1))
|
||||||
|
if (($val <= $max)); then
|
||||||
|
dbus-send --print-reply=literal --type=method_call --system --dest=org.freedesktop.UPower /org/freedesktop/UPower/KbdBacklight org.freedesktop.UPower.KbdBacklight.SetBrightness int32:$val
|
||||||
|
notify-send -t 500 -i /usr/share/icons/HighContrast/scalable/devices/input-keyboard.svg "Brightness $val/$max"
|
||||||
|
fi
|
||||||
Loading…
Add table
Add a link
Reference in a new issue