From 449b5aba4dbd9c08277841cb51dd59e752496e86 Mon Sep 17 00:00:00 2001 From: Alex Kelly Date: Fri, 29 Nov 2024 16:07:04 -0500 Subject: [PATCH] migrate volume and brightness controls to swayosd --- autostart.conf | 8 ++++++-- conf.d/key_bindings.conf | 30 +++++++++++++++++++++--------- 2 files changed, 27 insertions(+), 11 deletions(-) diff --git a/autostart.conf b/autostart.conf index c375357..bc61b50 100644 --- a/autostart.conf +++ b/autostart.conf @@ -3,6 +3,7 @@ exec /home/kellya/bin/sway_screenshare.sh exec_always cat /proc/acpi/button/lid/LID/state | awk '{print $2}' | grep -q 'closed' && swaymsg output eDP-1 disable exec copyq --start-server +exec /usr/bin/swaync exec export YDOTOOL_SOCKET=/tmp/.ydotool_socket exec ydotoold @@ -30,13 +31,15 @@ exec "/usr/bin/flatpak run --branch=stable --arch=x86_64 --command=spotify --fil workspace $ws3 exec kitty -exec 1password +exec /home/kellya/.config/sway/scripts/i3-toolwait --nocheck --waitfor 1password 1password workspace $ws2 -exec /opt/teams-for-linux/teams-for-linux +exec "flatpak run com.slack.Slack" +exec "/opt/teams-for-linux/teams-for-linux --optInTeamsV2 true" # Always need firefox, so let's just start it workspace $ws1 exec firefox +#exec "swaymsg workspace $ws1; /home/kellya/.config/sway/scripts/i3-toolwait --nocheck --waitfor firefox firefox" # start the auto run .desktop files exec dex-autostart --autostart --environment sway @@ -49,3 +52,4 @@ exec dex-autostart --autostart --environment sway workspace $ws3 exec /home/kellya/bin/bg_rotate_sway.sh exec ~/.local/bin/solaar -w hide -b symbolic +exec swayosd-server diff --git a/conf.d/key_bindings.conf b/conf.d/key_bindings.conf index 8e5f89c..bd1558e 100644 --- a/conf.d/key_bindings.conf +++ b/conf.d/key_bindings.conf @@ -1,4 +1,4 @@ -# Keybindings +# keybindings # Note, this is for more of a "global" keybindings. Modes will have their own mode_whatever.conf keybinding bindsym $mod+Return exec kitty @@ -10,10 +10,16 @@ bindsym $mod+d exec /usr/local/bin/rofi -lines 12 -padding 18 -width 60 -locatio bindsym --border button2 kill -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 XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle && $refresh_i3status +#bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +10% && $refresh_i3status +bindsym XF86AudioRaiseVolume exec swayosd-client --output-volume raise +bindsym $mod+Up exec swayosd-client --output-volume raise +#bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -10% && $refresh_i3status +bindsym XF86AudioLowerVolume exec swayosd-client --output-volume lower +bindsym $mod+Down exec swayosd-client --output-volume lower +#bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle && $refresh_i3status +bindsym XF86AudioMute exec swayosd-client --output-volume mute-toggle +#bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle && $refresh_i3status +bindsym $mod+backslash exec swayosd-client --input-volume mute-toggle bindsym XF86AudioPause exec --no-startup-id mpc toggle #Bind media player buttons @@ -70,9 +76,9 @@ bindsym $mod+space focus mode_toggle bindsym $mod+a focus parent # bind up and down arrows to volume script -bindsym $mod+Up exec "~/bin/volume.sh up" -bindsym $mod+Down exec "~/bin/volume.sh down" -bindsym $mod+backslash exec "~/bin/volume.sh mtoggle" +#bindsym $mod+Up exec "~/bin/volume.sh up" +#bindsym $mod+Down exec "~/bin/volume.sh down" +#bindsym $mod+backslash exec "~/bin/volume.sh mtoggle" # $mod 0-9 to change workspace bindsym $mod+1 workspace number $ws1 @@ -110,4 +116,10 @@ bindswitch lid:on output eDP-1 disable bindswitch lid:off output eDP-1 enable # Notification key to bring up swaync -bindsym $mod+n "exec swaync-client -t" +bindsym $mod+Shift+n exec "/usr/bin/swaync-client -t" + +#Brightness +# Brightness raise +bindsym XF86MonBrightnessUp exec swayosd-client --brightness raise +# Brightness lower +bindsym XF86MonBrightnessDown exec swayosd-client --brightness lower