sway is a tiling window manager, active project, working on Wayland. Just the right thing to try out for me after using Window Maker, which seems to stay on Xorg forever.
# I did a LXDE-desktop installation of Fedora # removed default.target rm -f /etc/systemd/system/default.target # configured to system to run into multi-user by default cd /etc/systemd/system ln -s /usr/lib/systemd/system/multi-user.target default.target reboot # After this, I logged in as normal user at the terminal, and # executed 'sway'. Et voila, sway starts.
After you got sway running, it's time to familiarize yourself with the keyboard shortcuts and modify the configuration. The default config can be seen at https://github.com/swaywm/sway/blob/master/config.in or in file /etc/sway/config . The config file teaches you all shortcuts you need at this moment.
On my thinkpad, the english keyboard layout was configured by default. The $mod-key is the windows-key, which is on Linux not used anyway. Sway uses that key heavily. For the start, you should use the config suggested by Sway, and can then adapt it to your needs.
The default config is /etc/sway/config. If you want to customize, do this:
mkdir ~/.config/sway cp /etc/sway/config ~/.config/sway vi ~/.config/sway
By default, <modkey>+<return> starts an urxvt256c-ml terminal, my customization:
$ grep term ~/.config/sway/config set $term /home/chris/bin/myterm.sh $ cat /home/chris/bin/myterm.sh xterm -en UTF-8 -fg white -bg black -fn \ -Misc-Fixed-Medium-R-Normal--18-120-100-100-C-90-ISO10646-1 +sb -e bash
Alternatively, I try terminal 'terminator' now. The good points over xterm for me:
$ grep term ~/.config/sway/config set $term /home/chris/bin/myterm.sh $ cat /home/chris/bin/myterm.sh terminator
A workspace in Sway is what I called “virtual screen” in Window Maker. Regarding workspaces, I mostly go with the default config from Sway. I just added one detail: $mod+Left changes to the previous workspace, and $mod+Right to the next workspace. By default, one can with $mod+1 jump to the first workspace, with $mod+2 to the second workspace, and so on. So I added this in ~/.config/sway/config:
bindsym Ctrl+Left workspace prev bindsym Ctrl+Right workspace next bindsym Hangul_Hanja+Left workspace prev bindsym Hangul_Hanja+Right workspace next
The last 2 lines are for the “right CTRL key” on this keyboard here which I bought in Korea. When running 'xev' and then pressing the key, one sees the identifier for the key, in my case 'Hangul_Hanja'.
I have a habit of locking the screen when leaving the workplace, by pressing F9. Easy to implement:
# install xlock dnf -y install xlockmore # add the config echo 'bindsym F9 exec /usr/bin/xlock -mode blank' >>~/.config/sway/config # reload config press <modkey> + <Shift> + <c> press F9 for testing
On laptops, package `light` should be installed, and this be added to ~/.config/sway/config:
bindsym $mod+F5 exec light -U 5 bindsym $mod+F6 exec light -A 5
With this, one can press $mod+F5/F6 to control brightness.
Using xrandr is not recommended, but so far the replacements actually look good. I frequently dock/undock my system. When docked, I only want to use an external screen.
# lets look at the names for our outputs swaymsg -t get_outputs Output DP-4 'Dell Inc. DELL U2412M RPT5T2372ADL' (focused) Current mode: 1920x1200 @ 59.950001 Hz [..] Output eDP-1 'Unknown 0x21ED 0x00000000' [..] # In the sway config, I refer to these entries. So I frequently # modify the config, then reload with <modkey>+<Shift>+<c>, and # have the new setup active. # in ~/.config/sway/config, for 'docked'config: output DP-4 enable output eDP-1 disable # in ~/.config/sway/config, for all monitors active: output DP-4 enable output eDP-1 enable
dnf install -y python3-psutil fontawesome-fonts cd /opt git clone git://github.com/tobi-wan-kenobi/bumblebee-status # now modify the users ~/.config/sway/config, change status_command while date +'%Y-%m-%d %l:%M:%S %p'; do sleep 1; done into status_command /opt/bumblebee-status/bumblebee-status \ -m cpu memory battery time pasink pasource sensors2 \ -p sensors2.showtemp=false sensors2.showcpu=false time.format="%H:%M" \ -t powerline
I did not get ibus/sway/wayland to run so far :( Apparently its because sway (a wayland window manager) uses a newer version of the wayland input protocol than ibus-wayland supports. Duck has details
dnf -y install ibus ibus-setup ibus-gtk3 ibus-wayland \ ibus-skk ibus-mozc ibus-kkc ibus-qt # run ibus-daemon at sway startup echo 'exec /usr/bin/ibus-daemon --xim --daemonize' \ >>~/.config/sway/config # set environment variables, i.e. in ~/.bashrc export IMSETTINGS_INTEGRATE_DESKTOP=yes export IMSETTINGS_MODULE=ibus export QT_IM_MODULE=ibus export XMODIFIERS=@im=ibus export GTK_IM_MODULE=ibus # then exit sway with <modkey>+<Shift>+<e> # and start sway again, then ibus-setup # Once ibus-daemon is running, one is supposed to execute /usr/libexec/ibus-wayland # ..but this bails out with "No input_method global" currently.
This works for me, but there is no fcitx-mozc package.
dnf -y fcitx fcitx-qt4 fcitx-qt5 fcitx-ui-light fcitx-anthy \ fcitx-gtk3 fcitx-gtk2 fcitx-table-extra fcitx-table-other \ fcitx-kkc fcitx-skk fcitx-configtool # run fcitx at sway startup echo 'exec fcitx -d' >>~/.config/sway/config # set environment variables, i.e. in ~/.bashrc export GTK_IM_MODULE=fcitx export QT_IM_MODULE=fcitx export XMODIFIERS=@im=fcitx # then exit sway with <modkey>+<Shift>+<e> # and start sway again, then imsettings-switch fcitx fcitx-configtool
I have experienced haning menus: so after pressing $mod + D, the menu for running applications stays and can not be removed. In that case, “killall dmenu” removed the menu, and $mod + Shift + c can reload the normal top bar.
My reminder for additional software. All from Fedora or rpmfusion repos.