add a bunch of sway stuff

This commit is contained in:
Mark Riedesel 2024-06-12 11:42:25 -05:00
parent e0d58c813d
commit 2ac99db38b
15 changed files with 521 additions and 0 deletions

103
.config/sway/modes/default Normal file
View file

@ -0,0 +1,103 @@
# quick-launch
$bindsym $mod+Return exec kitty
$bindsym $mod+Home exec thunar
$bindsym $mod+b exec firefox
$bindsym $mod+d exec --no-startup-id ~/bin/launcher
# quick-access screenshot
$bindsym $mod+g exec $screenshot_selection
$bindsym $mod+Shift+g exec $screenshot_selection
# session actions
$bindsym $mod+Shift+c reload
$bindsym $mod+Shift+r restart
# window bindings and behavior
floating_modifier $mod
focus_follows_mouse no
# kill focused window
$bindsym $mod+Shift+q kill
# move window focus (Vim style)
$bindsym $mod+h focus left
$bindsym $mod+j focus down
$bindsym $mod+k focus up
$bindsym $mod+l focus right
# move window focus (with arrow keys)
$bindsym $mod+Left focus left
$bindsym $mod+Down focus down
$bindsym $mod+Up focus up
$bindsym $mod+Right focus right
# move window (Vim style)
$bindsym $mod+Shift+h move left
$bindsym $mod+Shift+j move down
$bindsym $mod+Shift+k move up
$bindsym $mod+Shift+l move right
# move window (with arrow keys)
$bindsym $mod+Shift+Left move left
$bindsym $mod+Shift+Down move down
$bindsym $mod+Shift+Up move up
$bindsym $mod+Shift+Right move right
# container layout (stacked, tabbed, toggle split)
$bindsym $mod+s layout stacking
$bindsym $mod+w layout tabbed
$bindsym $mod+e layout toggle split
# splits
$bindsym $mod+u split h
$bindsym $mod+i split v
# fullscreen
$bindsym $mod+f fullscreen
# toggle tiling/floating
$bindsym $mod+Shift+space floating toggle
# toggle focus between tiling/floating
$bindsym $mod+space focus mode_toggle
# focus parent container
$bindsym $mod+a focus parent
# switch to specific workspace
$bindsym $mod+1 workspace 1
$bindsym $mod+2 workspace 2
$bindsym $mod+3 workspace 3
$bindsym $mod+4 workspace 4
$bindsym $mod+5 workspace 5
$bindsym $mod+6 workspace 6
$bindsym $mod+7 workspace 7
$bindsym $mod+8 workspace 8
$bindsym $mod+9 workspace 9
$bindsym $mod+0 workspace 10
# move focused container to workspace
$bindsym $mod+Shift+1 move container to workspace 1
$bindsym $mod+Shift+2 move container to workspace 2
$bindsym $mod+Shift+3 move container to workspace 3
$bindsym $mod+Shift+4 move container to workspace 4
$bindsym $mod+Shift+5 move container to workspace 5
$bindsym $mod+Shift+6 move container to workspace 6
$bindsym $mod+Shift+7 move container to workspace 7
$bindsym $mod+Shift+8 move container to workspace 8
$bindsym $mod+Shift+9 move container to workspace 9
$bindsym $mod+Shift+0 move container to workspace 10
# move focus to adjacent output
$bindsym $mod+bracketleft focus output left
$bindsym $mod+bracketright focus output right
# jump to workspace on same output
$bindsym $mod+Shift+bracketleft workspace prev_on_output
$bindsym $mod+Shift+bracketright workspace next_on_output
# scale entire display
$bindsym $alt_mod+plus exec $scale_up
$bindsym $alt_mod+minus exec $scale_down
$bindsym $mod+Shift+i exec inhibit-idle interactive

View file

@ -0,0 +1,19 @@
set $mode_recording "<span foreground='$color10'></span> \
<span foreground='$color5'><b>Record</b></span> <span foreground='$color10'>(<b>r</b>)</span> \
<span foreground='$color5'>+ [<span foreground='$color10'><b>Shift</b></span> for 󰍮]</span>"
set $recorder /usr/share/sway/scripts/recorder.sh
mode --pango_markup $mode_recording {
$bindsym r exec $recorder, mode "default"
$bindsym Shift+r exec $recorder -a, mode "default"
# Return to default mode.
$bindsym Escape mode "default"
}
## Launch // Recording Mode ##
$bindsym $mod+Shift+r mode $mode_recording
## Launch // Stop Recording Mode ##
$bindsym $mod+Escape exec killall -s SIGINT wf-recorder

17
.config/sway/modes/resize Normal file
View file

@ -0,0 +1,17 @@
mode "resize" {
$bindsym h resize shrink width 10 px or 10 ppt
$bindsym j resize grow height 10 px or 10 ppt
$bindsym k resize shrink height 10 px or 10 ppt
$bindsym l resize grow width 10 px or 10 ppt
# same bindings, but for the arrow keys
$bindsym Left resize shrink width 10 px or 10 ppt
$bindsym Down resize grow height 10 px or 10 ppt
$bindsym Up resize shrink height 10 px or 10 ppt
$bindsym Right resize grow width 10 px or 10 ppt
# back to normal: Enter or Escape
$bindsym Return mode "default"
$bindsym Escape mode "default"
}
$bindsym $mod+r mode "resize"

View file

@ -0,0 +1,20 @@
set $mode_screenshot "<span foreground='$color10'>󰄄</span> \
<span foreground='$color5'><b>Pick</b></span> <span foreground='$color10'>(<b>p</b>)</span> \
<span foreground='$color5'><b>Output</b></span> <span foreground='$color10'>(<b>o</b>)</span> \
<span foreground='$color7'>+ <span foreground='$color10'><b>Shift</b></span> for </span>"
mode --pango_markup $mode_screenshot {
# output = currently active output
$bindsym o mode "default", exec $screenshot_screen
$bindsym Shift+o mode "default", exec $screenshot_screen_upload
# pick the region to screenshot
$bindsym p mode "default", exec $screenshot_selection
$bindsym Shift+p mode "default", exec $screenshot_selection_upload
# Return to default mode.
$bindsym Escape mode "default"
}
## Launch // Screenshot Mode ##
$bindsym Print mode $mode_screenshot

View file

@ -0,0 +1,34 @@
set $mode_shutdown "\
<span foreground='$color10'></span> \
<span foreground='$color5'> \
<span foreground='$color10'>(<b>l</b>)</span>lock \
<span foreground='$color10'>(<b>e</b>)</span>logout \
<span foreground='$color10'>(<b>r</b>)</span>reboot \
<span foreground='$color10'>(<b>u</b>)</span>suspend \
<span foreground='$color10'>(<b>s</b>)</span>shutdown \
</span>"
set $purge_cliphist [ $purge_cliphist_logout == 'true' ] && rm -f $HOME/.cache/cliphist/db || exit 0
mode --pango_markup $mode_shutdown {
# lock
$bindsym l mode "default", exec $locking
# logout
$bindsym e exec $purge_cliphist; exec swaymsg exit
# suspend
$bindsym u mode "default", exec systemctl suspend
# shutdown
$bindsym s exec $purge_cliphist; exec systemctl poweroff
# reboot
$bindsym r exec $purge_cliphist; exec systemctl reboot
# Return to default mode.
$bindsym Escape mode "default"
}
## Launch // Exit Menu ##
$bindsym $mod+Shift+e mode $mode_shutdown