config 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363
  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 1800x950
  35. ### Idle configuration
  36. #
  37. # Example configuration:
  38. #
  39. # exec swayidle -w \
  40. # timeout 300 'swaylock -f -c 000000' \
  41. # timeout 600 'swaymsg "output * dpms off"' \
  42. # resume 'swaymsg "output * dpms on"' \
  43. # before-sleep 'swaylock -f -c 000000'
  44. #
  45. # This will lock your screen after 300 seconds of inactivity, then turn off
  46. # your displays after another 300 seconds, and turn your screens back on when
  47. # resumed. It will also lock your screen before your computer goes to sleep.
  48. # exec swayidle -w \
  49. # timeout 600 'swaymsg "output * dpms off"' \
  50. # resume 'swaymsg "output * dpms on"'
  51. #
  52. # Clipboard
  53. #
  54. # https://github.com/yory8/clipman
  55. exec wl-paste -t text --watch clipman store
  56. exec wl-paste -p -t text --watch clipman store -P --histpath="~/.local/share/clipman-primary.json"
  57. bindsym $mod+y exec clipman pick -t wofi
  58. ### Input configuration
  59. #
  60. # Example configuration:
  61. #
  62. # input "2:14:SynPS/2_Synaptics_TouchPad" {
  63. # dwt enabled
  64. # tap enabled
  65. # natural_scroll enabled
  66. # middle_emulation enabled
  67. # }
  68. #
  69. # You can get the names of your inputs by running: swaymsg -t get_inputs
  70. # Read `man 5 sway-input` for more information about this section.
  71. ### Key bindings
  72. #
  73. # Basics:
  74. #
  75. # start a terminal
  76. bindsym $mod+Return exec $term
  77. # start a web browser
  78. bindsym $mod+Shift+w exec $browser
  79. bindsym $mod+Shift+m exec looking-glass-client-wrapper
  80. bindsym $mod+Shift+s exec /home/oleg/.local/share/chezmoi/dot_local/bin/executable_passmenu
  81. bindsym $mod+Shift+v exec virt-manager
  82. # kill focused window
  83. bindsym $mod+Shift+q kill
  84. # start your launcher
  85. bindsym $mod+d exec $menu
  86. # Drag floating windows by holding down $mod and left mouse button.
  87. # Resize them with right mouse button + $mod.
  88. # Despite the name, also works for non-floating windows.
  89. # Change normal to inverse to use left mouse button for resizing and right
  90. # mouse button for dragging.
  91. floating_modifier $mod normal
  92. bindsym button3 kill
  93. # reload the configuration file
  94. bindsym $mod+Shift+c reload
  95. # exit sway (logs you out of your Wayland session)
  96. 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'
  97. #
  98. # Moving around:
  99. #
  100. # Move your focus around
  101. bindsym $mod+$left focus left
  102. bindsym $mod+$down focus down
  103. bindsym $mod+$up focus up
  104. bindsym $mod+$right focus right
  105. # or use $mod+[up|down|left|right]
  106. bindsym $mod+Left focus left
  107. bindsym $mod+Down focus down
  108. bindsym $mod+Up focus up
  109. bindsym $mod+Right focus right
  110. # _move_ the focused window with the same, but add Shift
  111. bindsym $mod+Shift+$left move left
  112. bindsym $mod+Shift+$down move down
  113. bindsym $mod+Shift+$up move up
  114. bindsym $mod+Shift+$right move right
  115. # ditto, with arrow keys
  116. bindsym $mod+Shift+Left move left
  117. bindsym $mod+Shift+Down move down
  118. bindsym $mod+Shift+Up move up
  119. bindsym $mod+Shift+Right move right
  120. #
  121. # Workspaces:
  122. #
  123. # switch to workspace
  124. bindsym $mod+1 workspace 1
  125. bindsym $mod+2 workspace 2
  126. bindsym $mod+3 workspace 3
  127. bindsym $mod+4 workspace 4
  128. bindsym $mod+5 workspace 5
  129. bindsym $mod+6 workspace 6
  130. bindsym $mod+7 workspace 7
  131. bindsym $mod+8 workspace 8
  132. bindsym $mod+9 workspace 9
  133. bindsym $mod+0 workspace 10
  134. # move focused container to workspace
  135. bindsym $mod+Shift+1 move container to workspace 1
  136. bindsym $mod+Shift+2 move container to workspace 2
  137. bindsym $mod+Shift+3 move container to workspace 3
  138. bindsym $mod+Shift+4 move container to workspace 4
  139. bindsym $mod+Shift+5 move container to workspace 5
  140. bindsym $mod+Shift+6 move container to workspace 6
  141. bindsym $mod+Shift+7 move container to workspace 7
  142. bindsym $mod+Shift+8 move container to workspace 8
  143. bindsym $mod+Shift+9 move container to workspace 9
  144. bindsym $mod+Shift+0 move container to workspace 10
  145. # Note: workspaces can have any name you want, not just numbers.
  146. # We just use 1-10 as the default.
  147. #
  148. # Layout stuff:
  149. #
  150. # You can "split" the current object of your focus with
  151. # $mod+b or $mod+v, for horizontal and vertical splits
  152. # respectively.
  153. bindsym $mod+b splith
  154. bindsym $mod+v splitv
  155. # Switch the current container between different layout styles
  156. bindsym $mod+s layout stacking
  157. bindsym $mod+w layout tabbed
  158. bindsym $mod+e layout toggle split
  159. # Make the current focus fullscreen
  160. bindsym $mod+f fullscreen
  161. # Toggle the current focus between tiling and floating mode
  162. bindsym $mod+Shift+t floating toggle
  163. bindsym $mod+Shift+a sticky toggle
  164. # Swap focus between the tiling area and the floating area
  165. # bindsym $mod+space focus mode_toggle
  166. # move focus to the parent container
  167. bindsym $mod+a focus parent
  168. #
  169. # Scratchpad:
  170. #
  171. # Sway has a "scratchpad", which is a bag of holding for windows.
  172. # You can send windows there and get them back later.
  173. # Move the currently focused window to the scratchpad
  174. bindsym $mod+Shift+minus move scratchpad
  175. # Show the next scratchpad window or hide the focused scratchpad window.
  176. # If there are multiple scratchpad windows, this command cycles through them.
  177. bindsym $mod+minus scratchpad show
  178. #
  179. # Volume:
  180. #
  181. bindsym XF86AudioRaiseVolume exec pactl set-sink-volume alsa_output.pci-0000_30_00.6.analog-stereo +5%
  182. bindsym XF86AudioLowerVolume exec pactl set-sink-volume alsa_output.pci-0000_30_00.6.analog-stereo -5%
  183. bindsym XF86AudioMute exec pactl set-sink-mute alsa_output.pci-0000_30_00.6.analog-stereo toggle
  184. #
  185. # Brightness:
  186. #
  187. bindsym XF86Calculator exec brightness increase 5
  188. bindsym XF86HomePage exec brightness decrease 5
  189. bindsym XF86Mail exec brightness toggle
  190. #
  191. # Inputs:
  192. #
  193. # HDMI-1
  194. bindsym XF86AudioPrev exec sudo /home/oleg/.nix-profile/bin/ddcutil setvcp xF4 x0090 --i2c-source-addr=x50 --noverify
  195. # HDMI-2
  196. bindsym XF86AudioPlay exec sudo /home/oleg/.nix-profile/bin/ddcutil setvcp xF4 x0091 --i2c-source-addr=x50 --noverify
  197. # DP-1
  198. bindsym XF86AudioNext exec sudo /home/oleg/.nix-profile/bin/ddcutil setvcp xF4 x00d0 --i2c-source-addr=x50 --noverify
  199. #
  200. # Switch DP-1 on and off:
  201. #
  202. bindsym XF86Tools exec swaymsg "output DP-1 dpms on"
  203. bindsym XF86AudioStop exec swaymsg "output DP-1 dpms off"
  204. #
  205. # Screenshots:
  206. #
  207. # capture all screens
  208. bindsym Print exec grim -t png
  209. # capture the specified screen area
  210. bindsym Ctrl+Print exec grim -g "$(slurp -d)" -t png
  211. #
  212. # Notifications
  213. #
  214. bindsym $mod+n exec makoctl dismiss
  215. bindsym $mod+Shift+n exec makoctl dismiss --all
  216. #
  217. # Resizing containers:
  218. #
  219. mode "resize" {
  220. # left will shrink the containers width
  221. # right will grow the containers width
  222. # up will shrink the containers height
  223. # down will grow the containers height
  224. bindsym $left resize shrink width 10px
  225. bindsym $down resize grow height 10px
  226. bindsym $up resize shrink height 10px
  227. bindsym $right resize grow width 10px
  228. # ditto, with arrow keys
  229. bindsym Left resize shrink width 10px
  230. bindsym Down resize grow height 10px
  231. bindsym Up resize shrink height 10px
  232. bindsym Right resize grow width 10px
  233. # return to default mode
  234. bindsym Return mode "default"
  235. bindsym Escape mode "default"
  236. bindsym y resize set width 1920 px
  237. }
  238. bindsym $mod+r mode "resize"
  239. #
  240. # OBS:
  241. #
  242. mode "obs" {
  243. # switch to scene
  244. bindsym 0 exec /home/oleg/.local/share/chezmoi/dot_local/bin/executable_obs-websocket-http.sh edit scene scene-0
  245. bindsym 1 exec /home/oleg/.local/share/chezmoi/dot_local/bin/executable_obs-websocket-http.sh edit scene scene-1
  246. # return to default mode
  247. bindsym Return mode "default"
  248. bindsym Escape mode "default"
  249. }
  250. bindsym $mod+o mode "obs"
  251. #
  252. # Status Bar:
  253. #
  254. # Read `man 5 sway-bar` for more information about this section.
  255. bar {
  256. position bottom
  257. # When the status_command prints a new line to stdout, swaybar updates.
  258. # The default just shows the current date and time.
  259. status_command exec /home/oleg/.local/bin/sensors.py
  260. colors {
  261. statusline #ffffff
  262. background #000000
  263. focused_workspace #66cdaa #2e8b57 #000000
  264. # active_workspace #333333 #333333 #888888
  265. inactive_workspace #000000 #000000 #ffffff
  266. urgent_workspace #eb709b #eb709b #ffffff
  267. }
  268. }
  269. input * {
  270. xkb_layout custom,ru
  271. xkb_options grp:win_space_toggle,grp_led:scroll
  272. }
  273. input "2385:5860:Kingston_HyperX_Pulsefire_Raid" {
  274. accel_profile flat
  275. pointer_accel -0.5
  276. }
  277. # class border backgr. text indicator child_border
  278. client.focused #000000 #2e8b57 #000000 #000000 #000000
  279. client.focused_inactive #000000 #000000 #ffffff #000000 #000000
  280. client.unfocused #000000 #000000 #ffffff #000000 #000000
  281. client.urgent #bebebe #900000 #ffffff #900000 #900000
  282. client.placeholder #000000 #0c0c0c #ffffff #000000 #0c0c0c
  283. client.background #000000
  284. # List windows properties:
  285. #
  286. # $ swaymsg -t get_tree
  287. for_window [title="Looking Glass"] border none
  288. for_window [title="Looking Glass"] resize set width 1920 px
  289. for_window [title="xterm"] resize set width 1920 px
  290. for_window [title="Picture-in-Picture"] border none
  291. for_window [title="Picture-in-Picture"] resize set height 360 px
  292. for_window [title="Picture-in-Picture"] floating enable
  293. for_window [instance="vncviewer"] border none
  294. for_window [instance="vncviewer"] resize set width 1920 px
  295. # OBS
  296. # for_window [title="Windowed Projector"] border none
  297. for_window [title="Chatterino"] border none
  298. for_window [title="Usercard"] move position cursor
  299. # for_window [title="chivalry2-win64-shipping.exe"] border none