volume.sh: actualización

Se eliminan lineas de código redundantes
This commit is contained in:
Tuxliban Torvalds 2020-12-14 22:51:40 -06:00
parent 24ba237bc8
commit 99ab5f87c7
2 changed files with 9 additions and 13 deletions

View file

@ -1,13 +0,0 @@
#!/bin/sh
#a=$(amixer get Master | tail -n 1 | cut -d ' ' -f 8)
a=$(amixer sget Master | tail -n1 | sed -r "s/.*\[(.*)\]/\1/")
#b=$(amixer get Master | tail -n 1 | awk '{print $4}' | cut -d '[' -f2 | cut -d ']' -f1)
b=$(amixer get Master | tail -n1 | sed -r "s/.*\[(.*)%\].*/\1/")
#if [ $a = '[on]' ]; then
if [ $a = 'on' ]; then
# echo " $b"
printf " $b%%"
else
echo "";
fi

9
varios/volume.sh Executable file
View file

@ -0,0 +1,9 @@
#!/bin/sh
a=$(amixer sget Master | tail -n1 | sed -r "s/.*\[(.*)\]/\1/")
b=$(amixer get Master | tail -n1 | sed -r "s/.*\[(.*)%\].*/\1/")
if [ $a = 'on' ]; then
printf "$b%%"
else
printf "";
fi