This commit is contained in:
Filip Rojek 2022-12-12 15:59:27 +01:00
parent 66945b37e4
commit d15f3ea237
Signed by: fr
GPG Key ID: A56A345EFE321161
5 changed files with 28 additions and 23 deletions

View File

@ -1,4 +1,4 @@
#!/bin/sh #!/bin/bash
prct=$(upower -d | grep percentage | sed -n "1p" | sed -e 's/^.* //') prct=$(upower -d | grep percentage | sed -n "1p" | sed -e 's/^.* //')
prctonly=$(upower -d | grep percentage | sed -n "1p" | sed -e 's/^.* //' | sed 's/%//') prctonly=$(upower -d | grep percentage | sed -n "1p" | sed -e 's/^.* //' | sed 's/%//')
@ -7,10 +7,10 @@ stat=$(upower -d | grep -m1 state | sed -e 's/^.* //')
## if any argument ## if any argument
if [ $# -gt 0 ]; then if [ $# -gt 0 ]; then
if [[ $stat == "charging" ]]; then if [[ $stat == "charging" ]]; then
echo "BAT +$prct" echo "BAT $prct +"
exit exit
fi fi
echo "BAT -$prct" echo "BAT $prct -"
exit exit
fi fi

View File

@ -1,4 +1,4 @@
#!/bin/sh #!/bin/bash
eth="$(ip -4 addr show enp8s0 | grep -oP '(?<=inet\s)\d+(\.\d+){3}')" eth="$(ip -4 addr show enp8s0 | grep -oP '(?<=inet\s)\d+(\.\d+){3}')"
wlp="$(ip -4 addr show wlp7s0 | grep -oP '(?<=inet\s)\d+(\.\d+){3}')" wlp="$(ip -4 addr show wlp7s0 | grep -oP '(?<=inet\s)\d+(\.\d+){3}')"
@ -8,4 +8,4 @@ then
exit; exit;
fi fi
echo "$wlp" echo "$wlp"

View File

@ -1,5 +1,5 @@
#!/bin/sh #!/bin/sh
mem="$(free -h | awk '/^Mem:/ {print $3 "/" $2}')" mem="$(free -h | awk '/^Mem:/ {print $3 "/" $2}')"
echo -e "$mem" echo "$mem"

View File

@ -1,19 +1,5 @@
#!/bin/sh #!/bin/bash
vol="$(amixer get Master | tail -n1 | sed -r 's/.*\[(.*)%\].*/\1/')" vol="$(pamixer --get-volume-human)"
echo "VOL $vol"
## if any argument
if [ $# -gt 0 ]; then
stat="$(amixer get Master | tail -n1 | sed -r 's/.*\[(.*)].*/\1/')"
if [[ $(echo $stat) == "on" ]]; then
echo "VOL $vol%"
exit
fi
echo "MUT $vol%"
exit
fi
## just returns volume %
vol="$(amixer get Master | tail -n1 | sed -r 's/.*\[(.*)%\].*/\1/')"
echo -e "$vol"

View File

@ -0,0 +1,19 @@
#!/bin/sh
vol="$(amixer get Master | tail -n1 | sed -r 's/.*\[(.*)%\].*/\1/')"
## if any argument
if [ $# -gt 0 ]; then
stat="$(amixer get Master | tail -n1 | sed -r 's/.*\[(.*)].*/\1/')"
if [[ $(echo $stat) == "on" ]]; then
echo "VOL $vol%"
exit
fi
echo "MUT $vol%"
exit
fi
## just returns volume %
vol="$(amixer get Master | tail -n1 | sed -r 's/.*\[(.*)%\].*/\1/')"
echo -e "$vol"