sway-config 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263
  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. ### Variables
  7. #
  8. # Logo key. Use Mod1 for Alt.
  9. set $mod Mod1
  10. # Home row direction keys, like vim
  11. set $left n
  12. set $down h
  13. set $up t
  14. set $right s
  15. # Your preferred terminal emulator
  16. #set $term weston-terminal
  17. set $term termite -e fish
  18. set $bashterm termite
  19. # Your preferred application launcher
  20. # Note: it's recommended that you pass the final command to sway
  21. #set $menu dmenu_path | dmenu | xargs swaymsg exec --
  22. # wofi kept stalling on first lanch. bemenu works much better.
  23. #set $menu wofi --show run
  24. set $menu bemenu-run -l 10
  25. # keyboard layout
  26. input * xkb_layout "dvorak"
  27. input * xkb_options "ctrl:swapcaps"
  28. # enabling tap to click and natural scrolling
  29. input * tap enabled
  30. input * natural_scroll enabled
  31. # volume configuration
  32. # bindsym XF86AudioRaiseVolume "exec amixer set Master -q 5%+"
  33. # bindsym XF86AudioLowerVolume "exec amixer set Master -q 5%-"
  34. bindsym XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +10%
  35. bindsym XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -10%
  36. bindsym XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggle
  37. # allow my eject command to work.
  38. bindsym f9 exec eject
  39. ### Output configuration
  40. #
  41. # Default wallpaper (more resolutions are available in /gnu/store/v0l4j1dqm1bznydlx08ab4v8jpz0yly0-sway-1.1.1/share/backgrounds/sway/)
  42. #output * bg ./Sway_Wallpaper_Blue_1920x1080.png fill
  43. #output * bg /gnu/store/08mg9iahnyh4fyrafla3zyb5an2jscb0-sway-1.2/share/backgrounds/sway/Sway_Wallpaper_Blue_1920x1080.png fill
  44. #
  45. # Example configuration:
  46. #
  47. # output HDMI-A-1 resolution 1920x1080 position 1920,0
  48. #
  49. # You can get the names of your outputs by running: swaymsg -t get_outputs
  50. ### Idle configuration
  51. #
  52. # Example configuration:
  53. #
  54. # exec swayidle -w \
  55. # timeout 300 'swaylock -f -c 000000' \
  56. # timeout 600 'swaymsg "output * dpms off"' \
  57. # resume 'swaymsg "output * dpms on"' \
  58. # before-sleep 'swaylock -f -c 000000'
  59. #
  60. # This will lock your screen after 300 seconds of inactivity, then turn off
  61. # your displays after another 300 seconds, and turn your screens back on when
  62. # resumed. It will also lock your screen before your computer goes to sleep.
  63. ### Input configuration
  64. #XS
  65. # Example configuration:
  66. #
  67. # input "2:14:SynPS/2_Synaptics_TouchPad" {
  68. # dwt enabled
  69. # tap enabled
  70. # natural_scroll enabled
  71. # middle_emulation enabled
  72. # }
  73. #
  74. # You can get the names of your inputs by running: swaymsg -t get_inputs
  75. # Read `man 5 sway-input` for more information about this section.
  76. ### Key bindings
  77. #
  78. # Basics:
  79. #
  80. # start a terminal
  81. bindsym $mod+Return exec $term
  82. bindsym $mod+Control+Return exec $bashterm
  83. # kill focused window
  84. bindsym $mod+Control+c kill
  85. # start your launcher
  86. bindsym $mod+d exec $menu
  87. # launch firefox flatpak
  88. bindsym $mod+Control+f exec flatpak run --user --filesystem=home --socket=x11 --env=GDK_BACKEND=x11 org.mozilla.firefox
  89. # Drag floating windows by holding down $mod and left mouse button.
  90. # Resize them with right mouse button + $mod.
  91. # Despite the name, also works for non-floating windows.
  92. # Change normal to inverse to use left mouse button for resizing and right
  93. # mouse button for dragging.
  94. floating_modifier $mod normal
  95. # reload the configuration file
  96. bindsym $mod+Control+r reload
  97. # exit sway (logs you out of your Wayland session)
  98. bindsym $mod+Control+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'
  99. #
  100. # Moving around:
  101. #
  102. # Move your focus around
  103. bindsym $mod+$left focus left
  104. bindsym $mod+$down focus down
  105. bindsym $mod+$up focus up
  106. bindsym $mod+$right focus right
  107. # or use $mod+[up|down|left|right]
  108. bindsym $mod+Left focus left
  109. bindsym $mod+Down focus down
  110. bindsym $mod+Up focus up
  111. bindsym $mod+Right focus right
  112. # _move_ the focused window with the same, but add Shift
  113. bindsym $mod+Control+$left move left
  114. bindsym $mod+Control+$down move down
  115. bindsym $mod+Control+$up move up
  116. bindsym $mod+Control+$right move right
  117. # ditto, with arrow keys
  118. bindsym $mod+Control+Left move left
  119. bindsym $mod+Control+Down move down
  120. bindsym $mod+Control+Up move up
  121. bindsym $mod+Control+Right move right
  122. #
  123. # Workspaces:
  124. #
  125. # switch to workspace
  126. bindsym $mod+1 workspace 1
  127. bindsym $mod+2 workspace 2
  128. bindsym $mod+3 workspace 3
  129. bindsym $mod+4 workspace 4
  130. bindsym $mod+5 workspace 5
  131. bindsym $mod+6 workspace 6
  132. bindsym $mod+7 workspace 7
  133. bindsym $mod+8 workspace 8
  134. bindsym $mod+9 workspace 9
  135. bindsym $mod+0 workspace 10
  136. # move focused container to workspace
  137. bindsym $mod+Control+1 move container to workspace 1
  138. bindsym $mod+Control+2 move container to workspace 2
  139. bindsym $mod+Control+3 move container to workspace 3
  140. bindsym $mod+Control+4 move container to workspace 4
  141. bindsym $mod+Control+5 move container to workspace 5
  142. bindsym $mod+Control+6 move container to workspace 6
  143. bindsym $mod+Control+7 move container to workspace 7
  144. bindsym $mod+Control+8 move container to workspace 8
  145. bindsym $mod+Control+9 move container to workspace 9
  146. bindsym $mod+Control+0 move container to workspace 10
  147. # Note: workspaces can have any name you want, not just numbers.
  148. # We just use 1-10 as the default.
  149. #
  150. # Layout stuff:
  151. #
  152. # Set the default layout to tabbed
  153. # layout tabbed
  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+p layout stacking #piled
  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+Control+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+Control+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. # Status Bar:
  205. #
  206. # Read `man 5 sway-bar` for more information about this section.
  207. bar {
  208. position top
  209. # When the status_command prints a new line to stdout, swaybar updates.
  210. # The default just shows the current date and time.
  211. # This is a guide to get a battery widget and sound widget on the swaybar
  212. # https://unix.stackexchange.com/questions/473788/simple-swaybar-example
  213. #status_command while date +'%Y-%m-%d %l:%M %p'; do sleep 1; done
  214. status_command while ~/.config/sway/status.sh; do sleep 1; done
  215. pango_markup enabled
  216. # you can pango markup info here: https://developer.gnome.org/pango/unstable/pango-Markup.html
  217. #separator_symbol "^"
  218. colors {
  219. statusline #ffffff
  220. background #323232
  221. # separator #ffffff
  222. inactive_workspace #32323200 #32323200 #5c5c5c
  223. }
  224. }
  225. # this lets me create desktop notifications
  226. exec mako
  227. # https://www.reddit.com/r/swaywm/comments/97hkrq/dbus_notifications_mako/
  228. # https://ss64.com/bash/notify-send.html requires libnotify to be installed
  229. # https://github.com/emersion/mako/issues/88
  230. # include /gnu/store/basndaky9w8ka6cjgs44x3hdwcsg57j6-sway-1.2/etc/sway/config.d/*
  231. # include /gnu/store/wb4b4fikslag48apznwn71p10fi59n70-sway-1.2/etc/sway/config.d/*
  232. include @sysconfdir@/sway/config.d/*