Skip to content

Instantly share code, notes, and snippets.

@efeme4
Created May 5, 2024 08:43
Show Gist options
  • Save efeme4/388e99396c2007a286d7b480b586ea44 to your computer and use it in GitHub Desktop.
Save efeme4/388e99396c2007a286d7b480b586ea44 to your computer and use it in GitHub Desktop.
Sway config file
# Default config for sway
### Variables
#
font pango:DejaVu Sans Mono 9
# Logo key. Use Mod1 for Alt.
set $mod Mod4
# Your preferred terminal emulator
set $term kitty
# Your preferred application launcher
set $menu fuzzel
#xwayland disabled
default_border normal 1
title_align center
output eDP-1 max_render_time off
output HDMI-A-1 max_render_time off
titlebar_padding 1
workspace_layout tabbed
client.focused #7700FF #7700FF #FFFFFF
bindsym F12 exec --no-startup-id ~/Scripts/swmon.sh
# You can get the names of your outputs by running: swaymsg -t get_outputs
#output eDP-1 mode --custom 1280x720 pos 0,0
set $laptop eDP-1
bindswitch --reload --locked lid:on output $laptop disable
bindswitch --reload --locked lid:off output $laptop enable
### Key bindings
#
# Basics:
#
# Kill focused window
bindsym $mod+q kill
# Start your launcher
bindsym $mod+space exec $menu
floating_modifier $mod normal
# Reload the configuration file
bindsym $mod+Shift+C reload
# Exit sway (logs you out of your Wayland session)
bindsym $mod+Shift+e exec wlogout
#
# Moving around:
#
# Or use $mod+[up|down|left|right]
bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus right
bindsym $mod+H focus left
bindsym $mod+J focus down
bindsym $mod+K focus up
bindsym $mod+L focus right
# Ditto, with arrow keys
bindsym $mod+Shift+Left move left
bindsym $mod+Shift+Down move down
bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right
bindsym $mod+Shift+h move left
bindsym $mod+Shift+j move down
bindsym $mod+Shift+k move up
bindsym $mod+Shift+l move right
#
# Workspaces:
#
# Launchers
bindsym $mod+Return exec $term
bindsym $mod+1 exec --no-startup-id firefox
bindsym $mod+2 exec --no-startup-id $term -e ranger
bindsym $mod+3 exec --no-startup-id $term -e nvim
bindsym $mod+4 exec --no-startup-id firefox --new-window open.spotify.com
bindsym $mod+v exec --no-startup-id pavucontrol
bindsym ctrl+shift+escape exec --no-startup-id $term -e btop
# Workspace changers
bindsym $mod+Shift+1 workspace number 1
bindsym $mod+Shift+2 workspace number 2
bindsym $mod+Shift+3 workspace number 3
bindsym $mod+Shift+4 workspace number 4
bindsym $mod+Shift+5 workspace number 5
bindsym $mod+Shift+6 workspace number 6
bindsym $mod+Shift+7 workspace number 7
bindsym $mod+Shift+8 workspace number 8
bindsym $mod+Shift+9 workspace number 9
bindsym $mod+Shift+0 workspace number 10
# Move focused container to workspace
bindsym $mod+ctrl+1 move container to workspace number 1
bindsym $mod+ctrl+2 move container to workspace number 2
bindsym $mod+ctrl+3 move container to workspace number 3
bindsym $mod+ctrl+4 move container to workspace number 4
bindsym $mod+ctrl+5 move container to workspace number 5
bindsym $mod+ctrl+6 move container to workspace number 6
bindsym $mod+ctrl+7 move container to workspace number 7
bindsym $mod+ctrl+8 move container to workspace number 8
bindsym $mod+ctrl+9 move container to workspace number 9
bindsym $mod+ctrl+0 move container to workspace number 10
# Layout stuff:
# Switch the current container between different layout styles
bindsym $mod+s layout stacking
bindsym $mod+w layout tabbed
bindsym $mod+e layout toggle split
# Make the current focus fullscreen
bindsym $mod+f fullscreen
# Toggle the current focus between tiling and floating mode
bindsym $mod+Shift+Space floating toggle
# Move focus to the parent container
bindsym $mod+a focus parent
#
# Scratchpad:
#
# Sway has a "scratchpad", which is a bag of holding for windows.
# You can send windows there and get them back later.
# Move the currently focused window to the scratchpad
bindsym $mod+z move scratchpad
# Show the next scratchpad window or hide the focused scratchpad window.
# If there are multiple scratchpad windows, this command cycles through them.
bindsym $mod+Shift+z scratchpad show
#
# Resizing containers:
#
mode "resize" {
bindsym Left resize shrink width 50px
bindsym Down resize grow height 50px
bindsym Up resize shrink height 50px
bindsym Right resize grow width 50px
bindsym h resize shrink width 50px
bindsym j resize grow height 50px
bindsym k resize shrink height 50px
bindsym l resize grow width 50px
# Return to default mode
bindsym Return mode "default"
bindsym Escape mode "default"
}
bindsym $mod+r mode "resize"
#
# Status Bar:
#
bar {
position bottom
status_command waybar
mode invisible
colors {
# statusline #ffffff
background #1B1C4A
# inactive_workspace #32323200 #32323200 #5c5c5c
}
}
input * {
xkb_layout "es"
xkb_numlock enabled
tap enabled
repeat_delay 180
repeat_rate 30
pointer_accel 0
}
# Background
#output "*" bg '/home/efeme/Imágenes/kriegsflagge.jpg' stretch
output * bg #000000 solid_color
for_window [app_id="org.gnome.Calculator"] floating enable
for_window [class="XEyes"] floating enable
for_window [title="Picture-in-Picture"] floating enable
for_window [class="delivery-MyDelivery"] floating enable
for_window [window_role="pop-up"] floating enable
for_window [window_role="bubble"] floating enable
for_window [window_type="dialog"] floating enable focus
for_window [window_type="menu"] floating enable
# Media controls
bindsym XF86Launch1 exec systemctl suspend
bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +5%
bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -5%
bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle
bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle
bindsym XF86MonBrightnessDown exec --no-startup-id brightnessctl set 1%-
bindsym XF86MonBrightnessUp exec --no-startup-id brightnessctl set 1%+
bindsym Insert exec --no-startup-id playerctl play-pause
bindsym XF86AudioPlay exec --no-startup-id playerctl play-pause
bindsym XF86AudioPause exec --no-startup-id playerctl play-pause
bindsym XF86AudioPrev exec --no-startup-id playerctl previous
bindsym XF86AudioNext exec --no-startup-id playerctl next
bindsym XF86Calculator exec --no-startup-id gnome-calculator
bindsym XF86Explorer exec --no-startup-id dolphin
bindsym $mod+Delete exec --no-startup-id killall main
#Notifications
exec --no-startup-id mako
#Bluetooth
bindsym $mod+F7 exec --no-startup-id bluetoothctl connect 00:18:09:86:18:6E
bindsym $mod+Shift+F7 exec --no-startup-id bluetoothctl disconnect 00:18:09:86:18:6E
#Auth
#exec --no-startup-id /usr/libexec/kf6/polkit-kde-authentication-agent-1
exec --no-startup-id /usr/libexec/polkit-gnome-authentication-agent-1
exec --no-startup-id /usr/libexec/xdg-desktop-portal-gnome
exec --no-startup-id /usr/libexec/xdg-desktop-portal-gtk
#Screenshots
bindsym $mod+shift+s exec --no-startup-id grimshot save area "$(date).png"
bindsym $mod+ctrl+shift+s exec --no-startup-id grimshot copy area "$(date).png"
bindsym $mod+escape exec reboot
include /etc/sway/config.d/*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment