config 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. # Default config for sway
  2. # See sway(5)
  3. set $mod Mod4
  4. set $left h
  5. set $down j
  6. set $up k
  7. set $right l
  8. set $term svte
  9. set $menu dmenu_path | bemenu | xargs swaymsg exec
  10. exec swayidle -w \
  11. timeout 30 'swaymsg output "*" dpms off' \
  12. resume 'swaymsg output "*" dpms on' \
  13. timeout 60 locker
  14. exec wlsunset -l 47.6 -L -1.8
  15. # Keybindings
  16. # Based on XMonad
  17. bindsym --to-code $mod+1 workspace 1
  18. bindsym --to-code $mod+2 workspace 2
  19. bindsym --to-code $mod+3 workspace 3
  20. bindsym --to-code $mod+4 workspace 4
  21. bindsym --to-code $mod+5 workspace 5
  22. bindsym --to-code $mod+6 workspace 6
  23. bindsym --to-code $mod+7 workspace 7
  24. bindsym --to-code $mod+8 workspace 8
  25. bindsym --to-code $mod+9 workspace 9
  26. bindsym --to-code $mod+0 workspace 10
  27. bindsym --to-code $mod+Shift+1 move window to workspace 1
  28. bindsym --to-code $mod+Shift+2 move window to workspace 2
  29. bindsym --to-code $mod+Shift+3 move window to workspace 3
  30. bindsym --to-code $mod+Shift+4 move window to workspace 4
  31. bindsym --to-code $mod+Shift+5 move window to workspace 5
  32. bindsym --to-code $mod+Shift+6 move window to workspace 6
  33. bindsym --to-code $mod+Shift+7 move window to workspace 7
  34. bindsym --to-code $mod+Shift+8 move window to workspace 8
  35. bindsym --to-code $mod+Shift+9 move window to workspace 9
  36. bindsym --to-code $mod+Shift+0 move window to workspace 10
  37. bindsym --to-code $mod+q reload
  38. #bindsym --to-code $mod+Shift+q exit
  39. output DP-2 pos 0 393
  40. output HDMI-A-1 pos 1920 0
  41. output HDMI-A-1 transform 270
  42. output HDMI-A-2 pos 3000 393
  43. bindsym --to-code $mod+w focus output DP-2
  44. bindsym --to-code $mod+Shift+w move workspace to output DP-2
  45. bindsym --to-code $mod+e focus output HDMI-A-1
  46. bindsym --to-code $mod+Shift+e move workspace to output HDMI-A-1
  47. bindsym --to-code $mod+r focus output HDMI-A-2
  48. bindsym --to-code $mod+Shift+r move workspace to output HDMI-A-2
  49. input "2:10:TPPS/2_Elan_TrackPoint" {
  50. scroll_factor 2
  51. pointer_accel 0.5
  52. }
  53. input "2:7:SynPS/2_Synaptics_TouchPad" {
  54. accel_profile flat
  55. natural_scroll enabled
  56. scroll_factor 2
  57. }
  58. input "1149:4130:Kensington_USB_Orbit" {
  59. middle_emulation enabled
  60. scroll_button button2
  61. }
  62. # Fucks with games
  63. input * dwt disabled
  64. bindsym --to-code $mod+Shift+p exec exec hiq-prompt
  65. bindsym --to-code $mod+p exec $menu
  66. bindsym $mod+Return exec $term
  67. bindsym --to-code $mod+Shift+c kill
  68. bindsym $mod+space layout toggle all
  69. bindsym $mod+Shift+space layout stacking
  70. floating_modifier $mod normal
  71. tiling_drag enable
  72. # Move your focus around
  73. bindsym --to-code $mod+$left focus left
  74. bindsym --to-code $mod+$down focus down
  75. bindsym --to-code $mod+$up focus up
  76. bindsym --to-code $mod+$right focus right
  77. # _move_ the focused window with the same, but add Shift
  78. bindsym --to-code $mod+Shift+$left move left
  79. bindsym --to-code $mod+Shift+$down move down
  80. bindsym --to-code $mod+Shift+$up move up
  81. bindsym --to-code $mod+Shift+$right move right
  82. bindsym --to-code $mod+f fullscreen
  83. bindsym --to-code $mod+s layout stacking
  84. #bindsym --to-code $mod+a focus parent
  85. #
  86. # Scratchpad:
  87. #
  88. # Sway has a "scratchpad", which is a bag of holding for windows.
  89. # You can send windows there and get them back later.
  90. # Move the currently focused window to the scratchpad
  91. bindsym $mod+Shift+minus move scratchpad
  92. # Show the next scratchpad window or hide the focused scratchpad window.
  93. # If there are multiple scratchpad windows, this command cycles through them.
  94. bindsym --to-code $mod+minus scratchpad show
  95. bindsym --to-code $mod+t floating disable
  96. bindsym --to-code $mod+Shift+t floating enable
  97. #
  98. # Resizing containers:
  99. #
  100. mode "resize" {
  101. # left will shrink the containers width
  102. # right will grow the containers width
  103. # up will shrink the containers height
  104. # down will grow the containers height
  105. bindsym --to-code $left resize shrink width 10px
  106. bindsym --to-code $down resize grow height 10px
  107. bindsym --to-code $up resize shrink height 10px
  108. bindsym --to-code $right resize grow width 10px
  109. # ditto, with arrow keys
  110. bindsym Left resize shrink width 10px
  111. bindsym Down resize grow height 10px
  112. bindsym Up resize shrink height 10px
  113. bindsym Right resize grow width 10px
  114. # return to default mode
  115. bindsym Return mode "default"
  116. bindsym Escape mode "default"
  117. }
  118. bindsym --to-code $mod+a mode "resize"
  119. bar {
  120. swaybar_command waybar
  121. }
  122. focus_follows_mouse no
  123. focus_on_window_activation none
  124. focus_wrapping no
  125. mouse_warping none
  126. workspace_layout stacking
  127. default_border pixel 1
  128. default_floating_border pixel 1
  129. smart_borders on
  130. # No titlebar ever
  131. exec_always swaymsg font "monospace 0"
  132. titlebar_border_thickness 0
  133. titlebar_padding 0
  134. for_window [title=".*"] title_format %title [%pid] (%class, %instance, %shell)
  135. for_window [app_id="mpv"] move workspace 3
  136. # Make sure XKB_DEFAULT_* stuff is used
  137. exec_always swaymsg 'input * xkb_layout "'${XKB_DEFAULT_LAYOUT}'"'
  138. exec_always swaymsg 'input * xkb_variant "'${XKB_DEFAULT_VARIANT}'"'
  139. exec_always swaymsg 'input * xkb_options "'${XKB_DEFAULT_OPTIONS}'"'
  140. bindsym Print exec 'slurp | grim -g - /tmp/screen.png'
  141. exec_always swaymsg 'output * bg "'${MY_WALLPAPER}'" "'${MY_WALLPAPER_MODE}'"'
  142. #bindsym --to-code $mod+b bar hidden_state toggle
  143. bindsym --to-code $mod+b exec killall -SIGUSR1 waybar
  144. bindsym XF86AudioMute exec amixer set Master playback toggle
  145. bindsym XF86AudioRaiseVolume exec amixer set Master playback 1%+
  146. bindsym XF86AudioLowerVolume exec amixer set Master playback 1%-
  147. bindsym XF86AudioMicMute exec amixer set Capture capture toggle
  148. bindsym XF86AudioPlay exec mpc toggle
  149. bindsym XF86AudioStop exec mpc stop
  150. bindsym XF86AudioPrev exec mpv prev
  151. bindsym XF86AudioNext exec mpv next
  152. # Launch Xwayland when needed
  153. xwayland enable
  154. exec $term