Thanks to Windows 11 giving me some some issues, I decided it was time to move back to Ubuntu LTS. Thank to @lightrush and his handy salt script I was able to get up and running in NO time. That is until I decided to give i3 and Sway a shot.
After getting them both configured I have to say that I love tiling managers. Installing them on top of Ubuntu is also great, because you have the flexibility to switch between them and use Gnome as well.
Sway works smoother and seems to use less resources, but i3 runs perfectly as well.
Getting i3 to lock automatically when suspending (via the lid switch) or hibernating is still a work in progress.
I’m also trying to figure out how to map the brightness function keys to a keybinding in either i3 or sway. It will be reliant on brightnessctl. I’d like to get all of the keyboard shortcuts working (transport controls for media, etc.) as well, but that isn’t crucial.
Any of our tiling manger professionals have some tips after getting it all set up on your Framework?
You can determine what the symbols are by running xev (or wev) and pressing the key. For example (I’m typing from my desktop, so I’ll use the media keys here), if I run wev and press the key that has a ‘stop’ icon on it (in this keyboard, that’s Fn+F10), I see that wev reports that the sym for that key is XF86AudioStop.
Once you obtain that sym, you can put something like bind XF86AudioStop exec mpc stop in your sway/i3 config and it should “just work”.
If you want, I’ll edit this post when I open up my Framework later and put the exact lines I have in my sway config for brightness and media keys.
Any chance you are an expert at i3 xss-lock i3locking when the lid switch or hibernation take place? I got it working but with a white background. I’d like to set it black or use an image, but everytime I add those options in sway config is doesn’t work. It is always just a white background.
Thanks a ton for this! If I wasn’t having Workstation 3d acceleration issues I would probably not even be messing with i3. Very happy with Sway and Waybar.
Sorry, I actually went from using awesome on X11 to using sway on Wayland since there wasn’t a real Wayland version/successor of awesome. Also, presumably you’d use swaylock with sway (not xss-lock and i3lock?), but that was probably a typo (the default sway config over at /etc/sway/config contains a snippet to automatically deal with screenlocking using swaylock).
No problem! I’m still somewhat new to sway and Wayland more generally, even if I’m pretty used to tiling WMs at this point (I’ve been using awesome for several years at this point).
Yeah, thank you! swaylock work SOOO much better than i3lock. It is basically un-comment a couple lines and it just works. So much easier, especially getting a specific image to be shown instead of just a color background.
But there is something about i3, that I also really like. I can’t put my finger on it. Maybe it is just the fact that Putty and VMware Workstation just work.
Personally, I setup a config file (in ~/.config/swaylock/config) so that I don’t have to edit the multiple places I have swaylock invocations in my sway config (I setup a keybinding to manually lock the screen i.e. bindsym $mod+l exec 'LANG=en_US.UTF8 swaylock' — the LANG=en_US.UTF8 is because my actual locale isn’t English, but swaylock isn’t localized so it just ends up not being able to display its messages ).
Yeah, I do the Mod + L for manual lock as well. What I meant by easier is that it is easier to configure. I was able to add a background to the lockscreen and set it to trigger from suspend and hibernate, with very little effort.
i3lock, by comparison, is still not working properly, and I can’t figure out why. I’ve got services files written in /etc/systemd/system etc, but no dice.
My last hurdle to using Sway in the long term is figuring out how to get Putty (which is dependent on X for tunneling) to work on Wayland.
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
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.
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.
# 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.
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
bindsym Print exec gnome-screenshot -i
# Framework Laptop F12: XF86AudioMedia
bindsym XF86AudioMedia exec firefox https://community.frame.work/
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.