Transitioning to Sway/Wayland for desktop environment.
Expect iterative changes over the following months while fine-tuning happens on real hardware.
Create a sway
branch to test building a minimal install with a brand new window manager and removing xorg packages!
Disable all GUI packages to build a "minimal" install.
We'll take that image and triple check package dependency chains for sway and applications to run on it
This will likely require significant refinement, as I'll need to test configurations on real hardware to validate multi-monitor behavior.
Further, it will require some time to get used to it, but from rudimentary tests I have been able to run every game of interest on it, and with significantly increased performance!
References:
https://www.fosskers.ca/en/blog/wayland https://wiki.archlinux.org/title/Sway#Manage_Sway-specific_daemons_with_systemd https://wiki.archlinux.org/title/Sway#Application_launchers https://github.com/swaywm/sway/issues/1174 https://www.youtube.com/watch?v=hRIGYUWQfYU https://www.youtube.com/watch?v=YWgZrES4t3U https://github.com/swaywm/sway/wiki#program-launchers https://github.com/lyfeyaj/sublime-text-imfix https://www.reddit.com/r/swaywm/comments/eksf1p/steam_now_fully_works_under_sway/
Installed packages:
sway
alacritty
wofi
waybar
xorg-xwayland
xorg-xlsclients
qt5-wayland
glfw-wayland
grim
slurp
xdg-desktop-portal-wlr
libpipewire02
ttf-font-awesome
wl-clipboard
lxsession-gtk3
Next create a config for sway:
mkdir -p ~/.config/sway
cp /etc/sway/config ~/.config/sway/config
I'm still tinkering with one using wofi
for $menu
and waybar, but it's not nearly ready.
Migrate as many hotkeys from rc.xml
as possible to sway config
Added to ~/.bash_profile
:
export MOZ_ENABLE_WAYLAND=1
export SDL_VIDEODRIVER="wayland"
The SDL_VIDEODRIVER
is for steam, and may break in many games, so I'll need to add overrides for incompatible titles using SDL_VIDEODRIVER=x11
in steam launch commands, or if more games fail than no I can invert my setup so I add the override for games that I know work with wayland.
Switch to waybar in sway config (this is a massive improvement over the default):
bar {
swaybar_command waybar
}
I need to research how to fully customize waybar, because it has a lot of data and could be refined!
I need to test wayland native alternatives to urxvt
and pcmanfm
; one recommendation is alacritty
as a urxvt
replacement, and pcmanfm-gtk3
is supposedly wayland-compatible without xwayland. Needs to be tested.
I also need to test a base install with no GUI packages and manually installing the sway dependencies to ensure a minimal build.
Add logic to sway config that starts sway-session target:
exec_always "systemctl --user import-environment; systemctl --user start sway-session.target"
Delete legacy userspace service files, and edit/change others for sway-session compatibility.
Create new systemd service files for:
Verify whether we can delete .Xdefaults
and .Xresources
, as both should be legacy xorg specific; eg. urxvt.
Replace /usr/local/bin/screenshot
:
grim -o $(swaymsg -t get_outputs | jq -r '.[] | select(.focused) | .name') "$(xdg-user-dir PICTURES)/screenshots/$(date +'%Y%m%d_%H%M%S%N.png')"
Replace /usr/local/bin/screenshot-selection
:
dimensions=$(slurp 2>/dev/null)
if [ $? -eq 0 ]; then
grim -g "$dimensions" "$(xdg-user-dir PICTURES)/screenshots/$(date +'%Y%m%d_%H%M%S%N.png')"
else
grim -g "$(swaymsg -t get_tree | jq -j '.. | select(.type?) | select(.focused).rect | "\(.x),\(.y) \(.width)x\(.height)"')" "$(xdg-user-dir PICTURES)/screenshots/$(date +'%Y%m%d_%H%M%S%N.png')"
fi
Replace /usr/local/bin/wallpaper
:
#!/bin/bash
# set sane defaults
[ -z "$wallpaper_sleep_for" ] && wallpaper_sleep_for="180"
[ -z "$wallpaper_path" ] && wallpaper_path="$(xdg-user-dir PICTURES)/wallpaper"
mkdir -p "$wallpaper_path"
# validate wallpaper path
[ $(find "$wallpaper_path" -type f | wc -l) -gt 0 ] || exit 1
# there can be only one
while [ $(ps aux | grep -v 'grep' | grep -c "$0") -gt 2 ]; do
kill $(ps aux | grep -v 'grep' | grep -v $$ | grep "$0" | awk '{print $2}') &> /dev/null
done
# infinitely change wallpaper
while true; do
sway_outputs=( $(swaymsg -t get_outputs | jq -r '.[].name') )
for op in "${sway_outputs[@]}"; do
wp="$(find $wallpaper_path -type f | sort -R | tail -1)"
swaymsg "output $op bg $wp" fit \#001E27
done
sleep $wallpaper_sleep_for
done
research firefox auto-configuration or copying configuration files (eg. if plain text can add to dot-files):
test/fix multimedia keys for volume change support (may require actual hardware; would also consider popup icons?)
add yad
to packages as a wayland-native zenity
alternative
install cmst
from aur and try it out as an option for wifi support
investigate using scratchpad
feature of sway
for persistent terminal with toggle hotkey
investigate creating workspace affinities for things like fullscreen games so it automates placement/movement
set sway config to load userspace .d
directory for custom settings
on real hardware I'll need to test/refine sway config hotkeys for better navigation
.desktop
and not raw command line
.Xdefaults
?https://developers.redhat.com/blog/2016/10/28/what-comes-after-iptables-its-successor-of-course-nftables https://wiki.nftables.org/wiki-nftables/index.php/Main_differences_with_iptables https://wiki.nftables.org/wiki-nftables/index.php/Moving_from_iptables_to_nftables https://ungleich.ch/en-us/cms/blog/2018/08/18/iptables-vs-nftables/ https://github.com/swaywm/sway/issues/3319 https://github.com/swaywm/sway/blob/master/config.in https://github.com/jdonofrio728/swaywm-bg-changer/blob/master/swaywm-bg-changer https://github.com/jdonofrio728/swaywm-bg-changer https://www.reddit.com/r/swaywm/comments/ehqsuw/autochanging_background_for_sway/ https://github.com/swaywm/sway/issues/5006 https://wiki.archlinux.org/title/Polkit https://forums.centos.org/viewtopic.php?t=70139 https://github.com/swaywm/sway/wiki/GTK-3-settings-on-Wayland https://www.reddit.com/r/swaywm/comments/epp0r4/unable_to_configure_the_cursor_theme/ https://wiki.archlinux.org/title/x_resources