]> git.vanrenterghem.biz Git - Dotty.git/commitdiff
Define brightness and volume key bindings for i3. master
authorFrederik Vanrenterghem <frederik@vanrenterghem.biz>
Fri, 3 May 2024 14:54:09 +0000 (22:54 +0800)
committerFrederik Vanrenterghem <frederik@vanrenterghem.biz>
Fri, 3 May 2024 14:54:09 +0000 (22:54 +0800)
i3/.config/i3/config

index e2a1d760ce0626fbf74309bd41245bb542002110..0c260d3b179fd28212d92b81f8d0743fde48eb3b 100644 (file)
@@ -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
 
 # 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.
 # 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
 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
 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