config 11 KB

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