Skip to content

Instantly share code, notes, and snippets.

@Zenithar
Last active November 19, 2020 14:53
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Zenithar/cca0afe907f27c4859e8823908b7d040 to your computer and use it in GitHub Desktop.
Save Zenithar/cca0afe907f27c4859e8823908b7d040 to your computer and use it in GitHub Desktop.
i3 fancy volume && brightness
#!/bin/bash
LEVEL=$(xbacklight -get | xargs printf "%.f")
case "$1" in
"up")
[[ "$LEVEL" -eq 100 ]]
xbacklight -inc 5
;;
"down")
xbacklight -dec 10
;;
esac
LEVEL=$(xbacklight -get | xargs printf "%.f")
# notification
volnoti-show -s /usr/share/pixmaps/volnoti/display-brightness-symbolic.svg $LEVEL
# yaourt -S volnoti-hcchu-git pamixer
exec --no-startup-id volnoti &
# multimedia keys
bindsym XF86AudioRaiseVolume exec "~/.i3/bin/volume up"
bindsym XF86AudioLowerVolume exec "~/.i3/bin/volume down"
bindsym XF86AudioMute exec "~/.i3/bin/volume mute"
bindsym XF86MonBrightnessUp exec "~/.i3/bin/brightness up"
bindsym XF86MonBrightnessDown exec "~/.i3/bin/brightness down"
#!/bin/bash
VOLUME=$(pamixer --get-volume)
VALUE=5
case "$1" in
"up")
[[ "$VOLUME" -eq 100 ]] && VALUE=0
pamixer --increase $VALUE
;;
"down")
pamixer --decrease $VALUE
;;
"mute")
pamixer --toggle-mute
;;
esac
# notification
VOLUME=$(pamixer --get-volume)
MUTE=$(pamixer --get-mute)
if [ "$MUTE" == "false" ]; then
volnoti-show $VOLUME
else
volnoti-show -m $VOLUME
fi
@martindemello
Copy link

the package is volnoti-brightness-git now. thanks for a useful set of scripts :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment