config 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267
  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. # pamixer is easier to use than pactl.
  35. bindsym XF86AudioRaiseVolume exec "pamixer --allow-boost -i 10"
  36. bindsym XF86AudioLowerVolume exec "pamixer -d 10"
  37. bindsym XF86AudioMute exec pactl "pamixer -t"
  38. # bindsym XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +10%
  39. # bindsym XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -10%
  40. # bindsym XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggle
  41. # allow my eject command to work.
  42. bindsym f9 exec eject
  43. ### Output configuration
  44. #
  45. # Default wallpaper (more resolutions are available in /gnu/store/v0l4j1dqm1bznydlx08ab4v8jpz0yly0-sway-1.1.1/share/backgrounds/sway/)
  46. #output * bg ./Sway_Wallpaper_Blue_1920x1080.png fill
  47. #output * bg /gnu/store/08mg9iahnyh4fyrafla3zyb5an2jscb0-sway-1.2/share/backgrounds/sway/Sway_Wallpaper_Blue_1920x1080.png fill
  48. #
  49. # Example configuration:
  50. #
  51. # output HDMI-A-1 resolution 1920x1080 position 1920,0
  52. #
  53. # You can get the names of your outputs by running: swaymsg -t get_outputs
  54. ### Idle configuration
  55. #
  56. # Example configuration:
  57. #
  58. # exec swayidle -w \
  59. # timeout 300 'swaylock -f -c 000000' \
  60. # timeout 600 'swaymsg "output * dpms off"' \
  61. # resume 'swaymsg "output * dpms on"' \
  62. # before-sleep 'swaylock -f -c 000000'
  63. #
  64. # This will lock your screen after 300 seconds of inactivity, then turn off
  65. # your displays after another 300 seconds, and turn your screens back on when
  66. # resumed. It will also lock your screen before your computer goes to sleep.
  67. ### Input configuration
  68. #XS
  69. # Example configuration:
  70. #
  71. # input "2:14:SynPS/2_Synaptics_TouchPad" {
  72. # dwt enabled
  73. # tap enabled
  74. # natural_scroll enabled
  75. # middle_emulation enabled
  76. # }
  77. #
  78. # You can get the names of your inputs by running: swaymsg -t get_inputs
  79. # Read `man 5 sway-input` for more information about this section.
  80. ### Key bindings
  81. #
  82. # Basics:
  83. #
  84. # start a terminal
  85. bindsym $mod+Return exec $term
  86. bindsym $mod+Control+Return exec $bashterm
  87. # kill focused window
  88. bindsym $mod+Control+c kill
  89. # start your launcher
  90. bindsym $mod+d exec $menu
  91. # launch firefox flatpak
  92. bindsym $mod+Control+f exec flatpak run --filesystem=home --socket=x11 --env=GDK_BACKEND=x11 org.mozilla.firefox
  93. # Drag floating windows by holding down $mod and left mouse button.
  94. # Resize them with right mouse button + $mod.
  95. # Despite the name, also works for non-floating windows.
  96. # Change normal to inverse to use left mouse button for resizing and right
  97. # mouse button for dragging.
  98. floating_modifier $mod normal
  99. # reload the configuration file
  100. bindsym $mod+Control+r reload
  101. # exit sway (logs you out of your Wayland session)
  102. 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'
  103. #
  104. # Moving around:
  105. #
  106. # Move your focus around
  107. bindsym $mod+$left focus left
  108. bindsym $mod+$down focus down
  109. bindsym $mod+$up focus up
  110. bindsym $mod+$right focus right
  111. # or use $mod+[up|down|left|right]
  112. bindsym $mod+Left focus left
  113. bindsym $mod+Down focus down
  114. bindsym $mod+Up focus up
  115. bindsym $mod+Right focus right
  116. # _move_ the focused window with the same, but add Shift
  117. bindsym $mod+Control+$left move left
  118. bindsym $mod+Control+$down move down
  119. bindsym $mod+Control+$up move up
  120. bindsym $mod+Control+$right move right
  121. # ditto, with arrow keys
  122. bindsym $mod+Control+Left move left
  123. bindsym $mod+Control+Down move down
  124. bindsym $mod+Control+Up move up
  125. bindsym $mod+Control+Right move right
  126. #
  127. # Workspaces:
  128. #
  129. # switch to workspace
  130. bindsym $mod+1 workspace 1
  131. bindsym $mod+2 workspace 2
  132. bindsym $mod+3 workspace 3
  133. bindsym $mod+4 workspace 4
  134. bindsym $mod+5 workspace 5
  135. bindsym $mod+6 workspace 6
  136. bindsym $mod+7 workspace 7
  137. bindsym $mod+8 workspace 8
  138. bindsym $mod+9 workspace 9
  139. bindsym $mod+0 workspace 10
  140. # move focused container to workspace
  141. bindsym $mod+Control+1 move container to workspace 1
  142. bindsym $mod+Control+2 move container to workspace 2
  143. bindsym $mod+Control+3 move container to workspace 3
  144. bindsym $mod+Control+4 move container to workspace 4
  145. bindsym $mod+Control+5 move container to workspace 5
  146. bindsym $mod+Control+6 move container to workspace 6
  147. bindsym $mod+Control+7 move container to workspace 7
  148. bindsym $mod+Control+8 move container to workspace 8
  149. bindsym $mod+Control+9 move container to workspace 9
  150. bindsym $mod+Control+0 move container to workspace 10
  151. # Note: workspaces can have any name you want, not just numbers.
  152. # We just use 1-10 as the default.
  153. #
  154. # Layout stuff:
  155. #
  156. # Set the default layout to tabbed
  157. # layout tabbed
  158. # You can "split" the current object of your focus with
  159. # $mod+b or $mod+v, for horizontal and vertical splits
  160. # respectively.
  161. bindsym $mod+b splith
  162. bindsym $mod+v splitv
  163. # Switch the current container between different layout styles
  164. bindsym $mod+p layout stacking #piled
  165. bindsym $mod+w layout tabbed
  166. bindsym $mod+e layout toggle split
  167. # Make the current focus fullscreen
  168. bindsym $mod+f fullscreen
  169. # Toggle the current focus between tiling and floating mode
  170. bindsym $mod+Control+space floating toggle
  171. # Swap focus between the tiling area and the floating area
  172. bindsym $mod+space focus mode_toggle
  173. # move focus to the parent container
  174. bindsym $mod+a focus parent
  175. #
  176. # Scratchpad:
  177. #
  178. # Sway has a "scratchpad", which is a bag of holding for windows.
  179. # You can send windows there and get them back later.
  180. # Move the currently focused window to the scratchpad
  181. bindsym $mod+Control+minus move scratchpad
  182. # Show the next scratchpad window or hide the focused scratchpad window.
  183. # If there are multiple scratchpad windows, this command cycles through them.
  184. bindsym $mod+minus scratchpad show
  185. #
  186. # Resizing containers:
  187. #
  188. mode "resize" {
  189. # left will shrink the containers width
  190. # right will grow the containers width
  191. # up will shrink the containers height
  192. # down will grow the containers height
  193. bindsym $left resize shrink width 10px
  194. bindsym $down resize grow height 10px
  195. bindsym $up resize shrink height 10px
  196. bindsym $right resize grow width 10px
  197. # ditto, with arrow keys
  198. bindsym Left resize shrink width 10px
  199. bindsym Down resize grow height 10px
  200. bindsym Up resize shrink height 10px
  201. bindsym Right resize grow width 10px
  202. # return to default mode
  203. bindsym Return mode "default"
  204. bindsym Escape mode "default"
  205. }
  206. bindsym $mod+r mode "resize"
  207. #
  208. # Status Bar:
  209. #
  210. # Read `man 5 sway-bar` for more information about this section.
  211. bar {
  212. position top
  213. # When the status_command prints a new line to stdout, swaybar updates.
  214. # The default just shows the current date and time.
  215. # This is a guide to get a battery widget and sound widget on the swaybar
  216. # https://unix.stackexchange.com/questions/473788/simple-swaybar-example
  217. #status_command while date +'%Y-%m-%d %l:%M %p'; do sleep 1; done
  218. status_command while ~/.config/sway/status.sh; do sleep 1; done
  219. pango_markup enabled
  220. # you can pango markup info here: https://developer.gnome.org/pango/unstable/pango-Markup.html
  221. #separator_symbol "^"
  222. colors {
  223. statusline #ffffff
  224. background #323232
  225. # separator #ffffff
  226. inactive_workspace #32323200 #32323200 #5c5c5c
  227. }
  228. }
  229. # this lets me create desktop notifications
  230. exec mako
  231. # https://www.reddit.com/r/swaywm/comments/97hkrq/dbus_notifications_mako/
  232. # https://ss64.com/bash/notify-send.html requires libnotify to be installed
  233. # https://github.com/emersion/mako/issues/88
  234. # include /gnu/store/basndaky9w8ka6cjgs44x3hdwcsg57j6-sway-1.2/etc/sway/config.d/*
  235. # include /gnu/store/wb4b4fikslag48apznwn71p10fi59n70-sway-1.2/etc/sway/config.d/*
  236. include @sysconfdir@/sway/config.d/*