Skip to content

Instantly share code, notes, and snippets.

@mizzunet
Last active March 14, 2022 19:53
Show Gist options
  • Save mizzunet/f0e605bb24abe19771c403adb1f298fc to your computer and use it in GitHub Desktop.
Save mizzunet/f0e605bb24abe19771c403adb1f298fc to your computer and use it in GitHub Desktop.
SwayWM Configuration
# variables
set $mod Mod4
set $left h
set $down j
set $up k
set $right l
set $menu sirula
set $files nemo
set $browser librewolf
set $ws1 "1"
set $ws2 "2"
set $ws3 "3"
set $ws4 "4"
set $ws5 "5"
set $ws6 "6"
set $ws7 "7"
set $ws8 "8"
set $ws9 "9"
set $ws10 "10"
set $wall_dir "/home/missu/Pictures/"
set $wall "pexels-lisa-fotios-1083822.jpg"
# input configuration
input * xkb_numlock enable
input type:touchpad {
tap enabled
pointer_accel 0.3
accel_profile adaptive
middle_emulation enabled
}
# gaps
gaps inner 5
gaps outer 8
# border
default_border pixel 1
default_floating_border pixel 1
smart_borders on
# font
font pango:Proxima Nova 10.5
# colors
# class border backgr. text indicator child_border
client.focused #222222 #5A5A5A #E1E1E1 #000000 #000000
client.focused_inactive #222222 #5A5A5A #E1E1E1 #484e50 #000000
client.unfocused #222222 #323232 #888888 #292d2e #222222
client.urgent #2f343a #900000 #ffffff #900000 #900000
client.placeholder #000000 #0c0c0c #ffffff #000000 #0c0c0c
# wallpaper
output * bg $wall_dir$wall fill
# waybar
bar {
swaybar_command waybar
}
# window manipulation
for_window [title="ProtonMail"] move window to workspace $ws2
for_window [class="Spotify"] move window to workspace $ws3
for_window [title="Volume Control"] move position 838 0
for_window [app_id="[Ww]aydroid.*"] move right
for_window [app_id="[Ww]aydroid.*"] resize set width 400px
# Send windows
assign [title="Signal|Ferdi"] $ws2
assign [title="Habits"] $ws4
assign [title="Getting Things GNOME!"] $ws3
# enable floating for windows
for_window [title="Properties|Page Info|Volume Control|File Operation Progress|Choose a folder|Select books|xdg-desktop-portal-gtk|iwgtk|Library"] floating enable
include ~/.config/sway/conf.d/*
# mouse button for dragging.
floating_modifier $mod normal
bindsym {
# foreground
# htop
control+Shift+Escape exec alacritty -e htop
# Start a terminal
$mod+Return exec alacritty
# Start your launcher
$mod+space exec $menu
# Start Files
$mod+m exec $files
# Open Broweser
$mod+b exec $browser
# clipmenu
Control+Shift ~/.clipman_swap
$mod+c exec ~/.scripts/clipmenu
# control
# caffine mode
$mod+Shift+c exec ~/.scripts/swayidle
# wifi toggle
$mod+Shift+w exec ~/.scripts/wifi
XF86WLAN exec ~/.scripts/wifi
# wlsunset toggle
$mod+Shift+n exec ~/.scripts/wlsunset
# Use amixer to adjust volume
XF86AudioRaiseVolume exec ~/.scripts/ChangeVolume up
XF86AudioLowerVolume exec ~/.scripts/ChangeVolume down
XF86AudioMute exec ~/.scripts/ChangeVolume mute
# Sreen brightness controls
XF86MonBrightnessUp exec ~/.scripts/ChangeBrightness up
XF86MonBrightnessDown exec ~/.scripts/ChangeBrightness down
# Audio controls
XF86AudioPlay exec playerctl play-pause
XF86AudioNext exec playerctl next
XF86AudioPrev exec playerctl previous
# Screenshot
Print exec exec grim -g "$(slurp)" - | swappy -f -
Shift+Print exec grim /tmp/screen.png && wl-copy < /tmp/screen.png && notify-send "Screenshot Copied to Clipboard"
#Shift+Print grim ~/Pictures/Screenshot/$(date +%d%m%y-%I%M%S) | wl-copy && notify-send "Screenshot Copied to Clipboard"
# waydroid
control+mod1+a exec ~/.scripts/waydroid
# waydroid: antennaPod controls
control+mod1+j exec ~/.scripts/antennapod toggle
control+mod1+h exec ~/.scripts/antennapod rewind
control+mod1+l exec ~/.scripts/antennapod forward
# ctrl+alt+delete to reboot
control+mod1+Delete exec loginctl reboot
# sway
# Kill focused window
$mod+Shift+q kill
# Reload the configuration file
$mod+Shift+Escape reload
# Exit sway (logs you out of your Wayland session)
$mod+Shift+End 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'
# screen rotation
control+mod1+Right exec swaymsg 'output * transform 90'
control+mod1+Left exec swaymsg 'output * transform 270'
control+mod1+Up exec swaymsg 'output * transform 0'
# Moving around:
# Move your focus around
$mod+$left focus left
$mod+$down focus down
$mod+$up focus up
$mod+$right focus right
# Move the focused window with the same, but add Shift
$mod+Shift+$left move left
$mod+Shift+$down move down
$mod+Shift+$up move up
$mod+Shift+$right move right
# Workspaces:
# Switch to workspace
$mod+1 workspace number $ws1
$mod+2 workspace number $ws2
$mod+3 workspace number $ws3
$mod+4 workspace number $ws4
$mod+5 workspace number $ws5
$mod+6 workspace number $ws6
$mod+7 workspace number $ws7
$mod+8 workspace number $ws8
$mod+9 workspace number $ws9
$mod+0 workspace number $ws10
# Move focused container to workspace
$mod+Shift+1 move container to workspace number $ws1
$mod+Shift+2 move container to workspace number $ws2
$mod+Shift+3 move container to workspace number $ws3
$mod+Shift+4 move container to workspace number $ws4
$mod+Shift+5 move container to workspace number $ws5
$mod+Shift+6 move container to workspace number $ws6
$mod+Shift+7 move container to workspace number $ws7
$mod+Shift+8 move container to workspace number $ws8
$mod+Shift+9 move container to workspace number $ws9
$mod+Shift+0 move container to workspace number $ws10
# Layout stuff:
# Switch the current container between different layout styles
$mod+w layout tabbed
$mod+e layout toggle split
# Make the current focus fullscreen
$mod+f fullscreen
# Toggle the current focus between tiling and floating mode
$mod+Shift+space floating toggle
# Swap focus between the tiling area and the floating area
# $mod+space focus mode_toggle
# Move focus to the parent container
$mod+a focus parent
# Scratchpad:
# Move the currently focused window to the scratchpad
$mod+Shift+minus move scratchpad
$mod+minus scratchpad show
# Resizing containers:
$mod+r mode "resize"
}
mode "resize" {
bindsym {
$left resize shrink width 40px
$down resize grow height 40px
$up resize shrink height 40px
$right resize grow width 40px
Return mode "default"
Escape mode "default"
}
}
exec {
gsettings set org.gtk.Settings.FileChooser window-size '(740, 371)'
gsettings set org.gnome.desktop.interface gtk-theme 'Skeuos-White-Dark'
gsettings set org.gnome.desktop.interface icon-theme 'Adwaita'
gsettings set org.gnome.desktop.interface cursor-theme 'Adwaita'
gsettings set org.gnome.desktop.interface font-name 'Proxima Nova 10.5'
gsettings set org.gnome.desktop.default-applications.terminal exec 'alacritty'
gsettings set org.gnome.desktop.default-applications.terminal exec-arg '-e'
gsettings set org.gnome.desktop.interface enable-animations false
}
exec {
dbus-update-activation-environment DISPLAY I3SOCK SWAYSOCK WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=sway
dbus-daemon --session --address=unix:path=$XDG_RUNTIME_DIR/bus
# power saving
batsignal -b -w 20 -c 15 -d 5 -m 30 -D "loginctl suspend" -I /usr/share/icons/elementary/status/48/battery-caution.svg
doas powertop --auto-tune
#~/.scripts/sleephdd
# exec background
~/.scripts/pipewire
~/.scripts/transparent-unfocused -o 0.65
~/.scripts/wlsunset
udiskie -N
nwggrid-server
wl-paste -t text --watch clipman store
sway-audio-idle-inhibit
autotiling
# exec foreground
mako
/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1
~/.scripts/swayidle
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment