]> src.twobees.de Git - dotfiles.git/blob - stow/sway/.config/sway/config
sway stuff
[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 set $menu /usr/bin/ulauncher
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
37 output HDMI-A-1 resolution 2560x1440 position 0 0 scale 1
38 output DP-1 resolution 1680x1050 position 2560 0 scale 1
39
40 bindsym $mod+F9 exec "sway output DP-1 disable; sway output HDMI-A-1 enable"
41 bindsym $mod+F10 exec "sway output DP-1 enable; sway output HDMI-A-1 enable"
42 bindsym $mod+F11 exec "sway output DP-1 enable; sway output HDMI-A-1 disable"
43 ### Idle configuration
44 #
45 # Example configuration:
46 #
47 set $lock_cmd ~/.bin/lockscreen.sh
48 exec swayidle -w \
49           timeout 1200 $lock_cmd \
50           timeout 600 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' \
51           before-sleep $lock_cmd
52
53 bindsym $mod+Shift+x exec $lock_cmd
54
55 # This will lock your screen after 300 seconds of inactivity, then turn off
56 # your displays after another 300 seconds, and turn your screens back on when
57 # resumed. It will also lock your screen before your computer goes to sleep.
58
59 ### Input configuration
60 #
61 # Example configuration:
62 #
63 #   input "2:14:SynPS/2_Synaptics_TouchPad" {
64 #       dwt enabled
65 #       tap enabled
66 #       natural_scroll enabled
67 #       middle_emulation enabled
68 #   }
69 #
70 # You can get the names of your inputs by running: swaymsg -t get_inputs
71 # Read `man 5 sway-input` for more information about this section.
72
73 ### Key bindings
74 #
75 # Basics:
76 #
77     # Start a terminal
78     bindsym $mod+Return exec $term
79
80     # Kill focused window
81     bindsym $mod+Shift+q kill
82
83     # Start your launcher
84     bindsym $mod+d exec $menu
85
86     # Drag floating windows by holding down $mod and left mouse button.
87     # Resize them with right mouse button + $mod.
88     # Despite the name, also works for non-floating windows.
89     # Change normal to inverse to use left mouse button for resizing and right
90     # mouse button for dragging.
91     floating_modifier $mod normal
92
93     # Reload the configuration file
94     bindsym $mod+Shift+c reload
95     bindsym $mod+Shift+r restart
96
97     # Exit sway (logs you out of your Wayland session)
98     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'
99 #
100
101 # Moving around:
102 #
103     # Move your focus around
104     bindsym $mod+$left focus left
105     bindsym $mod+$down focus down
106     bindsym $mod+$up focus up
107     bindsym $mod+$right focus right
108     # Or use $mod+[up|down|left|right]
109     bindsym $mod+Left focus left
110     bindsym $mod+Down focus down
111     bindsym $mod+Up focus up
112     bindsym $mod+Right focus right
113
114     # Move the focused window with the same, but add Shift
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     # Ditto, with arrow keys
120     bindsym $mod+Shift+Left move left
121     bindsym $mod+Shift+Down move down
122     bindsym $mod+Shift+Up move up
123     bindsym $mod+Shift+Right move right
124 #
125 # Workspaces:
126 #
127     # Switch to workspace
128     bindsym $mod+1 workspace number 1
129     bindsym $mod+2 workspace number 2
130     bindsym $mod+3 workspace number 3
131     bindsym $mod+4 workspace number 4
132     bindsym $mod+5 workspace number 5
133     bindsym $mod+6 workspace number 6
134     bindsym $mod+7 workspace number 7
135     bindsym $mod+8 workspace number 8
136     bindsym $mod+9 workspace number 9
137     bindsym $mod+0 workspace number 10
138     # Move focused container to workspace
139     bindsym $mod+Shift+1 move container to workspace number 1
140     bindsym $mod+Shift+2 move container to workspace number 2
141     bindsym $mod+Shift+3 move container to workspace number 3
142     bindsym $mod+Shift+4 move container to workspace number 4
143     bindsym $mod+Shift+5 move container to workspace number 5
144     bindsym $mod+Shift+6 move container to workspace number 6
145     bindsym $mod+Shift+7 move container to workspace number 7
146     bindsym $mod+Shift+8 move container to workspace number 8
147     bindsym $mod+Shift+9 move container to workspace number 9
148     bindsym $mod+Shift+0 move container to workspace number 10
149     # Note: workspaces can have any name you want, not just numbers.
150     # We just use 1-10 as the default.
151 #
152 # Layout stuff:
153 #
154     # You can "split" the current object of your focus with
155     # $mod+b or $mod+v, for horizontal and vertical splits
156     # respectively.
157     bindsym $mod+b splith
158     bindsym $mod+v splitv
159
160     # Switch the current container between different layout styles
161     bindsym $mod+s layout stacking
162     bindsym $mod+w layout tabbed
163     bindsym $mod+e layout toggle split
164
165     # Make the current focus fullscreen
166     bindsym $mod+f fullscreen
167
168     # Toggle the current focus between tiling and floating mode
169     bindsym $mod+Shift+space floating toggle
170
171     # Swap focus between the tiling area and the floating area
172     bindsym $mod+space focus mode_toggle
173
174     # Move focus to the parent container
175     bindsym $mod+a focus parent
176 #
177 # Scratchpad:
178 #
179     # Sway has a "scratchpad", which is a bag of holding for windows.
180     # You can send windows there and get them back later.
181
182     # Move the currently focused window to the scratchpad
183     bindsym $mod+Shift+minus move scratchpad
184
185     # Show the next scratchpad window or hide the focused scratchpad window.
186     # If there are multiple scratchpad windows, this command cycles through them.
187     bindsym $mod+minus scratchpad show
188 #
189 # Resizing containers:
190 #
191 mode "resize" {
192     # left will shrink the containers width
193     # right will grow the containers width
194     # up will shrink the containers height
195     # down will grow the containers height
196     bindsym $left resize shrink width 10px
197     bindsym $down resize grow height 10px
198     bindsym $up resize shrink height 10px
199     bindsym $right resize grow width 10px
200
201     # Ditto, with arrow keys
202     bindsym Left resize shrink width 10px
203     bindsym Down resize grow height 10px
204     bindsym Up resize shrink height 10px
205     bindsym Right resize grow width 10px
206
207     # Return to default mode
208     bindsym Return mode "default"
209     bindsym Escape mode "default"
210 }
211 bindsym $mod+r mode "resize"
212
213 #
214 # Status Bar:
215 #
216 # Read `man 5 sway-bar` for more information about this section.
217 ## bar {
218 ##     position top
219 ## 
220 ##     # When the status_command prints a new line to stdout, swaybar updates.
221 ##     # The default just shows the current date and time.
222 ##     status_command while date +'%Y-%m-%d %I:%M:%S %p'; do sleep 1; done
223 ## 
224 ##     icon_theme Adwaita ## 
225 ##     colors {
226 ##         statusline #ffffff
227 ##         background #323232
228 ##         inactive_workspace #32323200 #32323200 #5c5c5c
229 ##     }
230 ## }
231
232 bar {
233     swaybar_command waybar
234 }
235
236 include /etc/sway/config.d/*
237
238 # custom... 
239 # mako for notifications
240 exec mako 
241 exec pasystray
242 exec sleep 3 && nextcloud --background
243 exec pass git pull
244 exec ~/.bin/set_sway_wallpaper.sh
245 default_border pixel 6 
246 default_floating_border pixel 6 
247
248 bindsym $mod+Shift+d exec dolphin
249 bindsym $mod+Shift+f exec firefox
250 bindsym $mod+Shift+Control+e exec "shutdown -h now"
251
252 bindsym Shift+Control+p exec grim -o $(swaymsg -t get_outputs | jq -r '.[] | select(.focused) | .name') - | wl-copy
253
254 for_window [window_role="About"] floating enable
255 for_window [class="vlc"] floating enable
256
257 input type:keyboard {
258     xkb_layout us,de
259     xkb_options grp:win_space_toggle
260 }
261
262