configs/sway/config
sway/configRaw
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.
10set $mod Mod4
11# Home row direction keys, like vim
12set $left h
13set $down j
14set $up k
15set $right l
16# Your preferred terminal emulator
17set $term alacritty
18# Your preferred application launcher
19set $menu wmenu-run
20
21### Output configuration
22#
23# Default wallpaper (more resolutions are available in /run/current-system/sw/share/backgrounds/sway/)
24# output * bg /run/current-system/sw/share/backgrounds/sway/Sway_Wallpaper_Blue_1920x1080.png fill
25output * bg ~/Sync-tablet/wallpapers/geometry02_croped1920x1080.png fill
26#
27# Example configuration:
28#
29# output HDMI-A-1 resolution 1920x1080 position 1920,0
30#
31# You can get the names of your outputs by running: swaymsg -t get_outputs
32output HDMI-A-1 resolution 3840x2160 position 1920 0
33output eDP-1 resolution 1920x1200 position 0 0
34
35### Idle configuration
36#
37# Example configuration:
38#
39# exec swayidle -w \
40# timeout 300 'swaylock -f -c 000000' \
41# timeout 600 'swaymsg "output * power off"' resume 'swaymsg "output * power on"' \
42# before-sleep 'swaylock -f -c 000000'
43#
44# This will lock your screen after 300 seconds of inactivity, then turn off
45# your displays after another 300 seconds, and turn your screens back on when
46# resumed. It will also lock your screen before your computer goes to sleep.
47
48# lock screen
49bindsym $mod+Control+l exec swaylock -i ~/Sync/wallpapers/geometry02_croped1920x1080_pixelized.png -c 000000
50
51bindsym $mod+Control+d exec poweroff
52
53### Input configuration
54#
55# Example configuration:
56#
57# input "2:14:SynPS/2_Synaptics_TouchPad" {
58# dwt enabled
59# tap enabled
60# natural_scroll enabled
61# middle_emulation enabled
62# }
63#
64# You can get the names of your inputs by running: swaymsg -t get_inputs
65# Read `man 5 sway-input` for more information about this section.
66
67### Key bindings
68#
69# Basics:
70#
71 # Start a terminal
72 bindsym $mod+Return exec $term
73
74 # Kill focused window
75 bindsym $mod+Shift+q kill
76
77 # Start your launcher
78 bindsym $mod+d exec $menu
79
80 # Drag floating windows by holding down $mod and left mouse button.
81 # Resize them with right mouse button + $mod.
82 # Despite the name, also works for non-floating windows.
83 # Change normal to inverse to use left mouse button for resizing and right
84 # mouse button for dragging.
85 floating_modifier $mod normal
86
87 # Reload the configuration file
88 bindsym $mod+Shift+c reload
89
90 # Exit sway (logs you out of your Wayland session)
91 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'
92#
93# Moving around:
94#
95 # Move your focus around
96 bindsym $mod+$left focus left
97 bindsym $mod+$down focus down
98 bindsym $mod+$up focus up
99 bindsym $mod+$right focus right
100 # Or use $mod+[up|down|left|right]
101 bindsym $mod+Left focus left
102 bindsym $mod+Down focus down
103 bindsym $mod+Up focus up
104 bindsym $mod+Right focus right
105
106 # Move the focused window with the same, but add Shift
107 bindsym $mod+Shift+$left move left
108 bindsym $mod+Shift+$down move down
109 bindsym $mod+Shift+$up move up
110 bindsym $mod+Shift+$right move right
111 # Ditto, with arrow keys
112 bindsym $mod+Shift+Left move left
113 bindsym $mod+Shift+Down move down
114 bindsym $mod+Shift+Up move up
115 bindsym $mod+Shift+Right move right
116#
117# Workspaces:
118#
119 # Switch to workspace
120 bindsym $mod+1 workspace number 1
121 bindsym $mod+2 workspace number 2
122 bindsym $mod+3 workspace number 3
123 bindsym $mod+4 workspace number 4
124 bindsym $mod+5 workspace number 5
125 bindsym $mod+6 workspace number 6
126 bindsym $mod+7 workspace number 7
127 bindsym $mod+8 workspace number 8
128 bindsym $mod+9 workspace number 9
129 bindsym $mod+0 workspace number 10
130 # Move focused container to workspace
131 bindsym $mod+Shift+1 move container to workspace number 1
132 bindsym $mod+Shift+2 move container to workspace number 2
133 bindsym $mod+Shift+3 move container to workspace number 3
134 bindsym $mod+Shift+4 move container to workspace number 4
135 bindsym $mod+Shift+5 move container to workspace number 5
136 bindsym $mod+Shift+6 move container to workspace number 6
137 bindsym $mod+Shift+7 move container to workspace number 7
138 bindsym $mod+Shift+8 move container to workspace number 8
139 bindsym $mod+Shift+9 move container to workspace number 9
140 bindsym $mod+Shift+0 move container to workspace number 10
141 # Note: workspaces can have any name you want, not just numbers.
142 # We just use 1-10 as the default.
143#
144# Layout stuff:
145#
146 # You can "split" the current object of your focus with
147 # $mod+b or $mod+v, for horizontal and vertical splits
148 # respectively.
149 bindsym $mod+b splith
150 bindsym $mod+v splitv
151
152 # Switch the current container between different layout styles
153 bindsym $mod+s layout stacking
154 bindsym $mod+w layout tabbed
155 bindsym $mod+e layout toggle split
156
157 # Make the current focus fullscreen
158 bindsym $mod+f fullscreen
159
160 # Toggle the current focus between tiling and floating mode
161 bindsym $mod+Shift+space floating toggle
162
163 # Swap focus between the tiling area and the floating area
164 bindsym $mod+space focus mode_toggle
165
166 # Move focus to the parent container
167 bindsym $mod+a focus parent
168#
169# Scratchpad:
170#
171 # Sway has a "scratchpad", which is a bag of holding for windows.
172 # You can send windows there and get them back later.
173
174 # Move the currently focused window to the scratchpad
175 bindsym $mod+Shift+minus move scratchpad
176
177 # Show the next scratchpad window or hide the focused scratchpad window.
178 # If there are multiple scratchpad windows, this command cycles through them.
179 bindsym $mod+minus scratchpad show
180#
181# Resizing containers:
182#
183mode "resize" {
184 # left will shrink the containers width
185 # right will grow the containers width
186 # up will shrink the containers height
187 # down will grow the containers height
188 bindsym $left resize shrink width 10px
189 bindsym $down resize grow height 10px
190 bindsym $up resize shrink height 10px
191 bindsym $right resize grow width 10px
192
193 # Ditto, with arrow keys
194 bindsym Left resize shrink width 10px
195 bindsym Down resize grow height 10px
196 bindsym Up resize shrink height 10px
197 bindsym Right resize grow width 10px
198
199 # Return to default mode
200 bindsym Return mode "default"
201 bindsym Escape mode "default"
202}
203bindsym $mod+r mode "resize"
204#
205# Utilities:
206#
207 # Special keys to adjust volume via PulseAudio
208 bindsym --locked XF86AudioMute exec pactl set-sink-mute \@DEFAULT_SINK@ toggle
209 bindsym --locked XF86AudioLowerVolume exec pactl set-sink-volume \@DEFAULT_SINK@ -5%
210 bindsym --locked XF86AudioRaiseVolume exec pactl set-sink-volume \@DEFAULT_SINK@ +5%
211 bindsym --locked XF86AudioMicMute exec pactl set-source-mute \@DEFAULT_SOURCE@ toggle
212 # Special keys to adjust brightness via brightnessctl
213 bindsym --locked XF86MonBrightnessDown exec brightnessctl set 5%-
214 bindsym --locked XF86MonBrightnessUp exec brightnessctl set 5%+
215 # Special key to take a screenshot with grim
216 bindsym Print exec grim
217
218#
219# Status Bar:
220#
221# Read `man 5 sway-bar` for more information about this section.
222bar {
223 position bottom
224 status_command while ~/.config/sway/status.sh; do sleep 1; done
225
226 # When the status_command prints a new line to stdout, swaybar updates.
227 # The default just shows the current date and time.
228 # status_command while date +'%Y-%m-%d %X'; do sleep 1; done
229
230 colors {
231 statusline #ffffff
232 background #000000
233 inactive_workspace #32323200 #32323200 #5c5c5c
234 }
235}
236
237default_border pixel 1
238
239# shortcut to switch regular/bold font in alacritty configuration
240bindsym $mod+Control+b exec sed -i 's/\"Regular\"#tag_for_shortcut/\"Bold\"#tag_for_shortcut/g' ~/.config/alacritty/alacritty.toml
241bindsym $mod+Control+Shift+b exec sed -i 's/\"Bold\"#tag_for_shortcut/\"Regular\"#tag_for_shortcut/g' ~/.config/alacritty/alacritty.toml
242
243# move current workspace to another display
244bindsym $mod+Control+k move workspace to output HDMI-A-1
245# bindsym $mod+Control+k move workspace to output DP-1
246bindsym $mod+Control+j move workspace to output eDP-1
247
248include /etc/sway/config.d/*