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