config 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374
  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 Mod4
  10. # Home row direction keys, like vim
  11. set $left h
  12. set $down j
  13. set $up k
  14. set $right l
  15. # Your preferred terminal emulator
  16. set $term alacritty
  17. # Your preferred web browser
  18. set $browser firefox
  19. # Your preferred application launcher
  20. # Note: it's recommended that you pass the final command to sway
  21. set $menu dmenu_path | bemenu-run --fb '#000000' --ab '#000000' --tb '#000000' --nb '#000000' --tf '#ffffff' --hf '#ffffff' --hb '#2e8b57' --border 1 --bdr '#333333' --line-height 25 --hp 10 --fn 'DejaVu Sans Mono 10' --list 20 --center --no-spacing | xargs swaymsg exec
  22. ### Output configuration
  23. #
  24. # Default wallpaper (more resolutions are available in /gnu/store/npk7022f0c2i9cjidh7133pklh27hqv3-sway-1.0/share/backgrounds/sway/)
  25. # output * bg fill
  26. #
  27. # Example configuration:
  28. #
  29. # output HDMI-A-1 resolution 1920x1080 position 1920,0
  30. #
  31. # You can get the names of your outputs by running: swaymsg -t get_outputs
  32. output * bg #000000 solid_color
  33. exec swaymsg create_output HEADLESS-1
  34. output HEADLESS-1 resolution 2880x1800@90Hz
  35. output HEADLESS-1 scale 2
  36. exec swaymsg create_output HEADLESS-2
  37. output HEADLESS-2 resolution 1366x768
  38. exec swaymsg create_output HEADLESS-3
  39. output HEADLESS-3 resolution 2880x1800@90Hz
  40. output HEADLESS-3 scale 2
  41. ### Idle configuration
  42. #
  43. # Example configuration:
  44. #
  45. # exec swayidle -w \
  46. # timeout 300 'swaylock -f -c 000000' \
  47. # timeout 600 'swaymsg "output * dpms off"' \
  48. # resume 'swaymsg "output * dpms on"' \
  49. # before-sleep 'swaylock -f -c 000000'
  50. #
  51. # This will lock your screen after 300 seconds of inactivity, then turn off
  52. # your displays after another 300 seconds, and turn your screens back on when
  53. # resumed. It will also lock your screen before your computer goes to sleep.
  54. # exec swayidle -w \
  55. # timeout 600 'swaymsg "output * dpms off"' \
  56. # resume 'swaymsg "output * dpms on"'
  57. #
  58. # Clipboard
  59. #
  60. # https://github.com/yory8/clipman
  61. exec wl-paste -t text --watch clipman store
  62. exec wl-paste -p -t text --watch clipman store -P --histpath="~/.local/share/clipman-primary.json"
  63. bindsym $mod+y exec clipman pick -t wofi
  64. ### Input configuration
  65. #
  66. # Example configuration:
  67. #
  68. # input "2:14:SynPS/2_Synaptics_TouchPad" {
  69. # dwt enabled
  70. # tap enabled
  71. # natural_scroll enabled
  72. # middle_emulation enabled
  73. # }
  74. #
  75. # You can get the names of your inputs by running: swaymsg -t get_inputs
  76. # Read `man 5 sway-input` for more information about this section.
  77. ### Key bindings
  78. #
  79. # Basics:
  80. #
  81. # start a terminal
  82. bindsym $mod+Return exec $term
  83. # start a web browser
  84. bindsym $mod+Shift+w exec $browser
  85. bindsym $mod+Shift+m exec looking-glass-client-wrapper
  86. bindsym $mod+Shift+s exec /home/oleg/.local/share/chezmoi/dot_local/bin/executable_passmenu
  87. bindsym $mod+Shift+v exec virt-manager
  88. # kill focused window
  89. bindsym $mod+Shift+q kill
  90. # start your launcher
  91. bindsym $mod+d exec $menu
  92. # Drag floating windows by holding down $mod and left mouse button.
  93. # Resize them with right mouse button + $mod.
  94. # Despite the name, also works for non-floating windows.
  95. # Change normal to inverse to use left mouse button for resizing and right
  96. # mouse button for dragging.
  97. floating_modifier $mod normal
  98. bindsym button3 kill
  99. # reload the configuration file
  100. bindsym $mod+Shift+c reload
  101. # exit sway (logs you out of your Wayland session)
  102. bindsym $mod+Shift+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+Shift+$left move left
  118. bindsym $mod+Shift+$down move down
  119. bindsym $mod+Shift+$up move up
  120. bindsym $mod+Shift+$right move right
  121. # ditto, with arrow keys
  122. bindsym $mod+Shift+Left move left
  123. bindsym $mod+Shift+Down move down
  124. bindsym $mod+Shift+Up move up
  125. bindsym $mod+Shift+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+Shift+1 move container to workspace 1
  142. bindsym $mod+Shift+2 move container to workspace 2
  143. bindsym $mod+Shift+3 move container to workspace 3
  144. bindsym $mod+Shift+4 move container to workspace 4
  145. bindsym $mod+Shift+5 move container to workspace 5
  146. bindsym $mod+Shift+6 move container to workspace 6
  147. bindsym $mod+Shift+7 move container to workspace 7
  148. bindsym $mod+Shift+8 move container to workspace 8
  149. bindsym $mod+Shift+9 move container to workspace 9
  150. bindsym $mod+Shift+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. # You can "split" the current object of your focus with
  157. # $mod+b or $mod+v, for horizontal and vertical splits
  158. # respectively.
  159. bindsym $mod+b splith
  160. bindsym $mod+v splitv
  161. # Switch the current container between different layout styles
  162. bindsym $mod+s layout stacking
  163. bindsym $mod+w layout tabbed
  164. bindsym $mod+e layout toggle split
  165. # Make the current focus fullscreen
  166. bindsym $mod+f fullscreen
  167. # Toggle the current focus between tiling and floating mode
  168. bindsym $mod+Shift+t floating toggle
  169. bindsym $mod+Shift+a sticky toggle
  170. # Swap focus between the tiling area and the floating area
  171. # bindsym $mod+space focus mode_toggle
  172. # move focus to the parent container
  173. bindsym $mod+a focus parent
  174. #
  175. # Scratchpad:
  176. #
  177. # Sway has a "scratchpad", which is a bag of holding for windows.
  178. # You can send windows there and get them back later.
  179. # Move the currently focused window to the scratchpad
  180. bindsym $mod+Shift+minus move scratchpad
  181. # Show the next scratchpad window or hide the focused scratchpad window.
  182. # If there are multiple scratchpad windows, this command cycles through them.
  183. bindsym $mod+minus scratchpad show
  184. #
  185. # Volume:
  186. #
  187. bindsym XF86AudioRaiseVolume exec pactl set-sink-volume alsa_output.pci-0000_30_00.6.analog-stereo +5%
  188. bindsym XF86AudioLowerVolume exec pactl set-sink-volume alsa_output.pci-0000_30_00.6.analog-stereo -5%
  189. bindsym XF86AudioMute exec pactl set-sink-mute alsa_output.pci-0000_30_00.6.analog-stereo toggle
  190. #
  191. # Brightness:
  192. #
  193. bindsym XF86Calculator exec brightness increase 5
  194. bindsym XF86HomePage exec brightness decrease 5
  195. bindsym XF86Mail exec brightness toggle
  196. #
  197. # Inputs:
  198. #
  199. # HDMI-1
  200. bindsym XF86AudioPrev exec sudo /home/oleg/.nix-profile/bin/ddcutil setvcp xF4 x0090 --i2c-source-addr=x50 --noverify
  201. # HDMI-2
  202. bindsym XF86AudioPlay exec sudo /home/oleg/.nix-profile/bin/ddcutil setvcp xF4 x0091 --i2c-source-addr=x50 --noverify
  203. # DP-1
  204. bindsym XF86AudioNext exec sudo /home/oleg/.nix-profile/bin/ddcutil setvcp xF4 x00d0 --i2c-source-addr=x50 --noverify
  205. #
  206. # Switch DP-1 on and off:
  207. #
  208. bindsym XF86Tools exec swaymsg "output DP-1 dpms on"
  209. bindsym XF86AudioStop exec swaymsg "output DP-1 dpms off"
  210. #
  211. # Screenshots:
  212. #
  213. # capture all screens
  214. bindsym Print exec grim -t png
  215. # capture the specified screen area
  216. bindsym Ctrl+Print exec grim -g "$(slurp -d)" -t png
  217. #
  218. # Notifications
  219. #
  220. bindsym $mod+n exec makoctl dismiss
  221. bindsym $mod+Shift+n exec makoctl dismiss --all
  222. #
  223. # Resizing containers:
  224. #
  225. mode "resize" {
  226. # left will shrink the containers width
  227. # right will grow the containers width
  228. # up will shrink the containers height
  229. # down will grow the containers height
  230. bindsym $left resize shrink width 10px
  231. bindsym $down resize grow height 10px
  232. bindsym $up resize shrink height 10px
  233. bindsym $right resize grow width 10px
  234. # ditto, with arrow keys
  235. bindsym Left resize shrink width 10px
  236. bindsym Down resize grow height 10px
  237. bindsym Up resize shrink height 10px
  238. bindsym Right resize grow width 10px
  239. # return to default mode
  240. bindsym Return mode "default"
  241. bindsym Escape mode "default"
  242. bindsym y resize set width 1920 px
  243. }
  244. bindsym $mod+r mode "resize"
  245. #
  246. # OBS:
  247. #
  248. mode "obs" {
  249. # switch to scene
  250. bindsym 0 exec /home/oleg/.local/share/chezmoi/dot_local/bin/executable_obs-websocket-http.sh edit scene scene-0
  251. bindsym 1 exec /home/oleg/.local/share/chezmoi/dot_local/bin/executable_obs-websocket-http.sh edit scene scene-1
  252. # return to default mode
  253. bindsym Return mode "default"
  254. bindsym Escape mode "default"
  255. }
  256. bindsym $mod+o mode "obs"
  257. #
  258. # Status Bar:
  259. #
  260. # Read `man 5 sway-bar` for more information about this section.
  261. bar {
  262. # Show bar only when mode key is pressed.
  263. mode hide
  264. position bottom
  265. output DP-1
  266. output HEADLESS-1
  267. # When the status_command prints a new line to stdout, swaybar updates.
  268. # The default just shows the current date and time.
  269. status_command exec /home/oleg/.local/bin/sensors.py
  270. colors {
  271. statusline #000000
  272. background #ffffff
  273. focused_workspace #66cdaa #2e8b57 #ffffff
  274. # active_workspace #333333 #333333 #888888
  275. inactive_workspace #ffffff #ffffff #000000
  276. urgent_workspace #eb709b #eb709b #000000
  277. }
  278. }
  279. input * {
  280. xkb_layout custom,ru
  281. xkb_options grp:win_space_toggle,grp_led:scroll
  282. }
  283. input "2385:5860:Kingston_HyperX_Pulsefire_Raid" {
  284. accel_profile flat
  285. pointer_accel -0.5
  286. }
  287. # class border backgr. text indicator child_border
  288. client.focused #66cdaa #2e8b57 #ffffff #00ff00 #2e8b57
  289. client.focused_inactive #696969 #a9a9a9 #000000 #484e50 #5f676a
  290. client.unfocused #a9a9a9 #ffffff #000000 #292d2e #222222
  291. client.urgent #bebebe #900000 #000000 #900000 #900000
  292. client.placeholder #ffffff #0c0c0c #000000 #ffffff #0c0c0c
  293. client.background #ffffff
  294. # List windows properties:
  295. #
  296. # $ swaymsg -t get_tree
  297. for_window [title="Looking Glass"] border none
  298. for_window [title="Looking Glass"] resize set width 1920 px
  299. for_window [title="xterm"] resize set width 1920 px
  300. for_window [title="Picture-in-Picture"] border none
  301. for_window [title="Picture-in-Picture"] resize set height 360 px
  302. for_window [title="Picture-in-Picture"] floating enable
  303. for_window [instance="vncviewer"] border none
  304. for_window [instance="vncviewer"] resize set width 1920 px
  305. for_window [title="Windowed Projector"] border none
  306. for_window [title="Chatterino"] border none
  307. for_window [title="Usercard"] move position cursor