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.

335 lines
9.9 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. output * bg ~/Desktop/background.png fill
  23. set $GREEN "#00AA00FF"
  24. set $LGREEN "#00FF00FF"
  25. set $DGREEN "#006600FF"
  26. set $BLACK "#000000FF"
  27. client.focused $GREEN $BLACK $GREEN $LGREEN $DGREEN
  28. client.unfocused $DGREEN $BLACK $DGREEN $DGREEN $DGREEN
  29. #
  30. # Example configuration:
  31. #
  32. # output HDMI-A-1 resolution 1920x1080 position 1920,0
  33. #
  34. # You can get the names of your outputs by running: swaymsg -t get_outputs
  35. ### Idle configuration
  36. #
  37. # Example configuration:
  38. #
  39. # exec swayidle -w \
  40. # timeout 300 'swaylock -f -c 000000' \
  41. # timeout 600 'swaymsg "output * dpms off"' \
  42. # resume 'swaymsg "output * dpms on"' \
  43. # before-sleep 'swaylock -f -c 000000'
  44. #
  45. # This will lock your screen after 300 seconds of inactivity, then turn off
  46. # your displays after another 300 seconds, and turn your screens back on when
  47. # resumed. It will also lock your screen before your computer goes to sleep.
  48. ### Input configuration
  49. #
  50. # Example configuration:
  51. #
  52. # input "2:14:SynPS/2_Synaptics_TouchPad" {
  53. # dwt enabled
  54. # tap enabled
  55. # natural_scroll enabled
  56. # middle_emulation enabled
  57. # }
  58. #
  59. # You can get the names of your inputs by running: swaymsg -t get_inputs
  60. # Read `man 5 sway-input` for more information about this section.
  61. ### Key bindings
  62. #
  63. # Basics:
  64. #
  65. # Start a terminal
  66. bindsym $mod+Return exec $term
  67. # Kill focused window
  68. bindsym $mod+q kill
  69. # Start your launcher
  70. bindsym $mod+d exec $menu
  71. # Drag floating windows by holding down $mod and left mouse button.
  72. # Resize them with right mouse button + $mod.
  73. # Despite the name, also works for non-floating windows.
  74. # Change normal to inverse to use left mouse button for resizing and right
  75. # mouse button for dragging.
  76. floating_modifier $mod normal
  77. # Reload the configuration file
  78. bindsym $mod+Ctrl+c reload
  79. # Exit sway (logs you out of your Wayland session)
  80. 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'
  81. #
  82. # Moving around:
  83. #
  84. # Move your focus around
  85. bindsym $mod+$left focus left
  86. bindsym $mod+$down focus down
  87. bindsym $mod+$up focus up
  88. bindsym $mod+$right focus right
  89. # Or use $mod+[up|down|left|right]
  90. bindsym $mod+Left focus left
  91. bindsym $mod+Down focus down
  92. bindsym $mod+Up focus up
  93. bindsym $mod+Right focus right
  94. # Move the focused window with the same, but add Shift
  95. bindsym $mod+Shift+$left move left
  96. bindsym $mod+Shift+$down move down
  97. bindsym $mod+Shift+$up move up
  98. bindsym $mod+Shift+$right move right
  99. # Ditto, with arrow keys
  100. bindsym $mod+Shift+Left move left
  101. bindsym $mod+Shift+Down move down
  102. bindsym $mod+Shift+Up move up
  103. bindsym $mod+Shift+Right move right
  104. #
  105. # Workspaces:
  106. #
  107. set $W1 '1:STAT'
  108. set $W2 '2:INV'
  109. set $W3 '3:DATA'
  110. set $W4 '4:MAP'
  111. set $W5 '5:RADIO'
  112. set $W6 '6:6'
  113. set $W7 '7:7'
  114. set $W8 '8:8'
  115. set $W9 '9:9'
  116. set $WSTAT $W1
  117. set $WINV $W2
  118. set $WDATA $W3
  119. set $WMAP $W4
  120. set $WRADIO $W5
  121. set $DSI1 "DSI-1"
  122. workspace $WSTAT output $DSI1
  123. workspace $WINV output $DSI1
  124. workspace $WDATA output $DSI1
  125. workspace $WMAP output $DSI1
  126. workspace $WRADIO output $DSI1
  127. # Switch to workspace
  128. bindsym $mod+1 workspace $W1
  129. bindsym $mod+2 workspace $W2
  130. bindsym $mod+3 workspace $W3
  131. bindsym $mod+4 workspace $W4
  132. bindsym $mod+5 workspace $W5
  133. bindsym $mod+6 workspace $W6
  134. bindsym $mod+7 workspace $W7
  135. bindsym $mod+8 workspace $W8
  136. bindsym $mod+9 workspace $W9
  137. bindsym $mod+0 workspace $W10
  138. # Move focused container to workspace
  139. bindsym $mod+Shift+1 move container to workspace $W1
  140. bindsym $mod+Shift+2 move container to workspace $W2
  141. bindsym $mod+Shift+3 move container to workspace $W3
  142. bindsym $mod+Shift+4 move container to workspace $W4
  143. bindsym $mod+Shift+5 move container to workspace $W5
  144. bindsym $mod+Shift+6 move container to workspace $W6
  145. bindsym $mod+Shift+7 move container to workspace $W7
  146. bindsym $mod+Shift+8 move container to workspace $W8
  147. bindsym $mod+Shift+9 move container to workspace $W9
  148. bindsym $mod+Shift+0 move container to workspace $W10
  149. # Note: workspaces can have any name you want, not just numbers.
  150. # We just use 1-10 as the default.
  151. #
  152. # Layout stuff:
  153. #
  154. # You can "split" the current object of your focus with
  155. # $mod+b or $mod+v, for horizontal and vertical splits
  156. # respectively.
  157. bindsym $mod+b splith
  158. bindsym $mod+v splitv
  159. # Switch the current container between different layout styles
  160. bindsym $mod+s layout stacking
  161. bindsym $mod+w layout tabbed
  162. bindsym $mod+e layout toggle split
  163. # Make the current focus fullscreen
  164. bindsym $mod+f fullscreen
  165. # Toggle the current focus between tiling and floating mode
  166. bindsym $mod+Shift+space floating toggle
  167. # Swap focus between the tiling area and the floating area
  168. bindsym $mod+space focus mode_toggle
  169. # Move focus to the parent container
  170. bindsym $mod+a focus parent
  171. #
  172. # Scratchpad:
  173. #
  174. # Sway has a "scratchpad", which is a bag of holding for windows.
  175. # You can send windows there and get them back later.
  176. # Move the currently focused window to the scratchpad
  177. bindsym $mod+Shift+minus move scratchpad
  178. # Show the next scratchpad window or hide the focused scratchpad window.
  179. # If there are multiple scratchpad windows, this command cycles through them.
  180. bindsym $mod+minus scratchpad show
  181. #
  182. # Resizing containers:
  183. #
  184. mode "resize" {
  185. # left will shrink the containers width
  186. # right will grow the containers width
  187. # up will shrink the containers height
  188. # down will grow the containers height
  189. bindsym $left resize shrink width 10px
  190. bindsym $down resize grow height 10px
  191. bindsym $up resize shrink height 10px
  192. bindsym $right resize grow width 10px
  193. # Ditto, with arrow keys
  194. bindsym Left resize shrink width 10px
  195. bindsym Down resize grow height 10px
  196. bindsym Up resize shrink height 10px
  197. bindsym Right resize grow width 10px
  198. # Return to default mode
  199. bindsym Return mode "default"
  200. bindsym Escape mode "default"
  201. }
  202. bindsym $mod+r mode "resize"
  203. #
  204. # Power Button
  205. #
  206. set $pplock 'swayphone_power_sleep'
  207. set $ppunlock 'swayphone_power_wakeup'
  208. set $lockapp swaylock
  209. set $lock '$lockapp -f -c 005500'
  210. set $unlock 'killall $lockapp'
  211. ## wish this worked...
  212. #bindsym XF86PowerOff exec $lock
  213. #bindsym --locked XF86PowerOff exec $unlock
  214. # alternative:
  215. #bindcode 124 exec $lock; exec $pplock
  216. #bindcode --locked 124 exec $ppunlock
  217. bindcode 124 exec '$lock ; swayphone_power_presleep'
  218. bindcode --locked 124 exec '$unlock ; swayphone_power_wakeup'
  219. exec swayidle -w \
  220. timeout 30 'pptk-backlight set_percent 10' \
  221. resume 'swayphone_power_wakeup' \
  222. timeout 60 'swayphone_power_rest' \
  223. resume 'swayphone_power_wakeup' \
  224. timeout 120 'swayphone_power_sleep' \
  225. before-sleep 'swayphone_power_presleep' \
  226. after-resume 'killall swaylock; swayphone_power_wakeup' \
  227. unlock 'killall swaylock'
  228. # Scale the touchscreen LCD UI
  229. output DSI-1 scale 2
  230. # Bind input and output for correct rotation support
  231. input 1046:4097:Goodix_Capacitive_TouchScreen map_to_output DSI-1
  232. #output DSI-1 transform 0
  233. #output DSI-1 transform 90
  234. output DSI-1 transform 270
  235. # Display rotation daemon
  236. #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 --on-change swayphone_rotated'
  237. # Keyboard
  238. exec "squeekboard"
  239. # Gesture detection
  240. #exec lisgd \
  241. # -g "1,l,r, false" \
  242. # -g "1,r,l, false" \
  243. # -g "1,u,d, false" \
  244. # -g "1,d,u, false" \
  245. # -g "2,l,r, swaymsg workspace prev" \
  246. # -g "2,r,l, swaymsg workspace next" \
  247. # -g "2,u,d, swaymsg exec swayphone_keyboard_hide" \
  248. # -g "2,d,u, swaymsg exec swayphone_keyboard_show" \
  249. # -g "2,l,u, swaymsg fullscreen" \
  250. # -g "2,r,d, swaymsg kill" \
  251. # -g "3,l,r, swaymsg focus right" \
  252. # -g "3,r,l, swaymsg focus left" \
  253. # -g "3,u,d, swaymsg focus down" \
  254. # -g "3,d,u, swaymsg focus up" \
  255. # -g "4,l,r, swaymsg move right" \
  256. # -g "4,r,l, swaymsg move left" \
  257. # -g "4,u,d, swaymsg move down" \
  258. # -g "4,d,u, swaymsg move up"
  259. # Status Bar
  260. # side
  261. exec "rm /tmp/sway_rotation"
  262. exec "waybar -c ~/.config/waybar/config"
  263. #exec "waybar -c ~/.config/waybar/config_left -b side_left"
  264. #exec "sleep 2 ; kill -10 `pgrep -f 'waybar.*-b side'`"
  265. #exec "waybar -c ~/.config/waybar/config_0 -b top"
  266. #exec "waybar -c ~/.config/waybar/config_1 -b bottom"
  267. # Restore backlight
  268. exec 'swayphone_power_wakeup'
  269. # STAT
  270. # ??
  271. # INV
  272. exec "portfolio-fm"
  273. for_window [app_id="portfolio-fm"] move workspace $WINV
  274. # DATA
  275. exec "firefox"
  276. for_window [app_id="firefox"] move workspace $WDATA; boarder none
  277. # MAP
  278. exec "gnome-maps"
  279. for_window [app_id="org.gnome.Maps"] move workspace $WMAP; border none
  280. # RADIO
  281. exec "killall mpd ; mpd"
  282. exec "xfmpc"
  283. for_window [app_id="xfmpc"] move workspace $WRADIO; border none
  284. # Welcome message
  285. exec "mako" # notify daemon
  286. exec "sleep 2; notify-send 'Welcome!' 'Your Pip-Boy is ready to be used.' --icon=dialog-information"
  287. # Sounds
  288. exec "killall workspace_sounds_daemon ; killall mplayer ; workspace_sounds_daemon"