summaryrefslogtreecommitdiff
path: root/.config/sway
diff options
context:
space:
mode:
Diffstat (limited to '.config/sway')
-rwxr-xr-x.config/sway/bin/workspace-add14
-rw-r--r--.config/sway/config8
2 files changed, 19 insertions, 3 deletions
diff --git a/.config/sway/bin/workspace-add b/.config/sway/bin/workspace-add
new file mode 100755
index 0000000..42c9e7b
--- /dev/null
+++ b/.config/sway/bin/workspace-add
@@ -0,0 +1,14 @@
+#!/bin/zsh
+
+CUR_WORKSPACE=$(swaymsg -t get_workspaces | jq -r '. | sort_by(.num) | map(.num) | .[]')
+
+previous=0
+while IFS= read -r n; do
+ if (( n != previous + 1 )) ; then
+ NEW_WORKSPACE=$(( previous + 1 ))
+ break
+ fi
+ previous=$n
+done <<< "$CUR_WORKSPACE"
+
+swaymsg workspace number $NEW_WORKSPACE
diff --git a/.config/sway/config b/.config/sway/config
index c6ec2ba..f9ebe17 100644
--- a/.config/sway/config
+++ b/.config/sway/config
@@ -119,9 +119,9 @@ include $HOME/.config/sway/input
# Audio
#
- bindsym XF86AudioMute exec amixer set Master toggle
- bindsym XF86AudioLowerVolume exec amixer set Master 5%-
- bindsym XF86AudioRaiseVolume exec amixer set Master 5%+
+ bindsym XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggle
+ bindsym XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -3%
+ bindsym XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +3%
#
# Screenshot
@@ -202,6 +202,8 @@ include $HOME/.config/sway/input
bindsym $mod+Shift+Alt+0 move container to workspace number 20
# Note: workspaces can have any name you want, not just numbers.
# We just use 1-10 as the default.
+
+ bindsym Alt+Return exec $HOME/.config/sway/bin/workspace-add
#
# Layout stuff:
#