neodotfiles/config/sway/modules/binds

245 lines
9.6 KiB
Text
Raw Normal View History

2023-10-25 11:20:57 +00:00
# Logo key. Use Mod1 for Alt.
set $mod Mod4
# Home row direction keys, like vim
set $left h
set $down j
set $up k
set $right l
# Apps
2024-08-19 04:36:33 +00:00
set $term foot
2024-09-04 15:16:11 +00:00
set $chat flatpak run org.signal.Signal
2023-10-29 14:25:32 +00:00
set $office flatpak run org.libreoffice.LibreOffice
2024-10-24 02:58:53 +00:00
set $passwords flatpak run com.bitwarden.desktop
set $notes flatpak run net.cozic.joplin_desktop
2024-11-10 11:48:53 +00:00
set $browser $BROWSER
set $vm flatpak run org.gnome.Boxes
2024-08-19 04:36:33 +00:00
set $file foot -T yazi -a yazi yazi
2024-11-10 11:48:53 +00:00
set $editor $VISUAL
set $music foot -T cmus -a cmus cmus
2024-08-22 00:44:58 +00:00
set $rss foot -T newsboat -a newsboat newsboat
2024-08-19 04:36:33 +00:00
set $ani-cli foot -T ani-cli -a ani-cli ani-cli
2024-08-24 16:06:24 +00:00
set $ytfzf foot -T ytfzf -a ytfzf ytfzf -flstT chafa
set $ytfzf-music foot -T ytfzf-music -a ytfzf-music ytfzf -mlstT chafa
2024-08-19 04:36:33 +00:00
set $flix-cli foot -T flix-cli -a flix-cli flix-cli
2024-10-24 02:58:53 +00:00
set $audiomixer foot -T pulsemixer -a pulsemixer pulsemixer
set $monitor foot -T btop -a btop btop
2023-10-25 11:20:57 +00:00
# JetBrains IDEs
set $rider ~/.local/share/JetBrains/Toolbox/scripts/rider
set $idea ~/.local/share/JetBrains/Toolbox/scripts/idea
set $clion ~/.local/share/JetBrains/Toolbox/scripts/clion
set $goland ~/.local/share/JetBrains/Toolbox/scripts/goland
set $rustrover ~/.local/share/JetBrains/Toolbox/scripts/rustrover
set $webstorm ~/.local/share/JetBrains/Toolbox/scripts/webstorm
set $pycharm ~/.local/share/JetBrains/Toolbox/scripts/pycharm
set $datagrip ~/.local/share/JetBrains/Toolbox/scripts/datagrip
2023-10-25 11:20:57 +00:00
# Your preferred application launcher
# Note: pass the final command to swaymsg so that the resulting window can be opened
# on the original workspace that the command was run on.
set $menu fuzzel | xargs swaymsg exec --
2024-08-19 04:36:33 +00:00
set $menu-wifi ~/.config/fuzzel/scripts/rs_wifi | xargs swaymsg exec --
set $menu-power ~/.config/fuzzel/scripts/rs_power | xargs swaymsg exec --
set $menu-emoji ~/.config/fuzzel/scripts/rs_emoji | xargs swaymsg exec --
set $menu-wall ~/.config/fuzzel/scripts/rs_wall | xargs swaymsg exec --
set $menu-scrot ~/.config/fuzzel/scripts/rs_scrot | xargs swaymsg exec --
set $menu-blue ~/.config/fuzzel/scripts/rs_blue | xargs swaymsg exec --
set $menu-clip ~/.config/fuzzel/scripts/rs_clip | xargs swaymsg exec --
2023-10-25 11:20:57 +00:00
# Start a terminal
bindsym $mod+Return exec $term
# Kill focused window
bindsym $mod+q kill
2023-10-26 19:38:27 +00:00
# XF86 Keys
bindsym XF86AudioRaiseVolume exec pamixer -i 5 && pamixer --get-volume > /tmp/wobpipe
bindsym XF86AudioLowerVolume exec pamixer -d 5 && pamixer --get-volume > /tmp/wobpipe
bindsym XF86AudioMute exec sh -c 'pamixer -t && if [ "$(pamixer --get-mute)" = "true" ]; then echo "$(pamixer --get-volume) muted" > /tmp/wobpipe; else pamixer --get-volume > /tmp/wobpipe; fi'
2024-08-24 16:06:24 +00:00
bindsym XF86AudioMicMute exec pamixer --default-source -t
2023-10-26 19:38:27 +00:00
bindsym XF86AudioPause exec playerctl play-pause
bindsym XF86AudioPlay exec playerctl play-pause
bindsym XF86AudioNext exec playerctl next
bindsym XF86AudioPrev exec playerctl previous
bindsym XF86AudioStop exec playerctl stop
bindsym XF86MonBrightnessUp exec sh -c 'brightnessctl s 5%+ && brightnessctl -m | cut -d, -f4 | tr -d % > /tmp/wobpipe'
bindsym XF86MonBrightnessDown exec sh -c 'brightnessctl s 5%- && brightnessctl -m | cut -d, -f4 | tr -d % > /tmp/wobpipe'
2024-08-22 00:44:58 +00:00
bindsym XF86News exec $rss
2023-10-25 11:20:57 +00:00
# Drag floating windows by holding down $mod and left mouse button.
# Resize them with right mouse button + $mod.
# Despite the name, also works for non-floating windows.
# Change normal to inverse to use left mouse button for resizing and right
# mouse button for dragging.
floating_modifier $mod normal
# Reload the configuration file
bindsym $mod+Shift+Ctrl+r reload
# Exit sway (logs you out of your Wayland session)
bindsym $mod+Shift+Ctrl+q exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -B 'Yes, exit sway' 'swaymsg exit'
### Moving around:
# Move your focus around
bindsym $mod+$left focus left
bindsym $mod+$down focus down
bindsym $mod+$up focus up
bindsym $mod+$right focus right
# Or use $mod+[up|down|left|right]
bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus right
# Move the focused window with the same, but add Shift
bindsym $mod+Shift+$left move left
bindsym $mod+Shift+$down move down
bindsym $mod+Shift+$up move up
bindsym $mod+Shift+$right move right
# Ditto, 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
### Workspaces:
# Switch to workspace
bindsym $mod+1 workspace number 1
bindsym $mod+2 workspace number 2
bindsym $mod+3 workspace number 3
bindsym $mod+4 workspace number 4
bindsym $mod+5 workspace number 5
bindsym $mod+6 workspace number 6
bindsym $mod+7 workspace number 7
bindsym $mod+8 workspace number 8
bindsym $mod+9 workspace number 9
bindsym $mod+0 workspace number 10
# Move focused container to workspace
2024-08-19 04:36:33 +00:00
bindsym $mod+Shift+1 [con_id=__focused__] move container to workspace number 1, focus
bindsym $mod+Shift+2 [con_id=__focused__] move container to workspace number 2, focus
bindsym $mod+Shift+3 [con_id=__focused__] move container to workspace number 3, focus
bindsym $mod+Shift+4 [con_id=__focused__] move container to workspace number 4, focus
bindsym $mod+Shift+5 [con_id=__focused__] move container to workspace number 5, focus
bindsym $mod+Shift+6 [con_id=__focused__] move container to workspace number 6, focus
bindsym $mod+Shift+7 [con_id=__focused__] move container to workspace number 7, focus
bindsym $mod+Shift+8 [con_id=__focused__] move container to workspace number 8, focus
bindsym $mod+Shift+9 [con_id=__focused__] move container to workspace number 9, focus
bindsym $mod+Shift+0 [con_id=__focused__] move container to workspace number 10, focus
2023-10-25 11:20:57 +00:00
# Note: workspaces can have any name you want, not just numbers.
# We just use 1-10 as the default.
### Layout stuff:
# You can "split" the current object of your focus with
2024-08-22 00:44:58 +00:00
# $mod+s or $mod+v, for horizontal and vertical splits
2023-10-25 11:20:57 +00:00
# respectively.
2024-08-22 00:44:58 +00:00
mode "split" {
bindsym v splith; mode "default"
bindsym s splitv; mode "default"
bindsym Return mode "default"
bindsym Escape mode "default"
}
bindsym $mod+w mode "split"
2023-10-25 11:20:57 +00:00
# Switch the current container between different layout styles
2024-08-22 00:44:58 +00:00
mode "layout" {
bindsym s layout stacking; mode "default"
bindsym w layout tabbed; mode "default"
bindsym t layout toggle split; mode "default"
bindsym f fullscreen; mode "default"
bindsym Return mode "default"
bindsym Escape mode "default"
}
bindsym $mod+e mode "layout"
2023-10-25 11:20:57 +00:00
# Toggle the current focus between tiling and floating mode
2024-08-19 04:36:33 +00:00
bindsym $mod+Alt+space floating toggle
2023-10-25 11:20:57 +00:00
# Swap focus between the tiling area and the floating area
bindsym $mod+space focus mode_toggle
# Move focus to the parent container
2023-10-26 19:38:27 +00:00
bindsym $mod+Shift+Return focus parent
2023-10-25 11:20:57 +00:00
### Scratchpad:
# Sway has a "scratchpad", which is a bag of holding for windows.
# You can send windows there and get them back later.
# Move the currently focused window to the scratchpad
2024-08-22 00:44:58 +00:00
bindsym $mod+Shift+s move scratchpad
2023-10-25 11:20:57 +00:00
# Show the next scratchpad window or hide the focused scratchpad window.
# If there are multiple scratchpad windows, this command cycles through them.
2024-08-22 00:44:58 +00:00
bindsym $mod+s scratchpad show
2023-10-25 11:20:57 +00:00
### Resizing containers:
mode "resize" {
# left will shrink the containers width
# right will grow the containers width
# up will shrink the containers height
# down will grow the containers height
bindsym $left resize shrink width 10px
bindsym $down resize grow height 10px
bindsym $up resize shrink height 10px
bindsym $right resize grow width 10px
# Ditto, with arrow keys
bindsym Left resize shrink width 10px
bindsym Down resize grow height 10px
bindsym Up resize shrink height 10px
bindsym Right resize grow width 10px
# Return to default mode
bindsym Return mode "default"
bindsym Escape mode "default"
}
bindsym $mod+r mode "resize"
2023-10-26 19:38:27 +00:00
### Mode for launching apps
mode "apps" {
# Start apps
2024-08-22 00:44:58 +00:00
bindsym f exec $file; mode "default"
2023-10-26 19:38:27 +00:00
bindsym e exec $editor; mode "default"
bindsym w exec $browser; mode "default"
bindsym c exec $chat; mode "default"
2023-10-29 14:25:32 +00:00
bindsym o exec $office; mode "default"
2024-09-07 10:58:24 +00:00
bindsym n exec $notes; mode "default"
2023-10-26 19:38:27 +00:00
bindsym m exec $music; mode "default"
2024-08-22 00:44:58 +00:00
bindsym r exec $rss; mode "default"
2024-10-24 02:58:53 +00:00
bindsym p exec $passwords; mode "default"
bindsym v exec $vm; mode "default"
2024-08-22 00:44:58 +00:00
bindsym Shift+b exec $monitor; mode "default"
bindsym Shift+p exec $audiomixer; mode "default"
bindsym Shift+y exec $ytfzf; mode "default"
bindsym Shift+m exec $ytfzf-music; mode "default"
bindsym Shift+a exec $ani-cli; mode "default"
bindsym Shift+f exec $flix-cli; mode "default"
bindsym Ctrl+d exec $rider; mode "default"
bindsym Ctrl+i exec $idea; mode "default"
bindsym Ctrl+g exec $goland; mode "default"
bindsym Ctrl+r exec $rustrover; mode "default"
bindsym Ctrl+c exec $clion; mode "default"
bindsym Ctrl+w exec $webstorm; mode "default"
bindsym Ctrl+p exec $pycharm; mode "default"
bindsym Ctrl+t exec $datagrip; mode "default"
2023-10-26 19:38:27 +00:00
bindsym Return mode "default"
bindsym Escape mode "default"
}
bindsym $mod+a mode "apps"
2024-08-19 04:36:33 +00:00
# Run launcher scripts
2024-08-22 00:44:58 +00:00
mode "launcher" {
2024-08-19 04:36:33 +00:00
bindsym d exec $menu; mode "default"
bindsym q exec $menu-power; mode "default"
bindsym e exec $menu-emoji; mode "default"
bindsym w exec $menu-wall; mode "default"
bindsym s exec $menu-scrot; mode "default"
bindsym b exec $menu-blue; mode "default"
bindsym c exec $menu-clip; mode "default"
bindsym i exec $menu-wifi; mode "default"
bindsym Return mode "default"
bindsym Escape mode "default"
}
2024-08-22 00:44:58 +00:00
bindsym $mod+p mode "launcher"