config (12420B)
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 ### Variables
8 #
9 # Logo key. Use Mod1 for Alt.
10 set $mod Mod4
11 # Home row direction keys, like vim
12 set $left h
13 set $down j
14 set $up k
15 set $right l
16 # Your preferred terminal emulator
17 # set $term kitty
18 set $term foot
19 # Your preferred application launcher
20 # Note: pass the final command to swaymsg so that the resulting window can be opened
21 # on the original workspace that the command was run on.
22 #set $menu dmenu_path | dmenu | xargs swaymsg exec --
23 set $menu wofi
24
25 include /etc/sway/config-vars.d/*
26
27 ### Output configuration
28 #
29 # Default wallpaper (more resolutions are available in /usr/share/backgrounds/sway/)
30 #output * bg /usr/share/backgrounds/sway/Sway_Wallpaper_Blue_1920x1080.png fill
31 output * bg ~/Bilder/Wallpaper/Sway_Wallpaper_purple_2048x1536.png fill
32
33 #
34 # Example configuration:
35 #
36 # output HDMI-A-1 resolution 1920x1080 position 1920,0
37 #
38 # You can get the names of your outputs by running: swaymsg -t get_outputs
39
40 ### Idle configuration
41 #
42 # Example configuration:
43 #
44 exec swayidle -w \
45 timeout 180 '~/.config/swaylock/swaylock_helper.sh on & swaylock -f && ~/.config/swaylock/swaylock_helper.sh off' \
46 timeout 185 'swaymsg "output * dpms off"' \
47 resume 'swaymsg "output * dpms on"' \
48 before-sleep '~/.config/swaylock/swaylock_helper.sh on & swaylock -f && ~/.config/swaylock/swaylock_helper.sh off'
49
50 # This will lock your screen after 300 seconds of inactivity, then turn off
51 # your displays after another 300 seconds, and turn your screens back on when
52 # resumed. It will also lock your screen before your computer goes to sleep.
53
54 ### Input configuration
55 #
56 # Example configuration:
57 #
58 # input "2:14:SynPS/2_Synaptics_TouchPad" {
59 # dwt enabled
60 # tap enabled
61 # natural_scroll enabled
62 # middle_emulation enabled
63 # }
64 #
65 # You can get the names of your inputs by running: swaymsg -t get_inputs
66 # Read `man 5 sway-input` for more information about this section.
67 input * {
68 xkb_layout "de"
69 }
70 input "type:touchpad" {
71 dwt enabled
72 tap enabled
73 tap_button_map lrm
74 }
75
76
77 ### Key bindings
78 #
79 # Basics:
80 #
81 # Start a terminal
82 bindsym $mod+t exec $term
83
84 # Kill focused window
85 bindsym $mod+q kill
86
87 # Start your launcher
88 bindsym --no-repeat $mod+d exec $menu
89
90 # Lock session
91 bindsym --no-repeat $mod+l exec ~/.config/swaylock/swaylock_helper.sh "on" & swaylock -f && ~/.config/swaylock/swaylock_helper.sh "off"
92 bindsym --no-repeat $mod+Shift+l exec wlogout
93
94 # Drag floating windows by holding down $mod and left mouse button.
95 # Resize them with right mouse button + $mod.
96 # Despite the name, also works for non-floating windows.
97 # Change normal to inverse to use left mouse button for resizing and right
98 # mouse button for dragging.
99 floating_modifier $mod normal
100
101 # Reload the configuration file
102 bindsym $mod+Shift+c reload
103
104 # Exit sway (logs you out of your Wayland session)
105 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'
106 #
107 # Moving around:
108 #
109 # Move your focus around
110 #bindsym $mod+$left focus left
111 #bindsym $mod+$down focus down
112 #bindsym $mod+$up focus up
113 #bindsym $mod+$right focus right
114 # Or use $mod+[up|down|left|right]
115 bindsym $mod+Left focus left
116 bindsym $mod+Down focus down
117 bindsym $mod+Up focus up
118 bindsym $mod+Right focus right
119
120 # Move the focused window with the same, but add Shift
121 #bindsym $mod+Shift+$left move left
122 #bindsym $mod+Shift+$down move down
123 #bindsym $mod+Shift+$up move up
124 #bindsym $mod+Shift+$right move right
125 # Ditto, with arrow keys
126 bindsym $mod+Shift+Left move left
127 bindsym $mod+Shift+Down move down
128 bindsym $mod+Shift+Up move up
129 bindsym $mod+Shift+Right move right
130 #
131 # Workspaces:
132 #
133 # Switch to workspace
134 bindsym --no-repeat $mod+1 workspace number 1; exec "echo 1 > /tmp/sovpipe && echo 1 > /tmp/swayworkspace"
135 bindsym --no-repeat $mod+2 workspace number 2; exec "echo 1 > /tmp/sovpipe && echo 2 > /tmp/swayworkspace"
136 bindsym --no-repeat $mod+3 workspace number 3; exec "echo 1 > /tmp/sovpipe && echo 3 > /tmp/swayworkspace"
137 bindsym --no-repeat $mod+4 workspace number 4; exec "echo 1 > /tmp/sovpipe && echo 4 > /tmp/swayworkspace"
138 bindsym --no-repeat $mod+5 workspace number 5; exec "echo 1 > /tmp/sovpipe && echo 5 > /tmp/swayworkspace"
139 bindsym --no-repeat $mod+6 workspace number 6; exec "echo 1 > /tmp/sovpipe && echo 6 > /tmp/swayworkspace"
140 bindsym --no-repeat $mod+7 workspace number 7; exec "echo 1 > /tmp/sovpipe && echo 7 > /tmp/swayworkspace"
141 bindsym --no-repeat $mod+8 workspace number 8; exec "echo 1 > /tmp/sovpipe && echo 8 > /tmp/swayworkspace"
142 bindsym --no-repeat $mod+9 workspace number 9; exec "echo 1 > /tmp/sovpipe && echo 9 > /tmp/swayworkspace"
143 bindsym --no-repeat $mod+0 workspace number 10; exec "echo 1 > /tmp/sovpipe && echo 10 > /tmp/swayworkspace"
144 bindsym --release $mod+1 exec "sleep 0.5 && echo 0 > /tmp/sovpipe"
145 bindsym --release $mod+2 exec "sleep 0.5 && echo 0 > /tmp/sovpipe"
146 bindsym --release $mod+3 exec "sleep 0.5 && echo 0 > /tmp/sovpipe"
147 bindsym --release $mod+4 exec "sleep 0.5 && echo 0 > /tmp/sovpipe"
148 bindsym --release $mod+5 exec "sleep 0.5 && echo 0 > /tmp/sovpipe"
149 bindsym --release $mod+6 exec "sleep 0.5 && echo 0 > /tmp/sovpipe"
150 bindsym --release $mod+7 exec "sleep 0.5 && echo 0 > /tmp/sovpipe"
151 bindsym --release $mod+8 exec "sleep 0.5 && echo 0 > /tmp/sovpipe"
152 bindsym --release $mod+9 exec "sleep 0.5 && echo 0 > /tmp/sovpipe"
153 bindsym --release $mod+0 exec "sleep 0.5 && echo 0 > /tmp/sovpipe"
154 # Move focused container to workspace
155 bindsym $mod+Shift+1 move container to workspace number 1; exec "echo 1 > /tmp/sovpipe"
156 bindsym $mod+Shift+2 move container to workspace number 2; exec "echo 1 > /tmp/sovpipe"
157 bindsym $mod+Shift+3 move container to workspace number 3; exec "echo 1 > /tmp/sovpipe"
158 bindsym $mod+Shift+4 move container to workspace number 4; exec "echo 1 > /tmp/sovpipe"
159 bindsym $mod+Shift+5 move container to workspace number 5; exec "echo 1 > /tmp/sovpipe"
160 bindsym $mod+Shift+6 move container to workspace number 6; exec "echo 1 > /tmp/sovpipe"
161 bindsym $mod+Shift+7 move container to workspace number 7; exec "echo 1 > /tmp/sovpipe"
162 bindsym $mod+Shift+8 move container to workspace number 8; exec "echo 1 > /tmp/sovpipe"
163 bindsym $mod+Shift+9 move container to workspace number 9; exec "echo 1 > /tmp/sovpipe"
164 bindsym $mod+Shift+0 move container to workspace number 10; exec "echo 1 > /tmp/sovpipe"
165 bindsym --release $mod+Shift+1 exec "sleep 0.5 && echo 0 > /tmp/sovpipe"
166 bindsym --release $mod+Shift+2 exec "sleep 0.5 && echo 0 > /tmp/sovpipe"
167 bindsym --release $mod+Shift+3 exec "sleep 0.5 && echo 0 > /tmp/sovpipe"
168 bindsym --release $mod+Shift+4 exec "sleep 0.5 && echo 0 > /tmp/sovpipe"
169 bindsym --release $mod+Shift+5 exec "sleep 0.5 && echo 0 > /tmp/sovpipe"
170 bindsym --release $mod+Shift+6 exec "sleep 0.5 && echo 0 > /tmp/sovpipe"
171 bindsym --release $mod+Shift+7 exec "sleep 0.5 && echo 0 > /tmp/sovpipe"
172 bindsym --release $mod+Shift+8 exec "sleep 0.5 && echo 0 > /tmp/sovpipe"
173 bindsym --release $mod+Shift+9 exec "sleep 0.5 && echo 0 > /tmp/sovpipe"
174 bindsym --release $mod+Shift+0 exec "sleep 0.5 && echo 0 > /tmp/sovpipe"
175 # Note: workspaces can have any name you want, not just numbers.
176 # We just use 1-10 as the default.
177 #
178 # Layout stuff:
179 #
180 # You can "split" the current object of your focus with
181 # $mod+b or $mod+v, for horizontal and vertical splits
182 # respectively.
183 bindsym $mod+b splith
184 bindsym $mod+v splitv
185
186 # Switch the current container between different layout styles
187 workspace_layout tabbed
188 bindsym $mod+s layout stacking
189 bindsym $mod+w layout tabbed
190 bindsym $mod+e layout toggle split
191
192 # Make the current focus fullscreen
193 bindsym $mod+f fullscreen
194
195 # Toggle the current focus between tiling and floating mode
196 bindsym $mod+Shift+space floating toggle
197
198 # Swap focus between the tiling area and the floating area
199 bindsym $mod+space focus mode_toggle
200
201 # Move focus to the parent container
202 bindsym $mod+a focus parent
203 #
204 # Scratchpad:
205 #
206 # Sway has a "scratchpad", which is a bag of holding for windows.
207 # You can send windows there and get them back later.
208
209 # Move the currently focused window to the scratchpad
210 bindsym $mod+Shift+minus move scratchpad
211
212 # Show the next scratchpad window or hide the focused scratchpad window.
213 # If there are multiple scratchpad windows, this command cycles through them.
214 bindsym $mod+minus scratchpad show
215
216 #
217 # Mediakeys
218 #
219 bindsym --locked XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +5%; exec paplay /usr/share/sounds/freedesktop/stereo/bell.oga & echo "Volume: $(pactl get-sink-volume @DEFAULT_SINK@ | awk '{ print $5 }')" > /tmp/notificationpipe
220 bindsym --locked XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -5%; exec paplay /usr/share/sounds/freedesktop/stereo/bell.oga & echo "Volume: $(pactl get-sink-volume @DEFAULT_SINK@ | awk '{ print $5 }')" > /tmp/notificationpipe
221 bindsym --locked XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggle; exec pactl get-sink-mute @DEFAULT_SINK@ > /tmp/notificationpipe
222 bindsym --locked XF86AudioMicMute exec pactl set-source-mute @DEFAULT_SOURCE@ toggle; exec pactl get-source-mute @DEFAULT_SOURCE@ > /tmp/notificationpipe
223 bindsym --locked XF86MonBrightnessDown exec ~/.config/sway/brightness.sh dec 5; exec echo "Brightness $(~/.config/sway/brightness.sh)" > /tmp/notificationpipe
224 bindsym --locked XF86MonBrightnessUp exec ~/.config/sway/brightness.sh inc 5; exec echo "Brightness $(~/.config/sway/brightness.sh)" > /tmp/notificationpipe
225
226 #
227 # Resizing containers:
228 #
229 mode "resize" {
230 # left will shrink the containers width
231 # right will grow the containers width
232 # up will shrink the containers height
233 # down will grow the containers height
234 bindsym $left resize shrink width 10px
235 bindsym $down resize grow height 10px
236 bindsym $up resize shrink height 10px
237 bindsym $right resize grow width 10px
238
239 # Ditto, with arrow keys
240 bindsym Left resize shrink width 10px
241 bindsym Down resize grow height 10px
242 bindsym Up resize shrink height 10px
243 bindsym Right resize grow width 10px
244
245 # Return to default mode
246 bindsym Return mode "default"
247 bindsym Escape mode "default"
248 }
249 bindsym $mod+r mode "resize"
250
251 #
252 # Status Bar:
253 #
254 # Read `man 5 sway-bar` for more information about this section.
255 #bar {
256 # position top
257 #
258 # # When the status_command prints a new line to stdout, swaybar updates.
259 # # The default just shows the current date and time.
260 # status_command while date +'%Y-%m-%d %I:%M:%S %p'; do sleep 1; done
261 #
262 # colors {
263 # statusline #ffffff
264 # background #323232
265 # inactive_workspace #32323200 #32323200 #5c5c5c
266 # }
267 #}
268
269 # include /etc/sway/config.d/*
270
271 default_border pixel
272
273 #
274 ## Autostart
275 #
276
277 # Sway Workspace indicator
278 exec rm -r /tmp/swayworkspace && mkfifo /tmp/swayworkspace
279
280 # SOV
281 exec rm -f /tmp/sovpipe && mkfifo /tmp/sovpipe && tail -f /tmp/sovpipe | sov
282
283 # Notification Daemon
284 exec ~/.config/mako/notification_daemon.sh
285 exec mako
286
287 # waybar
288 # exec systemctl --user restart xdg-desktop-portal
289 # exec systemctl --user daemon-reload
290 exec /usr/libexec/xdg-desktop-portal-gtk
291 exec waybar
292
293 # wlsunset
294 exec wlsunset -L 6.6441878 -l 49.7596208
295
296 # set volume to 100% and mute
297 # exec pactl set-sink-volume @DEFAULT_SINK@ 50%
298 exec pactl set-sink-mute @DEFAULT_SINK@ 1
299
300 # set microphone to 15% and mute
301 exec pactl set-source-volume @DEFAULT_SOURCE@ 15%
302 exec pactl set-source-mute @DEFAULT_SOURCE@ 1
303
304 # set brightness to 100%
305 exec ~/.local/bin/brightness "inc" 100
306
307 # Launch KDE Connect
308 exec sleep 10 && kdeconnect-indicator
309 exec_always kdeconnect-cli --refresh
310
311 # Launch Nextcloud Sync
312 exec sleep 10 && nextcloud --background
313
314 # Launch Network Manager
315 exec sleep 10 && nm-applet
316
317 # Launch Bluetooth Managager
318 exec sleep 10 && blueman-applet & blueman-tray
319
320 # Launch Signal
321 exec sleep 10 && flatpak run org.signal.Signal --use-tray-icon --start-in-tray
322