Skip to content

Commit

Permalink
Add audio and brightness controll
Browse files Browse the repository at this point in the history
  • Loading branch information
DO1JLR committed Jul 19, 2024
1 parent f93380d commit 7e988b5
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
45 changes: 45 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,51 @@ sway__keyboard_lang: 'de'
sway__lock: 'swaylock --color 000000 --image /usr/share/backgrounds/sway/Sway_Wallpaper_Blue_1920x1080.png'
sway__waybar: true

sway__keybindings:
- keybinding:

Check failure on line 23 in defaults/main.yml

View workflow job for this annotation

GitHub Actions / Ansible Lint

yaml[indentation]

Wrong indentation: expected 2 but found 1

Check failure on line 23 in defaults/main.yml

View workflow job for this annotation

GitHub Actions / Yamllint

23:2 [indentation] wrong indentation: expected 2 but found 1
name: Volume (mute/unmute)
key: $mod+F12
exec: --no-startup-id pulsemixer --toggle-mute
- keybinding:
name: Volue (default)
key: $mod+Shift+F12
exec: --no-startup-id pulsemixer --set-volume 42
- keybinding:
name: volume-up
key: XF86AudioRaiseVolume
exec: --no-startup-id pulsemixer --change-volume +3
- keybinding:
name: volume-down
key: XF86AudioLowerVolume
exec: --no-startup-id pulsemixer --change-volume -5
- keybinding:
name: Toggle Mic Mute
key: XF86AudioMicMute
exec: '--no-startup-id pulsemixer --toggle-mute --id $(pulsemixer --list-sources | cut -f3 | grep Default | cut -d "," -f 1 | cut -c 6-)'
- keybinding:
name: Mic volume up
key: $mod+Shift+F4
exec: '--no-startup-id pulsemixer --change-volume +3 --id $(pulsemixer --list-sources | cut -f3 | grep Default | cut -d "," -f 1 | cut -c 6-)'
- keybinding:
name: Mic volume down
key: $mod+F4
exec: '--no-startup-id pulsemixer --change-volume -5 --id $(pulsemixer --list-sources | cut -f3 | grep Default | cut -d "," -f 1 | cut -c 6-)'
- keybinding:
name: Toggle Mic Mute
key: XF86AudioMute
exec: --no-startup-id pulsemixer --toggle-mute
- keybinding:
name: darker
key: XF86MonBrightnessDown
exec: --no-startup-id light -U 9
- keybinding:
name: lighter
key: XF86MonBrightnessUp
exec: --no-startup-id light -A 6

sway__keybindings_extra: []


# version check for this role?
submodules_versioncheck: true

Expand Down
11 changes: 11 additions & 0 deletions templates/config.j2
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,17 @@ mode "resize" {
}
bindsym $mod+r mode "resize"

# Register default keybindings
{% for keybinding in sway__keybindings %}
bindsym {{ keybinding.key }} exec {{ keybinding.exec }}
{% endfor %}

# Register additional keybindings
{% for keybinding in sway__keybindings_extra %}
bindsym {{ keybinding.key }} exec {{ keybinding.exec }}
{% endfor %}


#
# Status Bar:
#
Expand Down

0 comments on commit 7e988b5

Please sign in to comment.