Advertisement
Guest User

sway_config

a guest
Jan 14th, 2025
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.64 KB | Source Code | 0 0
  1. ### Variables
  2.  
  3. # Logo key. Use Mod1 for Alt.
  4. set $mod Mod4
  5.  
  6. set $left Left
  7. set $right Right
  8. set $up Up
  9. set $down Down
  10.  
  11. # Your preferred terminal emulator
  12. set $term foot
  13.  
  14. # Your preferred application launcher
  15. # Note: pass the final command to swaymsg so that the resulting window can be opened
  16. # on the original workspace that the command was run on.
  17. set $menu dmenu_path | wmenu | xargs swaymsg exec --
  18.  
  19. ### Key bindings
  20. #
  21. # Basics:
  22. #
  23. # Start a terminal
  24. bindsym $mod+Return exec $term
  25. bindsym $mod+l exec swaylock -c 000000
  26. bindsym $mod+b exec firefox
  27. bindsym $mod+c exec code
  28. bindsym $mod+g exec gramps
  29. bindsym $mod+s exec steam
  30. bindsym $mod+p exec pavucontrol
  31. bindsym $mod+n exec nvidia-settings
  32. bindsym $mod+w exec gwe
  33. bindsym $mod+e exec thunar
  34.  
  35. # Kill focused window
  36. bindsym $mod+Shift+q kill
  37.  
  38. # Start your launcher
  39. bindsym $mod+d exec $menu
  40.  
  41. # Drag floating windows by holding down $mod and left mouse button.
  42. # Resize them with right mouse button + $mod.
  43. # Despite the name, also works for non-floating windows.
  44. # Change normal to inverse to use left mouse button for resizing and right
  45. # mouse button for dragging.
  46. floating_modifier $mod normal
  47.  
  48. # Reload the configuration file
  49. bindsym $mod+Shift+c reload
  50.  
  51. # Exit sway (logs you out of your Wayland session)
  52. 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'
  53. #
  54. # Moving around:
  55. #
  56. # Move your focus around
  57. bindsym $mod+$left focus left
  58. bindsym $mod+$down focus down
  59. bindsym $mod+$up focus up
  60. bindsym $mod+$right focus right
  61.  
  62. # Move the focused window with the same, but add Shift
  63. bindsym $mod+Shift+$left move left
  64. bindsym $mod+Shift+$down move down
  65. bindsym $mod+Shift+$up move up
  66. bindsym $mod+Shift+$right move right
  67.  
  68. # monitors
  69. set $monitor_main "DP-3"
  70. set $monitor_aux "DP-2"
  71.  
  72. # Define names for default workspaces for which we configure key bindings later on.
  73. # We use variables to avoid repeating the names in multiple places.
  74. set $ws1 "1"
  75. set $ws2 "2"
  76. set $ws3 "3"
  77. set $ws4 "4"
  78. set $ws5 "5"
  79. set $ws6 "6"
  80. set $ws7 "7"
  81. set $ws8 "8"
  82. set $ws9 "9"
  83. set $ws10 "10"
  84.  
  85. workspace $ws1 output $monitor_main
  86. workspace $ws2 output $monitor_main
  87. workspace $ws3 output $monitor_main
  88. workspace $ws4 output $monitor_main
  89. workspace $ws5 output $monitor_main
  90.  
  91. workspace $ws6 output $monitor_aux
  92. workspace $ws7 output $monitor_aux
  93. workspace $ws8 output $monitor_aux
  94. workspace $ws9 output $monitor_aux
  95. workspace $ws10 output $monitor_aux
  96.  
  97. # switch to workspace
  98. bindsym $mod+1 workspace $ws1
  99. bindsym $mod+2 workspace $ws2
  100. bindsym $mod+3 workspace $ws3
  101. bindsym $mod+4 workspace $ws4
  102. bindsym $mod+5 workspace $ws5
  103. bindsym $mod+6 workspace $ws6
  104. bindsym $mod+7 workspace $ws7
  105. bindsym $mod+8 workspace $ws8
  106. bindsym $mod+9 workspace $ws9
  107. bindsym $mod+0 workspace $ws10
  108.  
  109. # cycle between workspaces
  110. bindsym $mod+Next workspace next
  111. bindsym $mod+Prior workspace prev
  112.  
  113. # move focused container to workspace
  114. bindsym $mod+Shift+1 move container to workspace $ws1
  115. bindsym $mod+Shift+2 move container to workspace $ws2
  116. bindsym $mod+Shift+3 move container to workspace $ws3
  117. bindsym $mod+Shift+4 move container to workspace $ws4
  118. bindsym $mod+Shift+5 move container to workspace $ws5
  119. bindsym $mod+Shift+6 move container to workspace $ws6
  120. bindsym $mod+Shift+7 move container to workspace $ws7
  121. bindsym $mod+Shift+8 move container to workspace $ws8
  122. bindsym $mod+Shift+9 move container to workspace $ws9
  123. bindsym $mod+Shift+0 move container to workspace $ws10
  124.  
  125. bindsym $mod+Shift+Next move container to workspace next
  126. bindsym $mod+Shift+Prior move container to workspace prev
  127. #
  128. # Layout stuff:
  129. #
  130. # You can "split" the current object of your focus with
  131. # $mod+b or $mod+v, for horizontal and vertical splits
  132. # respectively.
  133. bindsym $mod+h splith
  134. bindsym $mod+v splitv
  135.  
  136. # Switch the current container between different layout styles
  137. # bindsym $mod+s layout stacking
  138. # bindsym $mod+w layout tabbed
  139. # bindsym $mod+e layout toggle split
  140.  
  141. # Make the current focus fullscreen
  142. bindsym $mod+f fullscreen
  143.  
  144. # Toggle the current focus between tiling and floating mode
  145. bindsym $mod+Shift+space floating toggle
  146.  
  147. # Swap focus between the tiling area and the floating area
  148. bindsym $mod+space focus mode_toggle
  149.  
  150. # Move focus to the parent container
  151. bindsym $mod+a focus parent
  152. #
  153. # Scratchpad:
  154. #
  155. # Sway has a "scratchpad", which is a bag of holding for windows.
  156. # You can send windows there and get them back later.
  157.  
  158. # Move the currently focused window to the scratchpad
  159. bindsym $mod+Shift+minus move scratchpad
  160.  
  161. # Show the next scratchpad window or hide the focused scratchpad window.
  162. # If there are multiple scratchpad windows, this command cycles through them.
  163. bindsym $mod+minus scratchpad show
  164. #
  165. # Resizing containers:
  166. #
  167. mode "resize" {
  168. # left will shrink the containers width
  169. # right will grow the containers width
  170. # up will shrink the containers height
  171. # down will grow the containers height
  172. bindsym $left resize shrink width 10px
  173. bindsym $down resize grow height 10px
  174. bindsym $up resize shrink height 10px
  175. bindsym $right resize grow width 10px
  176.  
  177. # Return to default mode
  178. bindsym Return mode "default"
  179. bindsym Escape mode "default"
  180. }
  181. bindsym $mod+r mode "resize"
  182.  
  183. #multimedia keys
  184. bindsym XF86Tools exec spotify-launcher
  185. bindsym XF86AudioPlay exec --no-startup-id playerctl --player=spotify play
  186. bindsym XF86AudioPause exec --no-startup-id playerctl --player=spotify pause
  187. bindsym XF86AudioStop exec --no-startup-id playerctl --player=spotify stop
  188. bindsym XF86AudioNext exec --no-startup-id playerctl --player=spotify next
  189. bindsym XF86AudioPrev exec --no-startup-id playerctl --player=spotify previous
  190.  
  191. bindsym --locked XF86AudioMute exec wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle
  192. bindsym --locked XF86AudioLowerVolume exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%- -l 1.2
  193. bindsym --locked XF86AudioRaiseVolume exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+ -l 1.2
  194.  
  195. #
  196. # Status Bar:
  197. #
  198. # Read `man 5 sway-bar` for more information about this section.
  199. bar {
  200. position bottom
  201.  
  202. # When the status_command prints a new line to stdout, swaybar updates.
  203. # The default just shows the current date and time.
  204. #status_command while date +'%Y-%m-%d %H:%M:%S'; do sleep 1; done
  205. status_command i3status --config ~/.config/i3status.conf
  206.  
  207. colors {
  208. statusline #ffffff
  209. background #000000
  210. inactive_workspace #32323200 #32323200 #5c5c5c
  211. }
  212. }
  213.  
  214. input type:keyboard
  215. {
  216. xkb_layout fi
  217. }
  218. input type:pointer
  219. {
  220. left_handed enabled
  221. }
  222. output $monitor_main adaptive_sync enabled
  223. output $monitor_aux disable
  224. output $monitor_main mode 1920x1080@144Hz pos 0 0 background /home/john/Pictures/hREDS.jpg fill #000000
  225. bindsym $mod+Delete output $monitor_aux disable ; output $monitor_main mode 1920x1080@144Hz pos 0 0 background /home/john/Pictures/hREDS.jpg fill #000000
  226. bindsym $mod+Insert output $monitor_aux enable mode 1920x1080@144Hz pos 0 0 transform 270 background /home/john/Pictures/HelsinkiReds.png center #000000 ; output $monitor_main mode 1920x1080@144Hz pos 1080 0 background /home/john/Pictures/hREDS.jpg fill #000000
  227.  
  228. bindsym $mod+Home output * adaptive_sync enabled
  229. bindsym $mod+End output * adaptive_sync disabled
  230.  
  231. focus_follows_mouse no
  232. default_border none
  233. include /etc/sway/config.d/*
  234. exec_always xrandr --output $monitor_main --primary
  235. exec mako
  236.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement