Update lock script, moved scripts to .scripts folder

This commit is contained in:
Riyyi
2017-12-29 18:04:04 +01:00
parent 4a0a147435
commit 3074fdaba4
6 changed files with 31 additions and 12 deletions
-20
View File
@@ -1,20 +0,0 @@
#!/bin/bash
case $BLOCK_BUTTON in
3) xbacklight -set 30 ;; # right click
4) xbacklight -inc 10 ;; # scroll up
5) xbacklight -dec 10 ;; # scroll down
esac
PERCENTAGE=$(printf "%.0f" "$(xbacklight)")
if (( $PERCENTAGE >= 75 )); then
ICON=""
elif (( $PERCENTAGE >= 25 )); then
ICON=""
else
ICON=""
fi
echo $ICON $PERCENTAGE%
-11
View File
@@ -1,11 +0,0 @@
#!/bin/bash
xset s 30 30
icon="$HOME/Pictures/lock.png"
tmpbg='/tmp/screen.png'
scrot "$tmpbg"
convert "$tmpbg" -scale 10% -scale 1000% "$tmpbg"
convert "$tmpbg" "$icon" -gravity center -composite -matte "$tmpbg"
i3lock --nofork -u -i "$tmpbg"; xset s off
-50
View File
@@ -1,50 +0,0 @@
#!/bin/bash
# default (ALSA), pulse, jack
MIXER="pulse"
INSTANCE=${BLOCK_INSTANCE:-"Master"}
STEP="5%"
case $BLOCK_BUTTON in
1) pavucontrol ;; # left click, start sound settings
2) amixer -q -D $MIXER sset $INSTANCE 0 unmute ;; # scroll click, set 0
3) amixer -q -D $MIXER sset $INSTANCE toggle ;; # right click, mute/unmute
4) amixer -q -D $MIXER sset $INSTANCE ${STEP}+ unmute ;; # scroll up, increase
5) amixer -q -D $MIXER sset $INSTANCE ${STEP}- unmute ;; # scroll down, decrease
esac
INFO=$(amixer -D $MIXER get $INSTANCE)
volume() {
VOLUME=$(echo $INFO | sed -nr 's/.*\[([0-9]*)%\].*/\1/p' | head -n 1)
}
symbol() {
if [ "$VOLUME" -ge "50" ]; then
SYMBOL=""
elif [ "$VOLUME" -ge "25" ]; then
SYMBOL=""
else
SYMBOL=""
fi
}
setOutput() {
# If sound is not muted
if [ -n "$(echo $INFO | sed -nr 's/(\[on\])/\1/p')" ]; then
COLOR="#FFF"
volume
symbol
VOLUME="$VOLUME%"
else
COLOR="#676E7D"
VOLUME="MUTE"
SYMBOL=""
fi
}
setOutput
echo "<span color='$COLOR'>$SYMBOL</span> $VOLUME"