From: Frederik Vanrenterghem Date: Fri, 3 May 2024 14:54:09 +0000 (+0800) Subject: Define brightness and volume key bindings for i3. X-Git-Url: http://git.vanrenterghem.biz/Dotty.git/commitdiff_plain/a450bc58bbc0e17fb5bdef5fa4b2492f222d0928?ds=sidebyside Define brightness and volume key bindings for i3. --- diff --git a/i3/.config/i3/config b/i3/.config/i3/config index e2a1d76..0c260d3 100644 --- a/i3/.config/i3/config +++ b/i3/.config/i3/config @@ -40,11 +40,29 @@ exec --no-startup-id xss-lock --transfer-sleep-lock -- i3lock --nofork # and nm-applet is a desktop environment-independent system tray GUI for it. exec --no-startup-id nm-applet +## Control brightness +bindsym XF86MonBrightnessUp exec --no-startup-id brightnessctl set +5% +bindsym XF86MonBrightnessDown exec --no-startup-id brightnessctl set 5%- + # Use pactl to adjust volume in PulseAudio. +# Notification via dunst - TODO refactor as per https://github.com/dunst-project/dunst/blob/master/contrib/progress-notify.sh +exec --no-startup-id dunst + set $refresh_i3status killall -SIGUSR1 i3status -bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +10% && $refresh_i3status -bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -10% && $refresh_i3status -bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle && $refresh_i3status +bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +10% && $refresh_i3status && dunstify -a "changeVolume" -u low -i audio-volume-medium \ + -h int:value:"$(pamixer --get-volume)" "Volume: $(pamixer --get-volume)%" \ + -h string:x-dunst-stack-tag:volume \ + -h string:hlcolor:#3397ff +bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -10% && \ +$refresh_i3status && \ +dunstify -a "changeVolume" -u low -i audio-volume-low \ + -h int:value:"$(pamixer --get-volume)" "Volume: $(pamixer --get-volume)%" \ + -h string:x-dunst-stack-tag:volume \ + -h string:hlcolor:#3397ff + +bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle && $refresh_i3status && dunstify -t 2000 -u low -i audio-volume-muted \ +-h string:x-dunst-stack-tag:volume "Muted" + bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle && $refresh_i3status # Use Mouse+$mod to drag floating windows to their wanted position