Script volume


 

 

Utilité : Permet d'augmenter ou diminuer le volume avec des raccourcis clavier

Dépendances : libaosd, alsa-utils ( une version pour OSSv4 en fin de page )

 

Installation : A assigner à un raccourci clavier ( pour définir vos touche aller voir cette documentation par exemple )

 

EDIT : J'ai été obligé de couper le script en 3 partie car les raccourcis clavier ne fonctionne pas lorsqu'il y a un argument ( ex : voir bas de page ) avec Xfce inferieur à la version 4.6


Script :

#!/bin/bash

a=`amixer sset PCM 2%- unmute | grep Left: | awk '{ gsub(/\[/, " "); gsub(/%\]/, " "); print $5 }'`
killall aosd_cat
echo "Volume: $a%" |  aosd_cat  -p 7 --x-offset=-10 --y-offset=-30 --font="bitstream bold 20" --fore-color="#dfe2e8" --transparency=1 --fade-full=2000
#!/bin/bash

a=`amixer sset PCM 2%+ unmute | grep Left: | awk '{ gsub(/\[/, " "); gsub(/%\]/, " "); print $5 }'`
killall aosd_cat
echo "Volume: $a%" |  aosd_cat  -p 7 --x-offset=-10 --y-offset=-30 --font="bitstream bold 20" --fore-color="#dfe2e8" --transparency=1 --fade-full=2000

#!/bin/bash

a=`amixer set PCM toggle | grep Left: | awk '{ gsub(/\[/, " "); gsub(/%\]/, " "); print $7 }' | cut -f1 -d]`

killall aosd_cat
case $a in
on)
echo "Unmute" |  aosd_cat  -p 7 --x-offset=-10 --y-offset=-30 --font="bitstream bold 20" --fore-color="#dfe2e8" --transparency=1 --fade-full=2000
;;
*)
echo "Mute" |  aosd_cat  -p 7 --x-offset=-10 --y-offset=-30 --font="bitstream bold 20" --fore-color="#dfe2e8" --transparency=1 --fade-full=2000
;;
esac

#!/bin/bash

case $1 in
up) a="Volume: `amixer sset PCM 2%+ unmute | grep Left: | awk '{ gsub(/\[/, " "); gsub(/%\]/, " "); print $5 }'`%" ;;
down) a="Volume: `amixer sset PCM 2%- unmute | grep Left: | awk '{ gsub(/\[/, " "); gsub(/%\]/, " "); print $5 }'`%" ;;
mute)

case `amixer set PCM toggle | grep Left: | awk '{ gsub(/\[/, " "); gsub(/%\]/, " "); print $7 }' | cut -f1 -d]` in
            on) a="Unmute" ;;
             *) a="Mute" ;;
             esac ;;
*) echo "Usage: $0 { up | down | mute }"  ;;
esac

killall aosd_cat
echo "$a" |  aosd_cat  -p 7 --x-offset=-10 --y-offset=-30 --font="bitstream bold 20" --fore-color="#dfe2e8" --transparency=1 --fade-full=2000
 

 

#!/bin/bash
case $1 in
oss_up) a="Volume: `ossmix vol -- +2 | cut -f1 -d. | awk '{print $NF}'`%" ;;
oss_down) a="Volume: `ossmix vol -- -2 | cut -f1 -d. | awk '{print $NF}'`%" ;;
oss_mute) if [ -f ~/.volume ]; then
        ossmix vol `cat ~/.volume` ; a="Unmute"
        rm ~/.volume
    else
        VOLUME=$(ossmix vol | awk '{print $10}' | awk -F : '{print $1}')
        ossmix vol 0 ; a="Mute"
        echo $VOLUME > ~/.volume
    fi ;;
*) echo "Usage: $0 {oss_up | oss_down | oss_mute }"  ;;
esac
killall aosd_cat &> /dev/null
echo "$a" |  aosd_cat  -p 7 --x-offset=-10 --y-offset=-30 --font="bitstream bold 20" --fore-color="#dfe2e8" --transparency=1 --fade-full=2000

 

 


Plan du site Version imprimable Envoyer un mailLivre d'or


Flux Rss