config (8658B)
1 # Default config for sway 2 # 3 # Copy this to ~/.config/sway/config and edit it to your liking. 4 # 5 # Read `man 5 sway` for a complete reference. 6 7 8 ############################################################ 9 # Startup 10 11 # Configure Xresources settings. 12 exec xrdb ~/.config/Xresources 13 14 # Launch IME. 15 exec fcitx5 -d -r 16 17 # Start up Mako notification system 18 exec mako 19 20 # Set the window title font. 21 font pango:IPAGothic 14, DejaVu Sans Mono 12 22 23 24 ############################################################ 25 # Variables 26 27 # Logo key. Use Mod1 for Alt. 28 set $mod Mod4 29 30 # Home row direction keys, like vim. 31 set $left h 32 set $down j 33 set $up k 34 set $right l 35 36 # Your preferred terminal emulator. 37 set $term alacritty 38 39 # Your preferred application launcher. 40 # Note: it's recommended that you pass the final command to sway. 41 set $menu wofi --show run 42 43 # Set lock screen handler. 44 set $lock_screen swaylock -f -c 000000 45 46 # Set the suspend command. 47 set $suspend_system systemctl suspend 48 49 50 ############################################################ 51 # Idle configuration 52 53 # Lock screen after 600 seconds of inactivity, then turn off displays after 54 # another 60 seconds, then put the computer to sleep 60 seconds after that. 55 # Turn screens back on when resumed. Also ensure the screen is locked before 56 # the computer goes to sleep. 57 exec swayidle -w \ 58 timeout 600 '$lock_screen' \ 59 timeout 660 '$suspend_system' \ 60 before-sleep '$lock_screen' 61 62 63 ############################################################ 64 # Output configuration 65 # 66 # Example configuration: 67 # 68 # output HDMI-A-1 resolution 1920x1080 position 1920,0 69 # 70 # You can get the names of your outputs by running: swaymsg -t get_outputs 71 72 # Default wallpaper (more resolutions in /usr/share/backgrounds/sway/). 73 output * bg ~/Pictures/Desktops/current.png fill 74 75 76 ############################################################ 77 # Input configuration 78 # 79 # Example configuration: 80 # 81 # input "2:14:SynPS/2_Synaptics_TouchPad" { 82 # dwt enabled 83 # tap enabled 84 # natural_scroll enabled 85 # middle_emulation enabled 86 # } 87 # 88 # You can get the names of your inputs by running: swaymsg -t get_inputs. 89 # Read `man 5 sway-input` for more information about this section. 90 91 input * { 92 # Use US keyboard layout (jp for Japanese layout) use caps as control, 93 # right alt as AltGr/Compose for accents. 94 xkb_layout jp 95 xkb_options ctrl:nocaps,compose:ralt 96 repeat_delay 500 97 repeat_rate 25 98 99 # Use natural mouse-wheel scrolling. 100 natural_scroll enabled 101 } 102 103 104 ############################################################ 105 # Key bindings: Basics 106 107 # Start a terminal. 108 bindsym $mod+Return exec $term 109 110 # Kill focused window. 111 bindsym $mod+Shift+q kill 112 113 # Start the launcher. 114 bindsym $mod+d exec $menu 115 116 # Drag floating windows by holding down $mod and left mouse button. 117 # Resize them with right mouse button + $mod. 118 # Despite the name, also works for non-floating windows. 119 # Change normal to inverse to use left mouse button for resizing and right 120 # mouse button for dragging. 121 floating_modifier $mod normal 122 123 # Capture a screenshot. 124 set $grimshot ~/.local/bin/grimshot 125 set $screenshots ~/Pictures/Screenshots 126 bindsym $mod+Shift+s exec $grimshot --notify save screen \ 127 $screenshots/Screenshot_$(date +"%Y-%m-%d_%H.%M.%S.png") 128 bindsym $mod+Control+Shift+s exec $grimshot --notify save area \ 129 $screenshots/Screenshot_$(date +"%Y-%m-%d_%H.%M.%S.png") 130 131 # Reload the configuration file. 132 bindsym $mod+Shift+c reload 133 134 # Lock the screen. 135 bindsym Control+$mod+l exec $lock_screen 136 137 # Exit sway (logs you out of your Wayland session). 138 bindsym $mod+Shift+e exec ~/.config/sway/exit_check.sh 139 140 141 ############################################################ 142 # Key bindings: Volume/Brightness 143 144 # OS-specific behaviour in ~/.local/bin/volumectl script. 145 set $volume_up volumectl up 5 146 set $volume_down volumectl down 5 147 set $volume_toggle_mute volumectl mute 148 set $volume_toggle_mic_mute volumectl muteinput 149 150 # Increase and decrease volume. 151 bindsym Control+$mod+F12 exec $volume_up 152 bindsym Control+$mod+F11 exec $volume_down 153 154 155 ############################################################ 156 # Key bindings: Moving around 157 158 # Move your focus around. 159 bindsym $mod+$left focus left 160 bindsym $mod+$down focus down 161 bindsym $mod+$up focus up 162 bindsym $mod+$right focus right 163 # Or use $mod+[up|down|left|right]. 164 bindsym $mod+Left focus left 165 bindsym $mod+Down focus down 166 bindsym $mod+Up focus up 167 bindsym $mod+Right focus right 168 169 # Move the focused window with the same, but add Shift 170 bindsym $mod+Shift+$left move left 171 bindsym $mod+Shift+$down move down 172 bindsym $mod+Shift+$up move up 173 bindsym $mod+Shift+$right move right 174 # Ditto, with arrow keys 175 bindsym $mod+Shift+Left move left 176 bindsym $mod+Shift+Down move down 177 bindsym $mod+Shift+Up move up 178 bindsym $mod+Shift+Right move right 179 180 181 ############################################################ 182 # Key bindings: Workspaces 183 184 # Switch to workspace. 185 bindsym $mod+1 workspace 1 186 bindsym $mod+2 workspace 2 187 bindsym $mod+3 workspace 3 188 bindsym $mod+4 workspace 4 189 bindsym $mod+5 workspace 5 190 bindsym $mod+6 workspace 6 191 bindsym $mod+7 workspace 7 192 bindsym $mod+8 workspace 8 193 bindsym $mod+9 workspace 9 194 bindsym $mod+0 workspace 10 195 196 # Move focused container to workspace. 197 bindsym $mod+Shift+1 move container to workspace 1 198 bindsym $mod+Shift+2 move container to workspace 2 199 bindsym $mod+Shift+3 move container to workspace 3 200 bindsym $mod+Shift+4 move container to workspace 4 201 bindsym $mod+Shift+5 move container to workspace 5 202 bindsym $mod+Shift+6 move container to workspace 6 203 bindsym $mod+Shift+7 move container to workspace 7 204 bindsym $mod+Shift+8 move container to workspace 8 205 bindsym $mod+Shift+9 move container to workspace 9 206 bindsym $mod+Shift+0 move container to workspace 10 207 208 209 ############################################################ 210 # Key bindings: Layout 211 212 # You can "split" the current object of your focus with $mod+b or $mod+v, for 213 # horizontal and vertical splits respectively. This moves focus to the window 214 # to split; to return focus to the parent container, use $mod+a. 215 bindsym $mod+b splith 216 bindsym $mod+v splitv 217 # Ditto, but with $mod-; and $mod-Shift-;. 218 bindsym $mod+Shift+semicolon splith 219 bindsym $mod+semicolon splitv 220 221 # Switch the current container between different layout styles. 222 bindsym $mod+s layout stacking 223 bindsym $mod+w layout tabbed 224 bindsym $mod+e layout toggle split 225 226 # Make the current focus fullscreen. 227 bindsym $mod+f fullscreen 228 229 # Toggle the current focus between tiling and floating mode. 230 bindsym $mod+Shift+space floating toggle 231 232 # Swap focus between the tiling area and the floating area. 233 bindsym $mod+space focus mode_toggle 234 235 # Move focus to the parent container. 236 bindsym $mod+a focus parent 237 238 239 ############################################################ 240 # Key bindings: Scratchpad 241 # 242 # Sway has a "scratchpad", which is a bag of holding for windows. 243 # You can send windows there and get them back later. 244 # Scratchpad windows are floating, so you can restore them to normal by 245 # toggling the floating mode. 246 247 # Move the currently focused window to the scratchpad. 248 bindsym $mod+Shift+minus move scratchpad 249 250 # Show the next scratchpad window or hide the focused scratchpad window. 251 # If there are multiple scratchpad windows, this command cycles through them. 252 bindsym $mod+minus scratchpad show 253 254 255 ############################################################ 256 # Key bindings: Resizing containers 257 258 mode "resize" { 259 # Shrink or grow the container's width, height. 260 bindsym $left resize shrink width 10px 261 bindsym $down resize shrink height 10px 262 bindsym $up resize grow height 10px 263 bindsym $right resize grow width 10px 264 265 # Ditto, with arrow keys. 266 bindsym Left resize shrink width 10px 267 bindsym Down resize shrink height 10px 268 bindsym Up resize grow height 10px 269 bindsym Right resize grow width 10px 270 271 # Return to default mode on Return or Esc. 272 bindsym Return mode "default" 273 bindsym Escape mode "default" 274 } 275 bindsym $mod+r mode "resize" 276 277 278 ############################################################ 279 # Status Bar 280 # 281 # Read `man 5 sway-bar` for more information about this section. 282 283 bar { 284 position top 285 pango_markup disabled 286 font pango:IPAGothic 16, DejaVu Sans Mono 14 287 288 # When the status_command prints a new line to stdout, swaybar updates. 289 # The default just shows the current date and time. 290 status_command while ~/.config/sway/custom_statusbar; do sleep 1; done 291 292 colors { 293 statusline #ffffff 294 background #323232 295 inactive_workspace #32323200 #32323200 #5c5c5c 296 } 297 } 298 299 include /etc/sway/config.d/* 300 include ~/.config/sway/config.d/* 301 include ~/.config/sway/`hostname`