Compare commits

..

2 Commits

2 changed files with 52 additions and 12 deletions
+30 -12
View File
@@ -36,10 +36,10 @@ exec --no-startup-id nm-applet
# Use pactl to adjust volume in PulseAudio. # Use pactl to adjust volume in PulseAudio.
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 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 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 XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle && $refresh_i3status
bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle && $refresh_i3status #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 # Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod floating_modifier $mod
@@ -116,19 +116,37 @@ bindsym $mod+a focus parent
# focus the child container # focus the child container
#bindsym $mod+d focus child #bindsym $mod+d focus child
## 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 "light -U 5; notify-send 'Brightness Down' $(light -G)" bindsym $mod+bracketleft exec --no-startup-id "light -U 5; notify-send 'Brightness Down' $(light -G)"
bindsym $mod+bracketright exec "light -A 5; notify-send 'Brightness Up' $(light -G)" bindsym $mod+bracketright exec --no-startup-id "light -A 5; notify-send 'Brightness Up' $(light -G)"
bindsym shift+$mod+bracketleft exec "light -U 25; notify-send 'Brightness Down' $(light -G)" bindsym shift+$mod+bracketleft exec --no-startup-id "light -U 25; notify-send 'Brightness Down' $(light -G)"
bindsym shift+$mod+bracketright exec "light -A 25; notify-send 'Brightness Up' $(light -G)" bindsym shift+$mod+bracketright exec --no-startup-id "light -A 25; notify-send 'Brightness Up' $(light -G)"
bindsym XF86MonBrightnessUp exec "light -A 5; notify-send 'Brightness Up' $(light -G)" # Also get the actual brightness keys to work!!
bindsym XF86MonBrightnessDown exec "light -U 5; notify-send 'Brightness Down' $(light -G)" bindsym XF86MonBrightnessUp exec --no-startup-id "light -A 5; notify-send 'Brightness Up' $(light -G)"
bindsym shift+XF86MonBrightnessUp exec l"ight -A 25; notify-send 'Brightness Up' $(light -G)" bindsym XF86MonBrightnessDown exec --no-startup-id "light -U 5; notify-send 'Brightness Down' $(light -G)"
bindsym shift+XF86MonBrightnessDown exec l"ight -U 25; notify-send 'Brightness Down' $(light -G)" bindsym shift+XF86MonBrightnessUp exec --no-startup-id "light -A 25; notify-send 'Brightness Up' $(light -G)"
bindsym shift+XF86MonBrightnessDown exec --no-startup-id "light -U 25; notify-send 'Brightness Down' $(light -G)"
## Volume ##
# 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 Down" $(vol-d)'
bindsym $mod+period exec --no-startup-id bash -c "source /usr/local/bin/volume.function && volume +5 && notify-send 'Volume Up' $(vol-d)"
bindsym shift+$mod+comma exec --no-startup-id bash -c "source /usr/local/bin/volume.function && volume -25 && notify-send 'Volume Down' $(vol-d)"
bindsym shift+$mod+period exec --no-startup-id bash -c "source /usr/local/bin/volume.function && volume +25 && notify-send 'Volume Up' $(vol-d)"
# Actual volume keys.
bindsym XF86AudioMute exec --no-startup-id bash -c "source /usr/local/bin/volume.function && volume mute && notify-send 'Volume Muted' $(vol-d)"
bindsym XF86AudioRaiseVolume exec --no-startup-id bash -c "source /usr/local/bin/volume.function && volume +5 && notify-send 'Volume Up' $(vol-d)"
bindsym XF86AudioLowerVolume exec --no-startup-id bash -c "source /usr/local/bin/volume.function && volume -5 && notify-send 'Volume Down' $(vol-d)"
bindsym shift+XF86AudioRaiseVolume exec --no-startup-id bash -c "source /usr/local/bin/volume.function && volume +25 && notify-send 'Volume Up' $(vol-d)"
bindsym shift+XF86AudioLowerVolume exec --no-startup-id bash -c "source /usr/local/bin/volume.function && volume -25 && notify-send 'Volume Down' $(vol-d)"
# 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.
# We use variables to avoid repeating the names in multiple places. # We use variables to avoid repeating the names in multiple places.
+22
View File
@@ -45,3 +45,25 @@
owner: "{{ user }}" owner: "{{ user }}"
group: "{{ user }}" group: "{{ user }}"
mode: '0664' mode: '0664'
# TBD: Automate getting the brightness keys to work.
#
# User is already part of the video group. Just need to configure udev rules.
#
# Get the folder name from here: `ls /sys/class/backlight/`
#
# That is your <DEVICE> for the following lines, which go here: /etc/udev/rules.d/backlight.rules
# ACTION=="add", SUBSYSTEM=="backlight", KERNEL=="<DEVICE>", RUN+="/bin/chgrp video /sys/class/backlight/%k/brightness"
# ACTION=="add", SUBSYSTEM=="backlight", KERNEL=="<DEVICE>", RUN+="/bin/chmod g+w /sys/class/backlight/%k/brightness"
#
# So, for example:
# [18:12:20 root@device ~]# cat /etc/udev/rules.d/backlight.rules
# ACTION=="add", SUBSYSTEM=="backlight", KERNEL=="intel_backlight", RUN+="/bin/chgrp video /sys/class/backlight/%k/brightness"
# ACTION=="add", SUBSYSTEM=="backlight", KERNEL=="intel_backlight", RUN+="/bin/chmod g+w /sys/class/backlight/%k/brightness"
# [18:12:21 root@device ~]#
#
# It then required a reboot. Doing the commands below was not enough.
#
# # sudo udevadm control --reload-rules ^C
# # sudo udevadm trigger
#