config 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. # @reference: man 5 sway
  2. # super for modifier
  3. set $mod Mod4
  4. # define service variables
  5. set $launcher wofi --show=run --lines=5 --prompt=""
  6. set $applauncher wofi --show=drun --lines=5 --prompt=""
  7. set $term alacritty
  8. set $browser firefox
  9. set $editor subl
  10. set $files pcmanfm
  11. # @note: we use the default wallpaper as a backup
  12. output * bg /usr/share/backgrounds/sway/Sway_Wallpaper_Blue_1920x1080.png fill
  13. # @note: cursor theme and size set env vars; may not apply to all applications
  14. seat seat0 xcursor_theme Vimix-cursors 36
  15. # window manager commands
  16. bindsym $mod+Shift+c reload
  17. bindsym $mod+Shift+q kill
  18. bindsym $mod+x exec "systemctl --user import-environment; systemctl --user stop sway-session.target; swaymsg exit"
  19. bindsym $mod+p focus parent
  20. # split workspace horizontal and vertical
  21. bindsym $mod+v splitv
  22. bindsym $mod+h splith
  23. # change workspace layout
  24. bindsym $mod+Shift+e layout toggle split
  25. bindsym $mod+Shift+s layout stacking
  26. bindsym $mod+Shift+w layout tabbed
  27. # fullscreen toggle
  28. bindsym $mod+f fullscreen
  29. # floating window controls:
  30. # super+l to toggle floating mode
  31. # super+_shift+l to switch focus to floating window(s)
  32. # hold super then use left click to drag and right click to resize
  33. bindsym $mod+l floating toggle
  34. bindsym $mod+Shift+l focus mode_toggle
  35. floating_modifier $mod normal
  36. # Move your focus around
  37. bindsym $mod+Left focus left
  38. bindsym $mod+Down focus down
  39. bindsym $mod+Up focus up
  40. bindsym $mod+Right focus right
  41. # Move the focused window with the same, but add Shift
  42. bindsym $mod+Shift+Left move left
  43. bindsym $mod+Shift+Down move down
  44. bindsym $mod+Shift+Up move up
  45. bindsym $mod+Shift+Right move right
  46. mode "resize" {
  47. bindsym Left resize shrink width 10px
  48. bindsym Down resize grow height 10px
  49. bindsym Up resize shrink height 10px
  50. bindsym Right resize grow width 10px
  51. bindsym Return mode "default"
  52. bindsym Escape mode "default"
  53. }
  54. bindsym $mod+r mode "resize"
  55. # navigate workspaces
  56. bindsym $mod+1 workspace number 1
  57. bindsym $mod+2 workspace number 2
  58. bindsym $mod+3 workspace number 3
  59. bindsym $mod+4 workspace number 4
  60. bindsym $mod+5 workspace number 5
  61. bindsym $mod+6 workspace number 6
  62. bindsym $mod+7 workspace number 7
  63. bindsym $mod+8 workspace number 8
  64. bindsym $mod+9 workspace number 9
  65. bindsym $mod+0 workspace number 10
  66. bindsym Control+Alt+Right workspace next
  67. bindsym Control+Alt+Left workspace prev
  68. # send window to workspace
  69. bindsym $mod+Shift+1 move container to workspace number 1, workspace number 1
  70. bindsym $mod+Shift+2 move container to workspace number 2, workspace number 2
  71. bindsym $mod+Shift+3 move container to workspace number 3, workspace number 3
  72. bindsym $mod+Shift+4 move container to workspace number 4, workspace number 4
  73. bindsym $mod+Shift+5 move container to workspace number 5, workspace number 5
  74. bindsym $mod+Shift+6 move container to workspace number 6, workspace number 6
  75. bindsym $mod+Shift+7 move container to workspace number 7, workspace number 7
  76. bindsym $mod+Shift+8 move container to workspace number 8, workspace number 8
  77. bindsym $mod+Shift+9 move container to workspace number 9, workspace number 9
  78. bindsym $mod+Shift+0 move container to workspace number 10, workspace number 10
  79. bindsym $mod+Control+Right move container to workspace next, workspace next
  80. bindsym $mod+Control+Left move container to workspace prev, workspace prev
  81. # services
  82. bindsym $mod+Space exec $launcher
  83. bindsym $mod+Shift+F2 exec $applauncher
  84. bindsym $mod+t exec $term
  85. bindsym $mod+b exec $files
  86. bindsym $mod+e exec $editor
  87. bindsym $mod+w exec $browser
  88. bindsym $mod+Ctrl+3 exec screenshot
  89. bindsym Print exec screenshot
  90. bindsym $mod+Ctrl+4 exec screenshot-selection
  91. bindsym Shift+Print exec screenshot-selection
  92. # multimedia keys
  93. bindsym XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +5%
  94. bindsym XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -5%
  95. bindsym XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggle
  96. bindsym XF86AudioMicMute exec pactl set-source-mute @DEFAULT_SOURCE@ toggle
  97. bindsym XF86AudioPlay exec playerctl -p mpv play-pause
  98. bindsym XF86AudioNext exec playerctl -p mpv next
  99. bindsym XF86AudioPrev exec playerctl -p mpv previous
  100. bindsym XF86MonBrightnessUp exec brightnessctl set +5%
  101. bindsym XF86MonBrightnessDown exec brightnessctl set 5%-
  102. bindsym Shift+XF86MonBrightnessUp exec brightnessctl s 100%
  103. bindsym Shift+XF86MonBrightnessDown exec brightnessctl s 0%
  104. # global push-to-talk & toggle
  105. bindsym $mod+m exec pactl set-source-mute @DEFAULT_SOURCE@ 0 # mute mic
  106. bindsym --release $mod+m exec pactl set-source-mute @DEFAULT_SOURCE@ 1 # unmute mic
  107. bindsym $mod+Shift+m exec pactl set-source-mute @DEFAULT_SOURCE@ toggle
  108. # classify sane defaults for window management
  109. for_window [window_role="pop-up"] floating enable
  110. for_window [window_role="bubble"] floating enable
  111. for_window [window_role="task_dialog"] floating enable
  112. for_window [window_role="Preferences"] floating enable
  113. for_window [window_type="dialog"] floating enable
  114. for_window [window_type="menu"] floating enable
  115. for_window [window_role="About"] floating enable
  116. for_window [class="xdg-desktop-portal-kde"] floating enable
  117. for_window [class="Wine"] floating enable
  118. for_window [app_id="lutris"] floating enable
  119. # @reference: man 5 sway-bar
  120. # @note: we now launch waybar via systemctl --user enable waybar.service
  121. #bar {
  122. # swaybar_command waybar
  123. #}
  124. # load additional configuration
  125. include /etc/sway/config.d/*
  126. # load user configuration from local sub-directory
  127. #
  128. # @reference: man 5 sway-output
  129. # @reference: swaymsg -t get_outputs
  130. #
  131. # example with custom resolution and dual monitors:
  132. #
  133. # output HDMI-A-1 mode --custom 2560x1440@60Hz position 0,0 adaptive_sync on
  134. # output DP-1 mode 3440x1440@144Hz pos 3440 0 adaptive_sync on
  135. #
  136. # @reference: man 5 sway-input
  137. # @reference: swaymsg -t get_inputs
  138. #
  139. # Example configuration:
  140. #
  141. # input "2:14:SynPS/2_Synaptics_TouchPad" {
  142. # dwt enabled
  143. # tap enabled
  144. # natural_scroll enabled
  145. # middle_emulation enabled
  146. # }
  147. include ~/.config/sway/config.d/*
  148. # start sway session in systemd to intialize services
  149. exec_always "systemctl --user import-environment; systemctl --user start sway-session.target"