kota's memex

usage

First, install dbus-elogind, elogind, and polkit. Then enable the dbus service.

You'll also need video drivers, for intel that's intel-video-accel mesa-dri mesa-vulkan-intel. Fonts will also help: noto-fonts-cjk noto-fonts-emoji noto-fonts-ttf noto-fonts-ttf-extra and finally, a terminal such as foot.

dbus and session setup

Usually you'll want to set a number of variables and run sway with dbus. This is the script I use to do so:

#!/bin/sh
export XDG_SESSION_TYPE=wayland
export XDG_SESSION_DESKTOP=sway
export XDG_CURRENT_DESKTOP=sway

# Wayland stuff
export QT_QPA_PLATFORM=wayland
export SDL_VIDEODRIVER=wayland
export _JAVA_AWT_WM_NONREPARENTING=1

exec dbus-run-session -- sway "$@"

starting automatically

If you'd also like to "auto login" your best bet is to use greetd to both login and start sway.

without login manager

You can start sway automatically without a login manager, for example, by adding this to your .bash_profile (.zlogin or .zprofile for Zsh):

# If running from tty1 start sway
if [ "$(tty)" = "/dev/tty1" ]; then
	exec dbus-run-session -- sway
fi

list output

swaymsg -t get_outputs

list opened windows

swaymsg -t get_tree

hide the cursor after innactivity

(seat * hide_cursor 8000)

notifications not working

This seems to be an issue with dbus not finding the DISPLAY variable. There's a workaround on my dbus page.

volume and brightness notification bar

I use the wob program for this. It's quite nice, but you'll basically need to write to the wob file in order to display the notification. Meaning, it wont "automagically" detect ANY brightness or volume change. I find this acceptable, because if I change the volume in nmtui or brightness via the cli I don't even want a notification.

x11 applications on a scaled display

Integer scaling in sway works great ... if all of your programs run in wayland. If you happen to play any video games or use other such x11 programs you will will have your applications rendered at the wrong resolution and scaled up (either nearest neighbor or worse with a blur added). For games on a 4k monitor this means you're running them all at 1080p.

Valve made a program called gamescope which you can use as a workaround to run your x11 programs at a different resolution.

articles

https://github.com/swaywm/sway/wiki/Useful-add-ons-for-sway

Big list of programs and addons for sway.

https://github.com/roosta/i3wsr

Automatically renames your workspaces, helpful if you're using a bar.