os/arch/bin: volume => vol (volume conflicts with system binary on Arch)
This commit is contained in:
		
							parent
							
								
									b7ae7a2ab5
								
							
						
					
					
						commit
						65afe7a464
					
				| 
						 | 
					@ -1,7 +1,6 @@
 | 
				
			||||||
#!/usr/bin/env bash
 | 
					#!/usr/bin/env bash
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if [[ $# = 0 ]]
 | 
					if (($# == 0)); then
 | 
				
			||||||
then
 | 
					 | 
				
			||||||
    data=$(amixer get Master)
 | 
					    data=$(amixer get Master)
 | 
				
			||||||
    vol=$(echo "$data" | sed -n 's/^.*\[\([0-9]\+\)%.*$/\1/p' | uniq)
 | 
					    vol=$(echo "$data" | sed -n 's/^.*\[\([0-9]\+\)%.*$/\1/p' | uniq)
 | 
				
			||||||
    state=$(echo "$data" | grep '\[on\]')
 | 
					    state=$(echo "$data" | grep '\[on\]')
 | 
				
			||||||
| 
						 | 
					@ -9,16 +8,18 @@ then
 | 
				
			||||||
    exit
 | 
					    exit
 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
COMMAND=$1
 | 
					case $1 in
 | 
				
			||||||
case "$COMMAND" in
 | 
					    [0-9]*) amixer set Master $1 ;;
 | 
				
			||||||
    [0-9]*) amixer set Master $COMMAND ;;
 | 
					    [+-])   amixer set Master 10%$1 ;;
 | 
				
			||||||
    [+-])   amixer set Master 10%$COMMAND ;;
 | 
					    *mute)  amixer set Master $1 ;;
 | 
				
			||||||
    *mute)  amixer set Master $COMMAND ;;
 | 
					 | 
				
			||||||
    toggle) amixer set Master toggle ;;
 | 
					    toggle) amixer set Master toggle ;;
 | 
				
			||||||
    *)  >&2 echo "Invalid command"
 | 
					    *)  >&2 echo "Invalid command"
 | 
				
			||||||
        exit 1
 | 
					        exit 1
 | 
				
			||||||
        ;;
 | 
					        ;;
 | 
				
			||||||
esac
 | 
					esac
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					killall -9 -q osd_cat &>/dev/null
 | 
				
			||||||
 | 
					osd_cat --font="10x20" --delay=2 --color=white --align=center --pos=bottom --barmode=percentage --percentage $($0) &
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Report to lemonbar, if active
 | 
					# Report to lemonbar, if active
 | 
				
			||||||
~/.config/panel/panel_update.sh volume
 | 
					$HOME/.config/panel/panel-notify :volume
 | 
				
			||||||
		Loading…
	
		Reference in a new issue