]> src.twobees.de Git - dotfiles.git/blob - stow/sway/.config/sway/config
07feb0f42201ba4a299fa09e4b0aeed0b684903b
[dotfiles.git] / stow / sway / .config / sway / config
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 ~/.bin/sensible-terminal.sh
18 # Your preferred application launcher
19 # Note: pass the final command to swaymsg so that the resulting window can be opened
20 # on the original workspace that the command was run on.
21 set $menu dmenu_path | dmenu | xargs swaymsg exec --
22
23 include /etc/sway/config-vars.d/*
24
25 ### Output configuration
26 #
27 # Default wallpaper (more resolutions are available in /usr/share/backgrounds/sway/)
28 #output * bg /usr/share/backgrounds/sway/Sway_Wallpaper_Blue_1920x1080.png fill
29 #
30 # Example configuration:
31 #
32 #   output HDMI-A-1 resolution 1920x1080 position 1920,0
33 #
34 # You can get the names of your outputs by running: swaymsg -t get_outputs
35
36 ### Idle configuration
37 #
38 # Example configuration:
39 #
40  exec swayidle -w \
41           timeout 300 'swaylock -f -c 000000' \
42           timeout 600 'swaymsg "output * dpms off"' 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
49 ### Input configuration
50 #
51 # Example configuration:
52 #
53 #   input "2:14:SynPS/2_Synaptics_TouchPad" {
54 #       dwt enabled
55 #       tap enabled
56 #       natural_scroll enabled
57 #       middle_emulation enabled
58 #   }
59 #
60 # You can get the names of your inputs by running: swaymsg -t get_inputs
61 # Read `man 5 sway-input` for more information about this section.
62
63 ### Key bindings
64 #
65 # Basics:
66 #
67     # Start a terminal
68     bindsym $mod+Return exec $term
69
70     # Kill focused window
71     bindsym $mod+Shift+q kill
72
73     # Start your launcher
74     bindsym $mod+d exec $menu
75
76     # Drag floating windows by holding down $mod and left mouse button.
77     # Resize them with right mouse button + $mod.
78     # Despite the name, also works for non-floating windows.
79     # Change normal to inverse to use left mouse button for resizing and right
80     # mouse button for dragging.
81     floating_modifier $mod normal
82
83     # Reload the configuration file
84     bindsym $mod+Shift+c reload
85     bindsym $mod+Shift+r restart
86
87     # Exit sway (logs you out of your Wayland session)
88     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'
89 #
90 # Moving around:
91 #
92     # Move your focus around
93     bindsym $mod+$left focus left
94     bindsym $mod+$down focus down
95     bindsym $mod+$up focus up
96     bindsym $mod+$right focus right
97     # Or use $mod+[up|down|left|right]
98     bindsym $mod+Left focus left
99     bindsym $mod+Down focus down
100     bindsym $mod+Up focus up
101     bindsym $mod+Right focus right
102
103     # Move the focused window with the same, but add Shift
104     bindsym $mod+Shift+$left move left
105     bindsym $mod+Shift+$down move down
106     bindsym $mod+Shift+$up move up
107     bindsym $mod+Shift+$right move right
108     # Ditto, with arrow keys
109     bindsym $mod+Shift+Left move left
110     bindsym $mod+Shift+Down move down
111     bindsym $mod+Shift+Up move up
112     bindsym $mod+Shift+Right move right
113 #
114 # Workspaces:
115 #
116     # Switch to workspace
117     bindsym $mod+1 workspace number 1
118     bindsym $mod+2 workspace number 2
119     bindsym $mod+3 workspace number 3
120     bindsym $mod+4 workspace number 4
121     bindsym $mod+5 workspace number 5
122     bindsym $mod+6 workspace number 6
123     bindsym $mod+7 workspace number 7
124     bindsym $mod+8 workspace number 8
125     bindsym $mod+9 workspace number 9
126     bindsym $mod+0 workspace number 10
127     # Move focused container to workspace
128     bindsym $mod+Shift+1 move container to workspace number 1
129     bindsym $mod+Shift+2 move container to workspace number 2
130     bindsym $mod+Shift+3 move container to workspace number 3
131     bindsym $mod+Shift+4 move container to workspace number 4
132     bindsym $mod+Shift+5 move container to workspace number 5
133     bindsym $mod+Shift+6 move container to workspace number 6
134     bindsym $mod+Shift+7 move container to workspace number 7
135     bindsym $mod+Shift+8 move container to workspace number 8
136     bindsym $mod+Shift+9 move container to workspace number 9
137     bindsym $mod+Shift+0 move container to workspace number 10
138     # Note: workspaces can have any name you want, not just numbers.
139     # We just use 1-10 as the default.
140 #
141 # Layout stuff:
142 #
143     # You can "split" the current object of your focus with
144     # $mod+b or $mod+v, for horizontal and vertical splits
145     # respectively.
146     bindsym $mod+b splith
147     bindsym $mod+v splitv
148
149     # Switch the current container between different layout styles
150     bindsym $mod+s layout stacking
151     bindsym $mod+w layout tabbed
152     bindsym $mod+e layout toggle split
153
154     # Make the current focus fullscreen
155     bindsym $mod+f fullscreen
156
157     # Toggle the current focus between tiling and floating mode
158     bindsym $mod+Shift+space floating toggle
159
160     # Swap focus between the tiling area and the floating area
161     bindsym $mod+space focus mode_toggle
162
163     # Move focus to the parent container
164     bindsym $mod+a focus parent
165 #
166 # Scratchpad:
167 #
168     # Sway has a "scratchpad", which is a bag of holding for windows.
169     # You can send windows there and get them back later.
170
171     # Move the currently focused window to the scratchpad
172     bindsym $mod+Shift+minus move scratchpad
173
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 # Resizing containers:
179 #
180 mode "resize" {
181     # left will shrink the containers width
182     # right will grow the containers width
183     # up will shrink the containers height
184     # down will grow the containers height
185     bindsym $left resize shrink width 10px
186     bindsym $down resize grow height 10px
187     bindsym $up resize shrink height 10px
188     bindsym $right resize grow width 10px
189
190     # Ditto, with arrow keys
191     bindsym Left resize shrink width 10px
192     bindsym Down resize grow height 10px
193     bindsym Up resize shrink height 10px
194     bindsym Right resize grow width 10px
195
196     # Return to default mode
197     bindsym Return mode "default"
198     bindsym Escape mode "default"
199 }
200 bindsym $mod+r mode "resize"
201
202 #
203 # Status Bar:
204 #
205 # Read `man 5 sway-bar` for more information about this section.
206 ## bar {
207 ##     position top
208 ## 
209 ##     # When the status_command prints a new line to stdout, swaybar updates.
210 ##     # The default just shows the current date and time.
211 ##     status_command while date +'%Y-%m-%d %I:%M:%S %p'; do sleep 1; done
212 ## 
213 ##     icon_theme Adwaita ## 
214 ##     colors {
215 ##         statusline #ffffff
216 ##         background #323232
217 ##         inactive_workspace #32323200 #32323200 #5c5c5c
218 ##     }
219 ## }
220
221 bar {
222     swaybar_command waybar
223 }
224
225 include /etc/sway/config.d/*
226
227 # custom... 
228 exec dunst
229 exec pasystray
230 exec sleep 3 && nextcloud --background
231 exec pass git pull
232 exec ~/.bin/set_sway_wallpaper.sh
233 default_border pixel 6 
234 default_floating_border pixel 6 
235
236 bindsym $mod+Shift+d exec dolphin
237 bindsym $mod+Shift+f exec firefox
238 bindsym $mod+Shift+Control+e exec "shutdown -h now"
239
240 for_window [window_role="About"] floating enable
241 for_window [class="vlc"] floating enable
242
243 input type:keyboard {
244     xkb_layout us,de
245     xkb_options grp:win_space_toggle
246 }
247
248