Add util scripts + volume key bindings

This commit is contained in:
swagg boi 2025-05-15 19:52:11 -04:00
parent f0ecb3a500
commit e39f888050
6 changed files with 29 additions and 0 deletions

View File

@ -389,6 +389,16 @@
<command>dmenu_run</command> <command>dmenu_run</command>
</action> </action>
</keybind> </keybind>
<keybind key="XF86AudioRaiseVolume">
<action name="Execute">
<command>volume_up.sh</command>
</action>
</keybind>
<keybind key="XF86AudioLowerVolume">
<action name="Execute">
<command>volume_down.sh</command>
</action>
</keybind>
</keyboard> </keyboard>
<mouse> <mouse>
<dragThreshold>1</dragThreshold> <dragThreshold>1</dragThreshold>

3
my_home/bin/show_battery.sh Executable file
View File

@ -0,0 +1,3 @@
#!/usr/bin/env sh
envstat -s "acpibat0:charge,acpibat1:charge"

3
my_home/bin/sleep_laptop.sh Executable file
View File

@ -0,0 +1,3 @@
#!/usr/bin/env sh
sysctl -w hw.acpi.sleep.state=3

5
my_home/bin/volume_down.sh Executable file
View File

@ -0,0 +1,5 @@
#!/usr/bin/env sh
volume_level=`mixerctl -n outputs.master | cut -d ',' -f 1`
mixerctl -w outputs.master=`expr $volume_level - 10`

5
my_home/bin/volume_up.sh Executable file
View File

@ -0,0 +1,5 @@
#!/usr/bin/env sh
volume_level=`mixerctl -n outputs.master | cut -d ',' -f 1`
mixerctl -w outputs.master=`expr $volume_level + 10`

3
my_home/bin/watch_battery.sh Executable file
View File

@ -0,0 +1,3 @@
#!/usr/bin/env sh
envstat -s "acpibat0:charge,acpibat1:charge" -i 60