User Tools

Site Tools



What is it?

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.

Running Sway on Fedora

  • Installation: dnf -y install sway
  • recommends to run sway directly from the TTY. That means to set multi-user target as default target, login there, and run sway from there. You could also in ~/.bashrc check the terminal variables and start sway directly.
# I did a LXDE-desktop installation of Fedora
# removed
rm -f /etc/systemd/system/

# configured to system to run into multi-user by default
cd /etc/systemd/system
ln -s /usr/lib/systemd/system/

# After this, I logged in as normal user at the terminal, and
# executed 'sway'.  Et voila, sway starts.

Configuration and first steps

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 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.

Custom config file

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

Terminal settings

By default, <modkey>+<return> starts an urxvt256c-ml terminal, my customization:

$ grep term ~/.config/sway/config
set $term /home/chris/bin/
$ cat /home/chris/bin/
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:

  • In xterm/wayland/sway, I did not get automatic url-selection to work. So triple-clicking string in xterm did not result in selecting that URL, but the whole line. I had that working with xterm/xorg, but the same configs fail for that purpose on xterm/wayland for me.
  • Increasing/decreasing the font is just great:
    • increasing: <crtl>+<shift>+<=> (makes sense, + is the second function of the =-key)
    • decreasing: <crtl>+<->
$ grep term ~/.config/sway/config
set $term /home/chris/bin/
$ cat /home/chris/bin/

Changing workspace

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'.

Locking the screen

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

Controlling brightness

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.

Internal/external screens

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

Custom statusbar

dnf install -y python3-psutil python3-netiface fontawesome-fonts
cd /opt
git clone git://

# now modify the users ~/.config/sway/config, change
status_command while date +'%Y-%m-%d %l:%M:%S %p'; do sleep 1; done
status_command /opt/bumblebee-status/bumblebee-status \
  -m cpu memory sensors2 network_traffic battery time \
  -p sensors2.showtemp=false sensors2.showcpu=false \
     time.format="%H:%M" memory.format="{used}" \
  -t powerline


Japanese input: ibus

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-san has details. See also, bugzilla.

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' \
# set environment variables, i.e. in ~/.bashrc
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

# Once ibus-daemon is running, one is supposed to execute
# ..but this bails out with "No input_method global" currently.

Japanese input: fcitx

This works for me, but there is no fcitx-mozc package.

dnf -y install 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


grim is not yet packaged..

sudo dnf install -y meson cairo-devel.x86_64 libwayland-client.x86_64 \
  wayland-devel.x86_64 wayland-protocols-devel.noarch \
git clone
cd grim
meson build
ninja -C build

# lets take a screenshot
build/grim myscreenshot.jpg

X11 apps forwarding via SSH

Logging into remote systems using i.e. 'ssh -Y rhel8u2b', and having on the remote system for example xauth and xterm installed, I can run xterm remotely and get it forwarded. $DISPLAY in the session is set to “localhost:10.0”.

Hanging menu

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.

Additional software

My reminder for additional software. All from Fedora or rpmfusion repos.

  • firefox, google-chrome
  • evince - pdf viewer
  • mplayer, qiv - video, picture viewer


  • I did not get ibus to run..
  • Try out if this works for screen sharing: you can enable desktop sharing in conferencing web-based software with xdg-desktop-portal-wlr. Firefox works out of the box, Chromium works too but you need to turn the PipeWire flag on (and if you wanna go completely Wayland-native, launch Chromium with Ozone).
software/sway.txt · Last modified: 2021/03/23 12:22 (external edit)