Add brightnesscontrol.sh, switch pulsemixer to pamixer, fix block interrupts
This commit is contained in:
Executable
+40
@@ -0,0 +1,40 @@
|
||||
#!/bin/sh
|
||||
|
||||
# General brightness management
|
||||
|
||||
RELOAD="$HOME/.scripts/panel/brightness.sh"
|
||||
|
||||
[ -z "$2" ] && NUM="5" || NUM="$2"
|
||||
|
||||
help() {
|
||||
B=$(tput bold)
|
||||
N=$(tput sgr0)
|
||||
|
||||
cat << EOF
|
||||
${B}NAME${N}
|
||||
brightnesscontrol - control the volume of the system
|
||||
|
||||
${B}SYNOPSIS${N}
|
||||
./brightnesscontrol.sh <command> [<arg1>]
|
||||
|
||||
${B}DESCRIPTION${N}
|
||||
Commands can be truncated, i.e.
|
||||
\`${B}brightnesscontrol.sh s${N}\` for \`${B}brightnesscontrol.sh set${N}\`
|
||||
|
||||
Arguments need to be of numeric value.
|
||||
|
||||
${B}COMMANDS${N}
|
||||
${B}u*, up <amount>${N}
|
||||
|
||||
${B}d*, down <amount>${N}
|
||||
|
||||
${B}s*, set <volume>${N}
|
||||
EOF
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
u*) brightnessctl -q s +"$NUM"% ; $RELOAD ;;
|
||||
d*) brightnessctl -q s "$NUM"%- ; $RELOAD ;;
|
||||
s*) brightnessctl -q s "$NUM"% ; $RELOAD ;;
|
||||
*) help ;;
|
||||
esac
|
||||
+11
-10
@@ -2,7 +2,7 @@
|
||||
|
||||
# General audio management
|
||||
|
||||
RELOAD="pkill -RTMIN+1 i3blocks"
|
||||
RELOAD="$HOME/.scripts/panel/volume.sh"
|
||||
|
||||
[ -z "$2" ] && NUM="2" || NUM="$2"
|
||||
|
||||
@@ -43,13 +43,14 @@ EOF
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
u*) pulsemixer --change-volume +"$NUM" --max-volume 100 ; $RELOAD ;;
|
||||
d*) pulsemixer --change-volume -"$NUM" --max-volume 100 ; $RELOAD ;;
|
||||
s*) pulsemixer --set-volume "$NUM" --max-volume 100 ; $RELOAD ;;
|
||||
t*) pulsemixer --toggle-mute ; $RELOAD ;;
|
||||
m*) pulsemixer --mute ; $RELOAD ;;
|
||||
n*) pulsemixer --unmute ; $RELOAD ;;
|
||||
getv*) pulsemixer --get-volume | awk '{print $1}' ;;
|
||||
getm*) pulsemixer --get-mute ;;
|
||||
*) help ;;
|
||||
u*) pamixer --increase "$NUM" ; $RELOAD ;;
|
||||
d*) pamixer --decrease "$NUM" ; $RELOAD ;;
|
||||
s*) pamixer --set-volume "$NUM" ; $RELOAD ;;
|
||||
t*) [ "$(pamixer --get-mute)" = "false" ] && \
|
||||
pamixer --mute || pamixer --unmute ; $RELOAD ;;
|
||||
m*) pamixer --mute ; $RELOAD ;;
|
||||
n*) pamixer --unmute ; $RELOAD ;;
|
||||
getv*) pamixer --get-volume ;;
|
||||
getm*) pamixer --get-mute ;;
|
||||
*) help ;;
|
||||
esac
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
#!/bin/sh
|
||||
|
||||
BRIGHTNESS_CONTROL="$HOME/.scripts/brightnesscontrol.sh"
|
||||
|
||||
# Right click, scroll up, scroll down
|
||||
R="A3:brightnessctl -q s 30%; $0:"
|
||||
U="A4:brightnessctl -q s +10%; $0:"
|
||||
D="A5:brightnessctl -q s 10%-; $0:"
|
||||
R="A3:$BRIGHTNESS_CONTROL s 30:"
|
||||
U="A4:$BRIGHTNESS_CONTROL u 10:"
|
||||
D="A5:$BRIGHTNESS_CONTROL d 10:"
|
||||
|
||||
PERCENTAGE=$(brightnessctl \
|
||||
| awk '/\([0-9]+%\)/ { print substr($4, 2, length($4) - 3) }')
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
#!/bin/sh
|
||||
|
||||
MEDIACONTROL="$HOME/.scripts/mediacontrol.sh"
|
||||
MEDIA_CONTROL="$HOME/.scripts/mediacontrol.sh"
|
||||
|
||||
# Left click, scroll click, right click, scroll up and scroll down
|
||||
L="A1:pavucontrol:"
|
||||
S="A2:$MEDIACONTROL set 0; $0:"
|
||||
R="A3:$MEDIACONTROL toggle; $0:"
|
||||
U="A4:$MEDIACONTROL up 5; $0:"
|
||||
D="A5:$MEDIACONTROL down 5; $0:"
|
||||
S="A2:$MEDIA_CONTROL set 0:"
|
||||
R="A3:$MEDIA_CONTROL toggle:"
|
||||
U="A4:$MEDIA_CONTROL up 5:"
|
||||
D="A5:$MEDIA_CONTROL down 5:"
|
||||
|
||||
VOLUME="$($MEDIACONTROL getvolume)"
|
||||
VOLUME="$($MEDIA_CONTROL getvolume)"
|
||||
|
||||
COLOR="-"
|
||||
if [ "$($MEDIACONTROL getmute)" = "1" ]; then
|
||||
if [ "$($MEDIA_CONTROL getmute)" = "true" ]; then
|
||||
COLOR="$COLOR7"
|
||||
|
||||
SYMBOL=""
|
||||
|
||||
Reference in New Issue
Block a user