config 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. #Mod key. Win key is more usefull and preferable one.
  2. set $mod Mod4
  3. #Direction keys, vim-style.
  4. set $left h
  5. set $down j
  6. set $up k
  7. set $right l
  8. #My terminal emulator. Usually it is alacritty, because of Rust.
  9. set $term alacritty
  10. #Launch menu. I like wofi more than dmenu.
  11. set $menu dmenu_path | wofi --show drun -I | xargs swaymsg exec --
  12. #Gaps. I change it really often.
  13. gaps outer 6
  14. gaps inner 12
  15. #smart_gaps on
  16. #Border.
  17. default_border pixel
  18. for_window [tiling] border pixel 3
  19. smart_borders on
  20. #Class Border BG Indicator Parent_Border
  21. client.focused #4c7899 #285577 #ffffff #2e9ef4
  22. client.focused_inactive #333333 #5f676a #ffffff #484e50
  23. client.unfocused #333333 #222222 #888888 #292d2e
  24. #Monitors.
  25. output HDMI-A-1 resolution 1920x1080 position 1280,0
  26. output HDMI-A-2 resolution 1280x768 position 0,314
  27. workspace 1 output HDMI-A-1
  28. workspace 2 output HDMI-A-2
  29. #Wallpaper.
  30. output * bg /home/moony/Images/Wallpapers/Star\ Fly.png fill
  31. #Input
  32. input * {
  33. xkb_layout us,ru
  34. xkb_options grp:ctrl_shift_toggle,grp:win_space_toggle
  35. xkb_numlock enabled
  36. }
  37. #Keys and so on.
  38. #
  39. #Basic.
  40. #Terminal.
  41. bindsym --to-code $mod+Return exec $term
  42. #Kill focused window.
  43. bindsym --to-code $mod+Shift+q kill
  44. #Start menu.
  45. bindsym --to-code $mod+d exec $menu
  46. #Reload config.
  47. bindsym --to-code $mod+Shift+c reload
  48. #Exit sway.
  49. bindsym --to-code $mod+Shift+Escape exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will also end you Wayland session.' -B 'Yes, exit sway' 'swaymsg exit'
  50. #Move.
  51. #Move focus.
  52. #Left.
  53. bindsym --to-code $mod+$left focus left
  54. bindsym --to-code $mod+Left focus left
  55. #Right.
  56. bindsym --to-code $mod+$right focus right
  57. bindsym --to-code $mod+Right focus right
  58. #Up
  59. bindsym --to-code $mod+$up focus up
  60. bindsym --to-code $mod+Up focus up
  61. #And down.
  62. bindsym --to-code $mod+$down focus down
  63. bindsym --to-code $mod+Down focus down
  64. #Move windows.
  65. #Left.
  66. bindsym --to-code $mod+Shift+$left move left
  67. bindsym --to-code $mod+Shift+Left move left
  68. #Right.
  69. bindsym --to-code $mod+Shift+$right move right
  70. bindsym --to-code $mod+Shift+Right move right
  71. #Up.
  72. bindsym --to-code $mod+Shift+$up move up
  73. bindsym --to-code $mod+Shift+Up move up
  74. #And down (again).
  75. bindsym --to-code $mod+Shift+$down move down
  76. bindsym --to-code $mod+Shift+Down move down
  77. #Workspaces.
  78. #Switch.
  79. bindsym --to-code $mod+1 workspace number 1
  80. bindsym --to-code $mod+2 workspace number 2
  81. bindsym --to-code $mod+3 workspace number 3
  82. bindsym --to-code $mod+4 workspace number 4
  83. bindsym --to-code $mod+5 workspace number 5
  84. bindsym --to-code $mod+6 workspace number 6
  85. bindsym --to-code $mod+7 workspace number 7
  86. bindsym --to-code $mod+8 workspace number 8
  87. bindsym --to-code $mod+9 workspace number 9
  88. bindsym --to-code $mod+0 workspace number 0
  89. #Move window.
  90. bindsym --to-code $mod+Shift+1 move container to workspace number 1
  91. bindsym --to-code $mod+Shift+2 move container to workspace number 2
  92. bindsym --to-code $mod+Shift+3 move container to workspace number 3
  93. bindsym --to-code $mod+Shift+4 move container to workspace number 4
  94. bindsym --to-code $mod+Shift+5 move container to workspace number 5
  95. bindsym --to-code $mod+Shift+6 move container to workspace number 6
  96. bindsym --to-code $mod+Shift+7 move container to workspace number 7
  97. bindsym --to-code $mod+Shift+8 move container to workspace number 8
  98. bindsym --to-code $mod+Shift+9 move container to workspace number 9
  99. bindsym --to-code $mod+Shift+0 move container to workspace number 10
  100. #Layouts.
  101. #Split.
  102. bindsym --to-code $mod+b splith
  103. bindsym --to-code $mod+v splitv
  104. #Switch containers between different layouts.
  105. bindsym --to-code $mod+s layout stacking
  106. bindsym --to-code $mod+w layout tabbed
  107. bindsym --to-code $mod+e layout toggle split
  108. #Fullscreen.
  109. bindsym --to-code $mod+f fullscreen
  110. #Toggle tiling and floating.
  111. bindsym --to-code $mod+Shift+space floating toggle
  112. #Switch between floating and tiling.
  113. bindsym --to-code $mod+space focus mode_toggle
  114. #Focus parent.
  115. bindsym --to-code $mod+a focus parent
  116. #Scratchpad
  117. #Move window to scratchpad.
  118. bindsym --to-code $mod+Shift+Minus move scratchpad
  119. #Cycle through scratchpad windows.
  120. bindsym --to-code $mod+minus scratchpad show
  121. #Resize.
  122. mode "resize" {
  123. #Left.
  124. bindsym --to-code $left resize shrink width 10px
  125. bindsym --to-code Left resize shrink width 10px
  126. #Right.
  127. bindsym --to-code $right resize grow width 10px
  128. bindsym --to-code Right resize grow width 10px
  129. #Up.
  130. bindsym --to-code $up resize shrink height 10px
  131. bindsym --to-code Up resize shrink height 10px
  132. #Down.
  133. bindsym --to-code $down resize grow height 10px
  134. bindsym --to-code Down resize grow height 10px
  135. #Default mode.
  136. bindsym --to-code Return mode "default"
  137. bindsym --to-code Escape mode "default"
  138. bindsym --to-code Alt+F4 mode "default"
  139. }
  140. #Enable resize mode.
  141. bindsym --to-code $mod+r mode "resize"
  142. #Waybar.
  143. bar {
  144. swaybar_command waybar
  145. }
  146. #Opacity.
  147. bindsym --to-code $mod+Ctrl+n opacity minus 0.1
  148. bindsym --to-code $mod+Ctrl+m opacity 1
  149. include /etc/sway/config.d/*