You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

269 lines
8.2 KiB

  1. # Read `man 5 sway` for a complete reference.
  2. ### Variables
  3. #
  4. # Mod4 = Logo key. Mod1 = Alt.
  5. # Using Mod1 for now since nothing better is available on the virtual keyboard.
  6. set $mod Mod1
  7. # Home row direction keys, like vim
  8. set $left h
  9. set $down j
  10. set $up k
  11. set $right l
  12. # Your preferred terminal emulator
  13. set $term termite
  14. # Your preferred application launcher
  15. # Note: pass the final command to swaymsg so that the resulting window can be opened
  16. # on the original workspace that the command was run on.
  17. set $menu bemenu-run -n -p RUN | xargs swaymsg exec --
  18. ### Output configuration
  19. #
  20. # Default wallpaper (more resolutions are available in /usr/share/backgrounds/sway/)
  21. output * bg /usr/share/backgrounds/sway/Sway_Wallpaper_Blue_1920x1080.png fill
  22. #
  23. # Example configuration:
  24. #
  25. # output HDMI-A-1 resolution 1920x1080 position 1920,0
  26. #
  27. # You can get the names of your outputs by running: swaymsg -t get_outputs
  28. ### Idle configuration
  29. #
  30. # Example configuration:
  31. #
  32. # exec swayidle -w \
  33. # timeout 300 'swaylock -f -c 000000' \
  34. # timeout 600 'swaymsg "output * dpms off"' \
  35. # resume 'swaymsg "output * dpms on"' \
  36. # before-sleep 'swaylock -f -c 000000'
  37. #
  38. # This will lock your screen after 300 seconds of inactivity, then turn off
  39. # your displays after another 300 seconds, and turn your screens back on when
  40. # resumed. It will also lock your screen before your computer goes to sleep.
  41. ### Input configuration
  42. #
  43. # Example configuration:
  44. #
  45. # input "2:14:SynPS/2_Synaptics_TouchPad" {
  46. # dwt enabled
  47. # tap enabled
  48. # natural_scroll enabled
  49. # middle_emulation enabled
  50. # }
  51. #
  52. # You can get the names of your inputs by running: swaymsg -t get_inputs
  53. # Read `man 5 sway-input` for more information about this section.
  54. ### Key bindings
  55. #
  56. # Basics:
  57. #
  58. # Start a terminal
  59. bindsym $mod+Return exec $term
  60. # Kill focused window
  61. bindsym $mod+q kill
  62. # Start your launcher
  63. bindsym $mod+d exec $menu
  64. # Drag floating windows by holding down $mod and left mouse button.
  65. # Resize them with right mouse button + $mod.
  66. # Despite the name, also works for non-floating windows.
  67. # Change normal to inverse to use left mouse button for resizing and right
  68. # mouse button for dragging.
  69. floating_modifier $mod normal
  70. # Reload the configuration file
  71. bindsym $mod+Ctrl+c reload
  72. # Exit sway (logs you out of your Wayland session)
  73. bindsym $mod+Shift+e 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'
  74. #
  75. # Moving around:
  76. #
  77. # Move your focus around
  78. bindsym $mod+$left focus left
  79. bindsym $mod+$down focus down
  80. bindsym $mod+$up focus up
  81. bindsym $mod+$right focus right
  82. # Or use $mod+[up|down|left|right]
  83. bindsym $mod+Left focus left
  84. bindsym $mod+Down focus down
  85. bindsym $mod+Up focus up
  86. bindsym $mod+Right focus right
  87. # Move the focused window with the same, but add Shift
  88. bindsym $mod+Shift+$left move left
  89. bindsym $mod+Shift+$down move down
  90. bindsym $mod+Shift+$up move up
  91. bindsym $mod+Shift+$right move right
  92. # Ditto, with arrow keys
  93. bindsym $mod+Shift+Left move left
  94. bindsym $mod+Shift+Down move down
  95. bindsym $mod+Shift+Up move up
  96. bindsym $mod+Shift+Right move right
  97. #
  98. # Workspaces:
  99. #
  100. set $W3 '3:F'
  101. set $W9 '9:K'
  102. for_window [app_id="firefox"] move workspace $W3; workspace $W3; border none
  103. for_window [app_id="keepassxc"] move workspace $W9; workspace $W9; border none
  104. # Switch to workspace
  105. bindsym $mod+1 workspace 1
  106. bindsym $mod+2 workspace 2
  107. bindsym $mod+3 workspace $W3
  108. bindsym $mod+4 workspace 4
  109. bindsym $mod+5 workspace 5
  110. bindsym $mod+6 workspace 6
  111. bindsym $mod+7 workspace 7
  112. bindsym $mod+8 workspace 8
  113. bindsym $mod+9 workspace $W9
  114. bindsym $mod+0 workspace 10
  115. # Move focused container to workspace
  116. bindsym $mod+Shift+1 move container to workspace 1
  117. bindsym $mod+Shift+2 move container to workspace 2
  118. bindsym $mod+Shift+3 move container to workspace $W3
  119. bindsym $mod+Shift+4 move container to workspace 4
  120. bindsym $mod+Shift+5 move container to workspace 5
  121. bindsym $mod+Shift+6 move container to workspace 6
  122. bindsym $mod+Shift+7 move container to workspace 7
  123. bindsym $mod+Shift+8 move container to workspace 8
  124. bindsym $mod+Shift+9 move container to workspace $W9
  125. bindsym $mod+Shift+0 move container to workspace 10
  126. # Note: workspaces can have any name you want, not just numbers.
  127. # We just use 1-10 as the default.
  128. #
  129. # Layout stuff:
  130. #
  131. # You can "split" the current object of your focus with
  132. # $mod+b or $mod+v, for horizontal and vertical splits
  133. # respectively.
  134. bindsym $mod+b splith
  135. bindsym $mod+v splitv
  136. # Switch the current container between different layout styles
  137. bindsym $mod+s layout stacking
  138. bindsym $mod+w layout tabbed
  139. bindsym $mod+e layout toggle split
  140. # Make the current focus fullscreen
  141. bindsym $mod+f fullscreen
  142. # Toggle the current focus between tiling and floating mode
  143. bindsym $mod+Shift+space floating toggle
  144. # Swap focus between the tiling area and the floating area
  145. bindsym $mod+space focus mode_toggle
  146. # Move focus to the parent container
  147. bindsym $mod+a focus parent
  148. #
  149. # Scratchpad:
  150. #
  151. # Sway has a "scratchpad", which is a bag of holding for windows.
  152. # You can send windows there and get them back later.
  153. # Move the currently focused window to the scratchpad
  154. bindsym $mod+Shift+minus move scratchpad
  155. # Show the next scratchpad window or hide the focused scratchpad window.
  156. # If there are multiple scratchpad windows, this command cycles through them.
  157. bindsym $mod+minus scratchpad show
  158. #
  159. # Resizing containers:
  160. #
  161. mode "resize" {
  162. # left will shrink the containers width
  163. # right will grow the containers width
  164. # up will shrink the containers height
  165. # down will grow the containers height
  166. bindsym $left resize shrink width 10px
  167. bindsym $down resize grow height 10px
  168. bindsym $up resize shrink height 10px
  169. bindsym $right resize grow width 10px
  170. # Ditto, with arrow keys
  171. bindsym Left resize shrink width 10px
  172. bindsym Down resize grow height 10px
  173. bindsym Up resize shrink height 10px
  174. bindsym Right resize grow width 10px
  175. # Return to default mode
  176. bindsym Return mode "default"
  177. bindsym Escape mode "default"
  178. }
  179. bindsym $mod+r mode "resize"
  180. #
  181. # Power Button
  182. #
  183. set $pplock 'swayphone_power_sleep'
  184. set $ppunlock 'swayphone_power_wakeup'
  185. set $lockapp swaylock
  186. set $lock '$lockapp -f -c 000000'
  187. set $unlock 'killall $lockapp'
  188. ## wish this worked...
  189. #bindsym XF86PowerOff exec $lock
  190. #bindsym --locked XF86PowerOff exec $unlock
  191. # alternative:
  192. bindcode 124 exec $lock; exec $pplock
  193. bindcode --locked 124 exec $unlock; exec $ppunlock
  194. exec swayidle -w \
  195. timeout 15 'swaymsg exec $lock; $pplock' \
  196. resume 'swaymsg exec $unlock; $ppunlock' \
  197. before-sleep 'swaymsg exec $lock; $pplock'
  198. # Scale the touchscreen LCD UI
  199. output DSI-1 scale 2
  200. # Bind input and output for correct rotation support
  201. input 1046:4097:Goodix_Capacitive_TouchScreen map_to_output DSI-1
  202. #output DSI-1 transform 90
  203. output DSI-1 transform 0
  204. # Display rotation daemon
  205. exec 'rot8 --display DSI-1 --threshold 0.97 --x-file /sys/bus/iio/devices/iio:device2/in_accel_y_raw --y-file /sys/bus/iio/devices/iio:device2/in_accel_x_raw --y-invert'
  206. # Keyboard
  207. exec squeekboard
  208. # Gesture detection
  209. exec lisgd \
  210. -g "1,l,r, false" \
  211. -g "1,r,l, false" \
  212. -g "1,u,d, false" \
  213. -g "1,d,u, false" \
  214. -g "2,l,r, swaymsg workspace prev" \
  215. -g "2,r,l, swaymsg workspace next" \
  216. -g "2,u,d, swaymsg exec swayphone_keyboard_hide" \
  217. -g "2,d,u, swaymsg exec swayphone_keyboard_show" \
  218. -g "2,l,u, swaymsg fullscreen" \
  219. -g "2,r,d, swaymsg kill" \
  220. -g "3,l,r, swaymsg focus right" \
  221. -g "3,r,l, swaymsg focus left" \
  222. -g "3,u,d, swaymsg focus down" \
  223. -g "3,d,u, swaymsg focus up" \
  224. -g "4,l,r, swaymsg move right" \
  225. -g "4,r,l, swaymsg move left" \
  226. -g "4,u,d, swaymsg move down" \
  227. -g "4,d,u, swaymsg move up"
  228. # Top and bottom status bar
  229. exec "waybar -c ~/.config/waybar/config_0 -b b0"
  230. exec "waybar -c ~/.config/waybar/config_1 -b b1"
  231. # Restore backlight
  232. exec 'swayphone_power_wakeup'