Advertisement
Guest User

Untitled

a guest
Mar 19th, 2024
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.92 KB | None | 0 0
  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.  
  7.  
  8. ### Variables
  9. #
  10. # Logo key. Use Mod1 for Alt.
  11. set $mod Mod4
  12. set $user
  13.  
  14. output HDMI-A-1 scale 1
  15. output eDP-1 scale 1.6
  16. output eDP-1 pos 0 0 res 2560x1600
  17. output HDMI-A-1 pos 1600 -550 res 2560x1440
  18.  
  19. # Disable monitors, e.g when gaming
  20. bindsym $mod+m output "eDP-1" disable ; output HDMI-A-1 pos 1600 0 res 2560x1440
  21. bindsym $mod+Shift+m output "eDP-1" enable ; output HDMI-A-1 pos 1600 -550 res 2560x1440
  22. bindsym $mod+n output "eDP-1" scale 1
  23. bindsym $mod+Shift+n output "eDP-1" scale 1.6
  24.  
  25. #input "1267:12699:ASUE120A:00_04F3:319B_Touchpad" {
  26. input type:touchpad {
  27. dwt enabled
  28. tap enabled
  29. middle_emulation enabled
  30. natural_scroll enabled
  31. }
  32.  
  33. input type:keyboard {
  34. xkb_layout us,gr
  35. xkb_options grp:ctrl_alt_toggle
  36. repeat_rate 40
  37. repeat_delay 160
  38. }
  39. # Disable touchpad
  40. bindsym XF86TouchpadToggle input type:touchpad events toggle enabled disabled
  41.  
  42. # Handle caps lock
  43. exec --no-startup-id echo "0" > /home/$user/.config/sway/capslock
  44. bindsym Caps_Lock exec --no-startup-id "source /home/$user/.config/sway/swaybar.sh; toggle_caps"
  45.  
  46. # App launcher config
  47. set $menu bemenu-run -p "" | xargs swaymsg exec --
  48.  
  49. # Monitor and keyboard brightness
  50. bindsym XF86MonBrightnessUp exec light -A 5
  51. bindsym XF86MonBrightnessDown exec light -U 5
  52. bindsym XF86KbdBrightnessUp exec light -As "sysfs/leds/asus::kbd_backlight" 60
  53. bindsym XF86KbdBrightnessDown exec light -Us "sysfs/leds/asus::kbd_backlight" 60
  54.  
  55. default_border pixel 1
  56.  
  57. # Set colors for the focused client. #999999 is dark grey
  58. client.focused #999999 #999999 #999999 #999999
  59.  
  60. # Hide cursor when idle
  61. seat * hide_cursor 5000
  62.  
  63. # Screensharing
  64. exec --no-startup-id dbus-update-activation-environment --all
  65.  
  66. #bindsym Print exec slurpshot
  67.  
  68. exec gentoo-pipewire-launcher &
  69. bindsym XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +5%
  70. bindsym XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -5%
  71. bindsym XF86AudioMute exec pactl set-sink-volume @DEFAULT_SINK@ 0
  72.  
  73. for_window [window_role = "pop-up"] floating enable
  74. for_window [window_role = "bubble"] floating enable
  75. for_window [window_role = "dialog"] floating enable
  76. for_window [window_type = "dialog"] floating enable
  77. for_window [window_role = "task_dialog"] floating enable
  78. for_window [window_type = "menu"] floating enable
  79. for_window [app_id = "floating"] floating enable
  80. for_window [app_id = "floating_update"] floating enable, resize set width 1000px height 600px
  81. for_window [class = "(?i)pinentry"] floating enable
  82. for_window [title = "Administrator privileges required"] floating enable
  83.  
  84. for_window [title = "About Mozilla Firefox"] floating enable
  85. for_window [window_role = "About"] floating enable
  86. for_window [app_id="firefox" title="Library"] floating enable, border pixel 1, sticky enable
  87.  
  88. for_window [class="^Steam$" title="^Friends$"] floating enable
  89. for_window [class="^Steam$" title="Steam - News"] floating enable
  90. for_window [class="^Steam$" title=".* - Chat"] floating enable
  91. for_window [class="^Steam$" title="^Settings$"] floating enable
  92. for_window [class="^Steam$" title=".* - event started"] floating enable
  93. for_window [class="^Steam$" title=".* CD key"] floating enable
  94. for_window [class="^Steam$" title="^Steam - Self Updater$"] floating enable
  95. for_window [class="^Steam$" title="^Screenshot Uploader$"] floating enable
  96. for_window [class="^Steam$" title="^Steam Guard - Computer Authorization Required$"] floating enable
  97. for_window [title="^Steam Keyboard$"] floating enable
  98.  
  99. set $psf /home/$user/Images/Screenshots/ps_$(date +"%Y%m%d%H%M%S").png
  100. set $screenshot 1 Full-Screen, 2 Selected-Screen, 3 Full clipboard, 4 Selected clipboard, 5 Current-Monitor, 6 Current-Monitor clipboard, 7 Current-Window, 8 Current-Window clipboard
  101. mode "$screenshot" {
  102. bindsym 1 exec grim $psf, mode "default"
  103. bindsym 2 exec grim -g "$(slurp)" $psf, mode "default"
  104. bindsym 3 exec grim - | wl-copy, mode "default"
  105. bindsym 4 exec grim -g "$(slurp)" - | wl-copy, mode "default"
  106. bindsym 5 exec grim -o $(swaymsg -t get_outputs | jq -r '.[] | select(.focused) | .name') $psf, mode "default"
  107. bindsym 6 exec grim -o $(swaymsg -t get_outputs | jq -r '.[] | select(.focused) | .name') - | wl-copy, mode "default"
  108. bindsym 7 exec swaymsg -t get_tree | jq -r '.. | (.nodes? // empty)[] | select(.focused) | "\(.rect.x),\(.rect.y) \(.rect.width)x\(.rect.height)"' | grim -g - $psf, mode "default"
  109. bindsym 8 exec swaymsg -t get_tree | jq -r '.. | (.nodes? // empty)[] | select(.focused) | "\(.rect.x),\(.rect.y) \(.rect.width)x\(.rect.height)"' | grim -g - - | wl-copy, mode "default"
  110. bindsym Return mode "default"
  111. bindsym Escape mode "default"
  112. bindsym Print mode "default"
  113. }
  114. bindsym Print mode "$screenshot"
  115.  
  116. bindsym XF86Launch1 exec sudo /home/$user/.config/sway/chgovernor.sh
  117.  
  118. # Lock screen with custom commands
  119.  
  120. # Home row direction keys, like vim
  121. set $left h
  122. set $down j
  123. set $up k
  124. set $right l
  125. # Your preferred terminal emulator
  126. set $term foot
  127. # Your preferred application launcher
  128. # Note: pass the final command to swaymsg so that the resulting window can be opened
  129. # on the original workspace that the command was run on.
  130.  
  131. ### Output configuration
  132. #
  133. # Default wallpaper (more resolutions are available in /usr/share/backgrounds/sway/)
  134. #output * bg /usr/share/backgrounds/sway/Sway_Wallpaper_Blue_1920x1080.png fill
  135. output * bg /home/$user/Downloads/wallpaper.jpg fill
  136. #
  137. # Example configuration:
  138. #
  139. # output HDMI-A-1 resolution 1920x1080 position 1920,0
  140. #
  141. # You can get the names of your outputs by running: swaymsg -t get_outputs
  142.  
  143. ### Idle configuration
  144. #
  145. # Example configuration:
  146. #
  147. # Sway must restart to add an exec command. Log out and back on.
  148. # Use exec_always to restart an exec on config reload without restarting sway.
  149. # --daemonize to run all subsequent commands or it will hang at swaylock
  150. exec_always killall swayidle; swayidle -w timeout 300 'grim -o eDP-1 /tmp/eDP.png; grim -o HDMI-A-1 /tmp/HDMI.png; convert /tmp/eDP.png -blur 0x10 /tmp/blurredeDP.png; convert /tmp/HDMI.png -blur 0x10 /tmp/blurredHDMI.png; swaylock -i HDMI-A-1:/tmp/blurredHDMI.png -i eDP-1:/tmp/blurredeDP.png --show-failed-attempts --indicator-caps-lock --daemonize'\
  151. timeout 600 'swaymsg "output * power off"' resume 'swaymsg "output * power on"' \
  152. before-sleep 'grim -o eDP-1 /tmp/eDP.png; grim -o HDMI-A-1 /tmp/HDMI.png; convert /tmp/eDP.png -blur 0x10 /tmp/blurredeDP.png; convert /tmp/HDMI.png -blur 0x10 /tmp/blurredHDMI.png; swaylock -i HDMI-A-1:/tmp/blurredHDMI.png -i eDP-1:/tmp/blurredeDP.png -F -l'
  153.  
  154. # This will lock your screen after 300 seconds of inactivity, then turn off
  155. # your displays after another 300 seconds, and turn your screens back on when
  156. # resumed. It will also lock your screen before your computer goes to sleep.
  157.  
  158. ### Input configuration
  159. #
  160. # Example configuration:
  161. #
  162. # input "2:14:SynPS/2_Synaptics_TouchPad" {
  163. # dwt enabled
  164. # tap enabled
  165. # natural_scroll enabled
  166. # middle_emulation enabled
  167. # }
  168. #
  169. # You can get the names of your inputs by running: swaymsg -t get_inputs
  170. # Read `man 5 sway-input` for more information about this section.
  171.  
  172. ### Key bindings
  173. #
  174. # Basics:
  175. #
  176. # Start a terminal
  177. bindsym $mod+Return exec $term
  178.  
  179. # Kill focused window
  180. bindsym $mod+Shift+q kill
  181.  
  182. # Start your launcher
  183. bindsym $mod+d exec $menu
  184.  
  185. # Drag floating windows by holding down $mod and left mouse button.
  186. # Resize them with right mouse button + $mod.
  187. # Despite the name, also works for non-floating windows.
  188. # Change normal to inverse to use left mouse button for resizing and right
  189. # mouse button for dragging.
  190. floating_modifier $mod normal
  191.  
  192. # Reload the configuration file
  193. bindsym $mod+Shift+c reload
  194.  
  195. # Exit sway (logs you out of your Wayland session)
  196. #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'
  197. #
  198. # Moving around:
  199. #
  200. # Move your focus around
  201. bindsym $mod+$left focus left
  202. bindsym $mod+$down focus down
  203. bindsym $mod+$up focus up
  204. bindsym $mod+$right focus right
  205. # Or use $mod+[up|down|left|right]
  206. bindsym $mod+Left focus left
  207. bindsym $mod+Down focus down
  208. bindsym $mod+Up focus up
  209. bindsym $mod+Right focus right
  210.  
  211. # Move the focused window with the same, but add Shift
  212. bindsym $mod+Shift+$left move left
  213. bindsym $mod+Shift+$down move down
  214. bindsym $mod+Shift+$up move up
  215. bindsym $mod+Shift+$right move right
  216. # Ditto, with arrow keys
  217. bindsym $mod+Shift+Left move left
  218. bindsym $mod+Shift+Down move down
  219. bindsym $mod+Shift+Up move up
  220. bindsym $mod+Shift+Right move right
  221. #
  222. # Workspaces:
  223. #
  224. # Switch to workspace
  225. bindsym $mod+1 workspace number 1
  226. bindsym $mod+2 workspace number 2
  227. bindsym $mod+3 workspace number 3
  228. bindsym $mod+4 workspace number 4
  229. bindsym $mod+5 workspace number 5
  230. bindsym $mod+6 workspace number 6
  231. bindsym $mod+7 workspace number 7
  232. bindsym $mod+8 workspace number 8
  233. bindsym $mod+9 workspace number 9
  234. bindsym $mod+0 workspace number 10
  235. # Move focused container to workspace
  236. bindsym $mod+Shift+1 move container to workspace number 1
  237. bindsym $mod+Shift+2 move container to workspace number 2
  238. bindsym $mod+Shift+3 move container to workspace number 3
  239. bindsym $mod+Shift+4 move container to workspace number 4
  240. bindsym $mod+Shift+5 move container to workspace number 5
  241. bindsym $mod+Shift+6 move container to workspace number 6
  242. bindsym $mod+Shift+7 move container to workspace number 7
  243. bindsym $mod+Shift+8 move container to workspace number 8
  244. bindsym $mod+Shift+9 move container to workspace number 9
  245. bindsym $mod+Shift+0 move container to workspace number 10
  246. # Note: workspaces can have any name you want, not just numbers.
  247. # We just use 1-10 as the default.
  248. #
  249. # Layout stuff:
  250. #
  251. # You can "split" the current object of your focus with
  252. # $mod+b or $mod+v, for horizontal and vertical splits
  253. # respectively.
  254. bindsym $mod+b splith
  255. bindsym $mod+v splitv
  256.  
  257. # Switch the current container between different layout styles
  258. bindsym $mod+s layout stacking
  259. bindsym $mod+w layout tabbed
  260. bindsym $mod+e layout toggle split
  261.  
  262. # Make the current focus fullscreen
  263. bindsym $mod+f fullscreen
  264.  
  265. # Toggle the current focus between tiling and floating mode
  266. bindsym $mod+Shift+space floating toggle
  267.  
  268. # Swap focus between the tiling area and the floating area
  269. bindsym $mod+space focus mode_toggle
  270.  
  271. # Move focus to the parent container
  272. bindsym $mod+a focus parent
  273. #
  274. # Scratchpad:
  275. #
  276. # Sway has a "scratchpad", which is a bag of holding for windows.
  277. # You can send windows there and get them back later.
  278.  
  279. # Move the currently focused window to the scratchpad
  280. bindsym $mod+Shift+minus move scratchpad
  281.  
  282. # Show the next scratchpad window or hide the focused scratchpad window.
  283. # If there are multiple scratchpad windows, this command cycles through them.
  284. bindsym $mod+minus scratchpad show
  285. #
  286. # Resizing containers:
  287. #
  288. mode "resize" {
  289. # left will shrink the containers width
  290. # right will grow the containers width
  291. # up will shrink the containers height
  292. # down will grow the containers height
  293. bindsym $left resize shrink width 10px
  294. bindsym $down resize grow height 10px
  295. bindsym $up resize shrink height 10px
  296. bindsym $right resize grow width 10px
  297.  
  298. # Ditto, with arrow keys
  299. bindsym Left resize shrink width 10px
  300. bindsym Down resize grow height 10px
  301. bindsym Up resize shrink height 10px
  302. bindsym Right resize grow width 10px
  303.  
  304. # Return to default mode
  305. bindsym Return mode "default"
  306. bindsym Escape mode "default"
  307. }
  308. bindsym $mod+r mode "resize"
  309.  
  310. #
  311. # Status Bar:
  312. #
  313. # Read `man 5 sway-bar` for more information about this section.
  314. bar {
  315. position top
  316.  
  317. # When the status_command prints a new line to stdout, swaybar updates.
  318. # The default just shows the current date and time.
  319. status_command while ~/.config/sway/swaybar.sh; do sleep 0.1; done
  320.  
  321. colors {
  322. statusline #ffffff
  323. background #323232
  324. inactive_workspace #555555 #555555 #ffffff
  325. focused_workspace #999999 #999999 #ffffff
  326. }
  327. }
  328.  
  329. set $mode_system System: (l) lock, (e) logout, (s) suspend, (r) reboot, (S) shutdown, (R) UEFI
  330. mode "$mode_system" {
  331. bindsym l exec 'grim -o eDP-1 /tmp/eDP.png; grim -o HDMI-A-1 /tmp/HDMI.png; convert /tmp/eDP.png -blur 0x10 /tmp/blurredeDP.png; convert /tmp/HDMI.png -blur 0x10 /tmp/blurredHDMI.png; swaylock -i HDMI-A-1:/tmp/blurredHDMI.png -i eDP-1:/tmp/blurredeDP.png -F -l --daemonize', mode "default"
  332. bindsym e exit
  333. bindsym s exec loginctl suspend, mode "default"
  334. bindsym r exec loginctl reboot, mode "default"
  335. bindsym Shift+s exec loginctl poweroff, mode "default"
  336. bindsym Shift+r exec --no-startup-id reboot --firmware-setup, mode "default"
  337.  
  338. # return to default mode
  339. bindsym Return mode "default"
  340. bindsym Escape mode "default"
  341. }
  342. bindsym $mod+Shift+e mode "$mode_system"
  343.  
  344. include /etc/sway/config.d/*
  345.  
  346. # F9 locks the screen. Works for both laptop and external keyboards.
  347. bindsym F9 exec 'grim -o eDP-1 /tmp/eDP.png; grim -o HDMI-A-1 /tmp/HDMI.png; convert /tmp/eDP.png -blur 0x10 /tmp/blurredeDP.png; convert /tmp/HDMI.png -blur 0x10 /tmp/blurredHDMI.png; swaylock -i HDMI-A-1:/tmp/blurredHDMI.png -i eDP-1:/tmp/blurredeDP.png -F -l --daemonize', mode "default"
  348. # install:
  349. # imagemagick
  350. # grim
  351. # slurp
  352. # swaylock
  353. # swayidle
  354. # swaybar (with use flags on gentoo)
  355. # dash shell for swaybar script
  356. # swayhide for window swallowing from terminalaaa
  357.  
  358. # Use for identifying keys for bindsyms:
  359. # xev | awk -F'[ )]+' '/Press/ { a[NR+2] } NR in a { printf "%-14s [%-5s %s]\n", $8, $3, $5 }'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement