Now that volume executable exists the numbers are appearing. Use single quotes on the outside so that the subshell is not parsed too early. Also refactor the volume and brightness code to be easier to view and edit.

This commit is contained in:
2026-07-23 17:50:44 -07:00
parent a2edee0857
commit 481f8fa5d1
+17 -18
View File
@@ -149,34 +149,33 @@ bindsym $ctrl+$shift+3 workspace $ws3; exec codium-flatpak;
## Brightness ## ## Brightness ##
# Use the bracket keys to change the brightness. # Use the bracket keys to change the brightness.
# light requires sudo privileges unless video group and udev are configured. # light requires sudo privileges unless video group and udev are configured.
bindsym $mod+bracketleft exec --no-startup-id "light -U 5; notify-send 'Brightness -' $(light -G)" bindsym $mod+bracketleft exec --no-startup-id 'light -U 5; notify-send "Brightness - " $(light -G)'
bindsym $mod+bracketright exec --no-startup-id "light -A 5; notify-send 'Brightness +' $(light -G)" bindsym $mod+bracketright exec --no-startup-id 'light -A 5; notify-send "Brightness + " $(light -G)'
bindsym shift+$mod+bracketleft exec --no-startup-id "light -U 20; notify-send 'Brightness ---' $(light -G)" bindsym shift+$mod+bracketleft exec --no-startup-id 'light -U 20; notify-send "Brightness ---" $(light -G)'
bindsym shift+$mod+bracketright exec --no-startup-id "light -A 20; notify-send 'Brightness +++' $(light -G)" bindsym shift+$mod+bracketright exec --no-startup-id 'light -A 20; notify-send "Brightness +++" $(light -G)'
# Also get the actual brightness keys to work!! # Also get the actual brightness keys to work!!
bindsym XF86MonBrightnessUp exec --no-startup-id "light -A 5; notify-send 'Brightness +' $(light -G)" bindsym XF86MonBrightnessUp exec --no-startup-id 'light -A 5; notify-send "Brightness + " $(light -G)'
bindsym XF86MonBrightnessDown exec --no-startup-id "light -U 5; notify-send 'Brightness -' $(light -G)" bindsym XF86MonBrightnessDown exec --no-startup-id 'light -U 5; notify-send "Brightness - " $(light -G)'
bindsym shift+XF86MonBrightnessUp exec --no-startup-id "light -A 20; notify-send 'Brightness +++' $(light -G)" bindsym shift+XF86MonBrightnessUp exec --no-startup-id 'light -A 20; notify-send "Brightness +++" $(light -G)'
bindsym shift+XF86MonBrightnessDown exec --no-startup-id "light -U 20; notify-send 'Brightness ---' $(light -G)" bindsym shift+XF86MonBrightnessDown exec --no-startup-id 'light -U 20; notify-send "Brightness ---" $(light -G)'
## Volume ## ## Volume ##
# The volume function is from https://git.hyperling.com/me/env-ansible # The volume function is from https://git.hyperling.com/me/env-ansible
# TBD: Why is the displayed volume not showing up like `light -G` above?
# Use the comma and period keys to change volume. # Use the comma and period keys to change volume.
bindsym $mod+comma exec --no-startup-id bash -c 'source /usr/local/bin/volume.function && volume -5 && notify-send "Volume -" $(volume)' bindsym $mod+comma exec --no-startup-id bash -c 'source /usr/local/bin/volume.function && volume -5 && notify-send "Volume - " $(volume)'
bindsym $mod+period exec --no-startup-id bash -c "source /usr/local/bin/volume.function && volume +5 && notify-send 'Volume +' $(volume)" bindsym $mod+period exec --no-startup-id bash -c 'source /usr/local/bin/volume.function && volume +5 && notify-send "Volume + " $(volume)'
bindsym shift+$mod+comma exec --no-startup-id bash -c "source /usr/local/bin/volume.function && volume -25 && notify-send 'Volume ---' $(volume)" bindsym shift+$mod+comma exec --no-startup-id bash -c 'source /usr/local/bin/volume.function && volume -25 && notify-send "Volume ---" $(volume)'
bindsym shift+$mod+period exec --no-startup-id bash -c "source /usr/local/bin/volume.function && volume +25 && notify-send 'Volume +++' $(volume)" bindsym shift+$mod+period exec --no-startup-id bash -c 'source /usr/local/bin/volume.function && volume +25 && notify-send "Volume +++" $(volume)'
# Actual volume keys. # Actual volume keys.
bindsym XF86AudioMute exec --no-startup-id bash -c "source /usr/local/bin/volume.function && volume mute && notify-send 'Volume Muted' $(volume)" bindsym XF86AudioMute exec --no-startup-id bash -c 'source /usr/local/bin/volume.function && volume mute && notify-send "Volume Muted" $(volume)'
bindsym XF86AudioRaiseVolume exec --no-startup-id bash -c "source /usr/local/bin/volume.function && volume +5 && notify-send 'Volume +' $(volume)" bindsym XF86AudioRaiseVolume exec --no-startup-id bash -c 'source /usr/local/bin/volume.function && volume +5 && notify-send "Volume + " $(volume)'
bindsym XF86AudioLowerVolume exec --no-startup-id bash -c "source /usr/local/bin/volume.function && volume -5 && notify-send 'Volume -' $(volume)" bindsym XF86AudioLowerVolume exec --no-startup-id bash -c 'source /usr/local/bin/volume.function && volume -5 && notify-send "Volume - " $(volume)'
bindsym shift+XF86AudioRaiseVolume exec --no-startup-id bash -c "source /usr/local/bin/volume.function && volume +25 && notify-send 'Volume +++' $(volume)" bindsym shift+XF86AudioRaiseVolume exec --no-startup-id bash -c 'source /usr/local/bin/volume.function && volume +25 && notify-send "Volume +++ " $(volume)'
bindsym shift+XF86AudioLowerVolume exec --no-startup-id bash -c "source /usr/local/bin/volume.function && volume -25 && notify-send 'Volume ---' $(volume)" bindsym shift+XF86AudioLowerVolume exec --no-startup-id bash -c 'source /usr/local/bin/volume.function && volume -25 && notify-send "Volume --- " $(volume)'
# Define names for default workspaces for which we configure key bindings later on. # Define names for default workspaces for which we configure key bindings later on.