[TRACKING] Sway / i3 WM on Framework

Right. What I mean is that I don’t have to separately configure the swayidle command (which runs swaylock at preconfigured events) and the manual lock command, since everything is read from the config file. That’s just a personal preference, though, just to keep my sway config a bit more tidy.

Presumably it would be a user, not a system service? But yeah, as I said, I don’t have much experience with it (though I used to use slock with xss-lock, configured as a user systemd service, which worked fairly well).

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

I’m bilingual in both English and Kannada. I keep LANG=kn_IN.UTF8 set just to see how well (or poorly) programs are localized, and that’s how I realized that swaylock is completely English-specific xD

1 Like

Hopefully only for now. As it gains popularity maybe it will gain some translations.

Just wanted to thank you again, as I’ve been able to fix all of my issues with Workstation. All the shortcut function keys are properly mapped and functional.

It took a couple of days, but I’m very happy with this setup.

2 Likes

Yup! I might even look to get involved as a contributor if only so that I can have my lockscreen in Kannada :joy:

Glad to hear it! :blush:

1 Like

One quick thing I’ve found is that when rebooting your sink source can change. If you use
@DEFAULT_SINK@ instead of 0 (or any other number for that matter) you wont have issues upon reboot. Your volume keys should always just work. :+1:

3 Likes

Cool, thanks for the tip! :blush:

1 Like

I am using i3 window manager on Fedora 35. Though this thread is about Ubuntu. Maybe the content could be similar between Ubuntu and Fedora. So let me post here.

Based on this setting about Media keys: Sway / i3 WM on Framework - #6 by Chiraag_Nataraj and other comments, I created my own.

Note I checked each media key’s symbol by xev -event keyboard. For print screen key, I am using gnome-screenshot command as I also have Gnome environment. To use mpc, you need to install mpd from RPMFusion. I haven’t tested the mpc settings by myself.

# Media keys
# $ xev -event keyboard
# Use pactl.
# Framework Laptop F1: XF86AudioMute
bindsym XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggle
bindsym XF86AudioMicMute exec pactl set-source-mute @DEFAULT_SOURCE@ toggle
# Framework Laptop F2: XF86AudioRaiseVolume
bindsym XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +10%
# Framework Laptop F3: XF86AudioLowerVolume
bindsym XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -10%
# Use mpc (Music Playing Client) and mpd (Music Playing Daemon) from RPM Fusion.
# https://fedoramagazine.org/playing-music-on-your-fedora-terminal-with-mpd-and-ncmpcpp/
# Framework Laptop F4: XF86AudioPrev
bindsym XF86AudioPrev exec mpc prev
# Framework Laptop F5: XF86AudioPlay
bindsym XF86AudioPlay exec mpc toggle
# Framework Laptop F6: XF86AudioNext
bindsym XF86AudioNext exec mpc next
# Framework Laptop F7: XF86MonBrightnessDown
# The --min-value option is important to prevent the complete darkness.
bindsym XF86MonBrightnessDown exec "brightnessctl --device intel_backlight --min-value=5 set 5%-"
# Framework Laptop F8: XF86MonBrightnessUp
bindsym XF86MonBrightnessUp exec "brightnessctl --device intel_backlight set 5%+"
# Framework Laptop F9: Super_L + p
# TODO: Assign this multiple screen key with the toggle multiple screens when using it.
# https://fedoramagazine.org/using-i3-with-multiple-monitors/
bindsym $mod+p exec firefox https://fedoramagazine.org/using-i3-with-multiple-monitors/
# Framework Laptop F10: XF86RFKill (already available)
# $ rfkill list all
# $ nmcli radio all
# Framework Laptop F11: Print
# https://unix.stackexchange.com/questions/497897/print-screen-key-in-i3
bindsym Print exec gnome-screenshot -i
# Framework Laptop F12: XF86AudioMedia
bindsym XF86AudioMedia exec firefox https://community.frame.work/
3 Likes

Seeing the GitHub repository of i3 and sway, sway has more stars than i3. But both seems well-maintained. I have been using i3 on my ThinkPad Carbon, and now customizing the i3 on my Framework Laptop.

This Youtube video Tiling Window Management and i3wm config additions introducing i3 is informative. It seems the person has long experience of window managers.

And he is sharing his heavily customized i3 config at his GitHub repository.

Here is how to see it. As he stopped supporting i3, you need to check a past commit.

$ git clone https://github.com/LukeSmithxyz/voidrice.git
$ cd voidrice
$ git checkout ad161d9363aadeb9f4ec3c852ca6c96162f2b4b0
$ vi .config/i3/config

This person’s Youtube play list about Minimalist software looks nice.

1 Like

My experience in general is that Sway works better than i3 on the Framework Laptop, but both work. I have noticed better performance on swap and zero tearing.

