Okay, without symlinks now, seems easier

This commit is contained in:
downhill 2019-03-23 22:25:08 +01:00
commit 0f8aeafb68
7 changed files with 598 additions and 7 deletions

View file

@ -1 +0,0 @@
../../bin/brightness.sh

20
bin/brightness.sh Executable file
View file

@ -0,0 +1,20 @@
#!/bin/sh
if [ $1 = '-d' ]; then
current=$(xrandr --verbose | grep -m 1 -i brightness | awk -F' ' '{ print $2 }')
new=$(echo "$current - 0.1" | bc -l)
xrandr --output eDP-1 --brightness 0$new
percent=$(echo "$new * 100" | bc -l)
notify-send "Brightness lowered to ${percent}%"
elif [ $1 = '-u' ]; then
current=$(xrandr --verbose | grep -m 1 -i brightness | awk -F' ' '{ print $2 }')
new=$(echo "$current + 0.1" | bc -l)
xrandr --output eDP-1 --brightness 0$new
percent=$(echo "$new * 100" | bc -l)
notify-send "Brightness raised to ${percent}%"
elif [ $1 = '-m' ]; then
xrandr --output eDP-1 --brightness 1
notify-send "Brightness reset to 100%"
else
xrandr --output eDP-1 --brightness $1
fi

View file

@ -1 +0,0 @@
../../bin/lock.sh

7
bin/lock.sh Executable file
View file

@ -0,0 +1,7 @@
#!/bin/sh
# pause notification daemon during screensaver, get notifications
# after unlocking
killall -SIGUSR1 dunst
i3lock -c 000000 -n
killall -SIGUSR2 dunst

View file

@ -1 +0,0 @@
../../bin/sleep.sh

12
bin/sleep.sh Executable file
View file

@ -0,0 +1,12 @@
#!/bin/sh
# Small script to lock the screen before sleeping
# suspend to ram or suspend to disk?
if [ $1 = '-r' ]; then
sleeptype="/usr/sbin/s2ram"
elif [ $1 = '-d' ]; then
sleeptype="/usr/sbin/s2disk"
fi
/usr/bin/i3lock -c 000000 && /usr/bin/sudo $sleeptype

View file

@ -1 +0,0 @@
../../bin/sound.sh

22
bin/sound.sh Executable file
View file

@ -0,0 +1,22 @@
#!/bin/sh
# control for the mute key, toggles mute/unmute
if [ $1 = '-m' ]; then
mutecontrol=$(amixer get Master | grep 'Front Left:' | awk '{ print $6 }')
if [ $mutecontrol = "[on]" ]; then
amixer set Master mute
notify-send "Sound muted."
elif [ $mutecontrol = "[off]" ]; then
amixer set Master unmute
notify-send "Sound unmuted."
fi
elif [ $1 = "-d" ]; then
amixer set Master 10%-
volume=$(amixer get Master |grep 'Front Left:' |awk '{ print $5 }' |sed -e 's/\[//' |sed -e 's/\]//')
notify-send "Sound lowered to $volume"
elif [ $1 = "-u" ]; then
amixer set Master 10%+
volume=$(amixer get Master |grep 'Front Left:' |awk '{ print $5 }' |sed -e 's/\[//' |sed -e 's/\]//')
notify-send "Sound raised to $volume"
fi