[TRACKING] Sway / i3 WM on Framework

I’ve found the best way to handle scaling is to install sway-hidpi-git from the AUR which patches wlroots, xwayland, and sway to allow HiDPI for Xwayland as well as Wayland apps. I’ve been using it for a while now, and it’s been very reliable. Never had to set any font scales or use xrandr, just

output eDP-1 scale 1.5
output eDP-1 scale_filter smart
xwayland force scale 2
exec xsettingsd

in sway config.

As for other distros, you can compile each part of the sway stack manually to add HiDPI xwayland, I don’t think the patched versions are available pre-configured anywhere but arch.

5 Likes

Hey I’m using sway as well on the framework. Did anyone figure out how to setup the keyboard backlight. Neither light nor brightnessctl seem to find the correct led for the keyboard. Was anyone able to resolve this?

Also what @shark found out sounds pretty nice but compiling everything myself is something I may do in the future as I’m kinda happy with what I’ve got since now.

EDIT:
I just found out that it seems. That this still needs to be developed. So If I understand correctly there is no way for me to get the keyboard backlight to turn on via sway, correct?

1 Like

The Fn + Space is to change the keyboard backlight. You can see https://wiki.archlinux.org/title/Framework_Laptop#Function_keys .

2 Likes

Fail that I didn’t even tried that. I just assumed I would have to do this myself as with all the other hotkeys :smiley: Thanks!

2 Likes

Yeah, it is implemented at the bios level and so functionality for the keyboard backlight is OS independent. :+1:

4 Likes

I am running debian 11 with sway on my framework 12.

i’ll just dump my notes here so they are available for other people.

https://wiki.debian.org/InstallingDebianOn/FrameWork/12thGen

https://community.frame.work/t/debian-testing-on-the-framework-laptop/14448

# usb tethering with smartphone
ip link # find device id -> $usb
ip link set $usb up
dhclient $usb

apt install network-manager
nmtui

apt install sway
apt install xwayland
echo "export WLR_NO_HARDWARE_CURSORS=1" >> ~/.bash_profile
echo "export MOZ_ENABLE_WAYLAND=1" >> ~/.bash_profile

sway -d >sway.log 2>&1

apt install pulseaudio pavucontrol

sway status_bar
#################
david@fw:~$ vim ~/.config/sway/config 
    status_command while ~/.config/sway/status.sh; do sleep 10; done
    colors {
        statusline #779988
        background #323232
        inactive_workspace #32323200 #32323200 #5c5c5c
    }

david@fw:~$ vim ~/.config/sway/status.sh
#!/usr/bin/env bash
date_formatted=$(date "+%a %F %H:%M")
battery=`acpi  -b | cut -d ' ' -f 4`
battery=${battery%,*}
battery_status=$(cat /sys/class/power_supply/BAT1/status)
screen=`brightnessctl --device=intel_backlight --machine-readable | cut -d ',' -f 4`
temp=`sensors coretemp-isa-0000|grep 'Core 0'| cut -d ' ' -f 10`
wifi=`nmcli --terse --color=no --fields=IN-USE,SIGNAL,SSID device wifi|grep '^\*'`
wifi_ssid=`echo $wifi|cut -d':' -f3`
if [ -z "$wifi_ssid" ]; then
  wifi_status='NOT-CONNECTED'
else
  wifi_signal=`echo $wifi|cut -d':' -f2`
  wifi_status="$wifi_ssid $wifi_signal%"
fi
audio=`pactl get-sink-volume @DEFAULT_SINK@ | head -n1 | cut -d '/' -f 2`
echo Audio $audio $wifi_status $temp Screen $screen $battery_status $battery $date_formatted

david@fw:~$ chmod 744 ~/.config/sway/status.sh
2 Likes

I love Sway! Thanks!

1 Like

It should work if you install Xwayland (you’ll have to restart sway afterwards to have it recognize that xwayland is installed).

I am curious to know why using sway with XWayland is better than sway without XWayland.

1 Like

I updated my sway-and-i3-related config files on Framework Laptop to the latest ones at https://github.com/junaruga/framework-laptop-config. It’s for someone who is interested in it.

2 Likes

It allows you to run applications that are made for Xorg and not Wayland. If that is something you want to do (and the majority of Linux software is written for Xorg) then you have no choice but to run XWayland.

1 Like

I see. Thanks for the explanation!

1 Like

This is a rather long (and old!) thread and I’m not sure I can answer all the (unanswered?) questions, but considering I have fought with this quite a bit, I figured I could offer my comments…

I switched to Wayland (from i3 to Sway) after buying a Framework 12th gen, because I was having too much graphics issues in Xorg. I documented my migration in this post, but basically, I had to rewrite a few bits I was using in i3 to make them work in Sway. I have, in particular, the following tools now:

  • i3-pa-mixer.py: works in sway or i3, considering the @DEFAULT_SINK@ trick…
  • sway-focus: to get a more “normal” alt-tab (across containers), had to rewrite from my i3-focus, rather annoyingly
  • sway-power-menu: rewritten to use fuzzel instead of rofi
  • dmenu-bash-history: runner that taps into my bash history (and adds to it), to improve on the default dmenu completion, yet another fuzzel/rofi rewrite
  • dmenu-ssh.py: rofi-like SSH completion for dmenu/fuzzel

The wayland section of my migration guide has more info, including a link to the full configuration.

I’m using swayidle to automatically lock the screen. It generally works on suspend, but I’ve seen it fail to lock the screen once, which was disturbing.

My Framework review post also has more information on the trouble I had running Debian on the Framework and which might provide you more information.

I hope that helps!

4 Likes

Thanks for sharing the great tips! The migration guide looks very nice.

1 Like

Just note I asked about XWayland and Wayland on the Ask Fedora forum. Here is one tip on Fedora.

1 Like

wow, thank you for this tip! somehow I had missed that in the pactl manpage, it will make my mixer script much simpler. :slight_smile:

1 Like

Thanks! I have been wanting to move back to Sway again, BUT I never did because I had all these issues with integrating gnome session stuff, authentication, etc.

Are you having any issues with these kind of things? Have you tried running the Steam client or done any gaming with it?

I love Sway, and would love to move to it, instead of forcing Gnome to function like Sway. Which is what I have been doing.

1 Like

… hmm… well not with Sway specifically I’d say. Running things like sway or i3, you often run into weird issues because you don’t run a “normal desktop”, but so far so good, I’d say: sway isn’t better or worse than other alternatives in that regard. I did have touble running it under systemd, but that has somewhat stabilized…

Not really.

2 Likes

I know it is possible, because on the MNT Reform I have I am using Sway and everything just works. No issues whatsoever. For example, i can open gnome-control-center (settings) with no issues. On the Framework running Sway I got all kinds of issues with that, in that the settings from it weren’t being saved and taking affect on the session I was currently in.

If I could get Sway in the same situation as the Reform, I’d know I could use it for everything at that point. Then I would use Sway again. Probably just need to dig a little deeper and compare the config files between the two.

Still I remapped mod + 1-9 to move between workspaces just like sway, and then I just manually put everything on a grid in the workspaces. It is kind of what I would recommend if you prefer tilers but need no quirks in your desktops functionality.

1 Like

For example, i can open gnome-control-center (settings) with no issues.

I’ve experienced the same for the most part, however I’ve never managed to be able to manage Bluetooth (when in Sway) works in Gnome.
Have you found the same?

1 Like

I am not sure how many people are interested in the i3 window manager. But I just want to share that the i3 recently released the latest version 4.22, and the latest version has the gaps feature finally! It works in my environment. The i3 version 4.22 is already available as RPM packages in Fedora.

1 Like