The cool thing about i3 and sway is that sway was designed to be a drop in replacement for it. It is i3 for Wayland basically. So your i3 config will work with Sway, with perhaps minimal updates.

2 Likes

Thanks for the info. After checking both sway and i3’s GitHub repositories and Wikipedia pages, sway is on Wayland and completely written in C. The performance might be better in C. And i3 is on X-Window system written in C + some script languages. And the Wayland looks more modern than X Window system. Maybe I will try sway.

I am playing on Sway now on Fedora 35 on my Framework Laptop. I found Sway setting up guide on Fedora . It seems the Sway default config file /etc/sway/config has i3 compatibility + Sway specific features. Sway looks really good for people to start tiling window manager. I see Sway’s default terminal is alacritty. And this terminal is one of the best and fastest terminals nowadays watching the Youtube videos. The behaviors of i3 and Sway about tiling is a little different. I also have to migrate the X windows system config files (/etc/X11/xorg.conf.d/*.conf) for keyboard and touchpad to config in Sway or Wayland. I am learning Sway and Alacritty now. :smiley:

2 Likes

I am trying to setup Sway on Fedora 35 on the Framework Laptop (Batch 2, the BIOS version is default. Maybe 3.02). Below is the screenshot. The issue is that Firefox and Firefox’s tab, menu bar and Sway’s status bar on the top by waybar are too big. Firefox is 100% scale.

Searching this forum, I saw some threads related to resolution. On the [RESPONDED] Using elementary OS on the Framework Laptop , there is an example with xrandr. But the xrandr is not recommended on Sway.

On another thread Screen Resolution not displaying correctly on Linux Mint - #2 by Chiraag_Nataraj , I found the following comment.

I use sway as my Wayland compositor and setup fractional scaling (1.5) and it all “Just Works”.

I tried the following 3 settings in .config/sway/config, but after reloading the config ( $mod+Shift+c), nothing is changed.

output eDP1 mode 2256x1504
output eDP1 mode 3000x2000
output eDP1 scale 1.5

Could you tell me how to modify the .config/sway/config to show the display properly with thin and small title bars? Thanks.

Edited at December 29 2021: Sorry I noticed I did set wrong device ID eDP1 instead of correct ID eDP-1 seeing the output of swaymsg -t get_outputs. So, the following setting gave me a better experience.

output eDP-1 scale 1.2

@2disbetter by the way, shall we change this thread title name to a name to describe Sway / i3 common thread that is not Ubuntu specific?

1 Like

Hmm, well I started it around the context of Ubuntu 20.04 LTS specifically. Most of the information in here is specific to that distro.

But absolutely. If we make this a central thread for Sway and i3 on the Framework, that could be helpful.

1 Like

Which part on this thread is Ubuntu specific? I couldn’t find it.

Thanks for renaming the thread title!

Yeah what I meant was that I started it with that intention. I know that running sway or i3 on other distros can have other things necessary that are specific to them. (missing dependencies or repos, for example) However, I too see nothing here that is specific to Ubuntu. :+1:

OK. I understand it now. Thanks for the explanation. :ok_hand:

I replaced the word “I3” with “i3” in the title. The “i3” is the correct name, according to the i3 (window manager) - Wikipedia , Fedora i3 S.I.G. :: Fedora Docs .

1 Like

:crazy_face: whatever floats your boat. To me an I is an i whether it is capitalized or not.

Thanks though!

I’m finding Sway to be excellent, but there are things about i3 I really like and miss. Being able to hide your bar and show it only when pushing a bound key was excellent. Far better than the on / off state that waybar has. BUT apparently this functionality has been merged and we might be seeing it in a repo in a day or two.

1 Like

Are you talking about a bar setting by i3status? Personally I don’t have a need to hide the bar. So, I didn’t notice it. Sway can also use i3status for the bar setting. You meant we might be seeing the hiding feature in the repo of Sway default bar? The Sway default bar might have the feature. (man 5 sway-bar - mode hide', hidden_state hide`)

Sway is great, and the functionality is better than i3. But for the stability, i3 is better than Sway in my experience so far. I saw Firefox on Sway crashed when adding a bookmark. Alacritty still doesn’t work with a language input engine fcitx5 in my use of Japanese input.

By the way, as I finished the Sway, i3 settings on Framework for now, I would share the config files related to Sway, i3, Alacritty and Termnator on the following GitHub repository. It might be useful for someone to try it on Framework Laptop.

2 Likes

I just wanted to share the scaling and font size setting on Sway, and applications’ font size.

Sway

.config/sway/config

font pango:monospace 11
...
output eDP-1 scale 1.2

Font size

  • Firefox: DejaVu Serif: 22

  • Alacritty:

    font:
      size: 12
    
1 Like

So where are you specifically putting these settings? Still in the sway config file?

1 Like