Procházet zdrojové kódy

Update volume adjustment

Drew před 12 roky
rodič
revize
39f8ab2045
2 změnil soubory, kde provedl 5 přidání a 4 odebrání
  1. 3 3
      openbox/rc.xml
  2. 2 1
      scripts/volume-change.sh

+ 3 - 3
openbox/rc.xml

@@ -385,17 +385,17 @@
     <!--Volume Control-->
     <keybind key="XF86AudioRaiseVolume">
       <action name="Execute">
-        <command>amixer set Master 3277+</command>
+        <command>~/Documents/dotfiles/scripts/volume-change.sh up</command>
       </action>
     </keybind>
     <keybind key="XF86AudioLowerVolume">
       <action name="Execute">
-        <command>amixer set Master 3277-</command>
+        <command>~/Documents/dotfiles/scripts/volume-change.sh down</command>
       </action>
     </keybind>
     <keybind key="XF86AudioMute">
       <action name="Execute">
-        <command>amixer set Master toggle</command>
+        <command>~/Documents/dotfiles/scripts/volume-change.sh toggle</command>
       </action>
     </keybind>
   </keyboard>

+ 2 - 1
scripts/volume-change.sh

@@ -1,6 +1,7 @@
 #!/bin/bash
 
-step=3277
+max=$(amixer get Master | grep Limits | cut -f7 -d' ')
+step=$(( ($max+19)/20 ))
 
 if [[ $# -eq 1 ]]; then
   case $1 in