-
-
Notifications
You must be signed in to change notification settings - Fork 1
Sway
Pavlo Rudy edited this page Nov 19, 2022
·
9 revisions
sudo swupd 3rd-party bundle-add sway-extras \
alacritty kitty waybar
# /etc/systemd/user/sway.service
[Unit]
Description=sway - SirCmpwn's Wayland window manager
Documentation=man:sway(5)
BindsTo=default.target
Wants=default.target
After=default.target
[Install]
WantedBy=default.target
[Service]
Type=simple
EnvironmentFile=-%h/.config/sway/env
#ExecStartPre=systemctl --user unset-environment WAYLAND_DISPLAY DISPLAY # This line make you able to logout to dm and login into sway again
ExecStart=dbus-run-session sway
Restart=on-failure
RestartSec=1
TimeoutStopSec=10
Then enable the systemd service: systemctl --user enable sway.service && systemctl --user daemon-reload. Sway will start after next tty
login.
Sway configuration file located in ~/.config/sway/config
.
Create the file to fix unlock.
set $term alacritty
set $menu rofi -show drun | xargs swaymsg exec --
set $menu bemenu | xargs swaymsg exec --
default_border none
exec_always "wlsunset -l 12.3 -L 45.6"
exec_always "dbus-update-activation-environment DISPLAY XAUTHORITY WAYLAND_DISPLAY && gnome-keyring-daemon --start --components=secrets"
set $gnome-schema org.gnome.desktop.interface
exec_always {
gsettings set $gnome-schema gtk-theme 'theme name'
gsettings set $gnome-schema icon-theme 'icon theme name'
gsettings set $gnome-schema cursor-theme 'cursor theme name'
gsettings set $gnome-schema font-name 'ClearSans 18'
}
set $wallpapers_path $HOME/Pictures/Wallpapers
output * bg $(find $wallpapers_path -type f | shuf -n 1) fill
exec swayidle -w \
timeout 300 'swaylock -f -c 000000' \
timeout 600 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' \
before-sleep 'swaylock -f -c 000000'
input type:touchpad {
dwt enabled
tap enabled
natural_scroll enabled
middle_emulation enabled
}
input * {
xkb_layout "us,ua"
xkb_options "grp:win_space_toggle"
}
input keyboard xkb_model "pc101"
# You can get the names of your inputs by running: swaymsg -t get_inputs
bindsym XF86AudioRaiseVolume exec amixer set Master 5%+
bindsym XF86AudioLowerVolume exec amixer set Master 5%-
bindsym XF86AudioMute exec amixer set Master toggle
bindsym XF86AudioMicMute exec amixer set Capture toggle
bindsym XF86MonBrightnessDown exec brightnessctl set 5%-
bindsym XF86MonBrightnessUp exec brightnessctl set 5%+
bindsym Print exec grim
bindsym XF86AudioPlay exec playerctl play-pause
bindsym XF86AudioNext exec playerctl next
bindsym XF86AudioPrev exec playerctl previous
bindsym XF86Search exec bemenu-run
bindsym Pause exec swaymsg "output eDP-1 dpms toggle"
# get all video outputs: swaymsg -pt get_outputs
bar {
position top
# When the status_command prints a new line to stdout, swaybar updates.
# The default just shows the current date and time.
status_command while date +'%Y-%m-%d %I:%M %p'; do sleep 60; done
colors {
statusline #ffffff
background #32323200
inactive_workspace #32323200 #32323200 #5c5c5c
}
}
# Read `man 5 sway-bar` for more information about this section.