You can support us by downloading this article as PDF from the Link below. Download the guide as PDF

Sway is a tiling Wayland compositor that’s fully compatible with an existing i3 configuration. It makes it easy to replace i3 and use Wayland as the display protocol. I’ve been using Sway since I switched my Linux distribution from Arch Linux to Fedora Silverblue. In this guide, we’ll discuss how you can install and configure Sway tiling Window manager on Fedora.

Add required repositories before you get started. Create a new file.

sudo vim /etc/yum.repos.d/sway-deps.repo

Add below copr repositories.

[copr:copr.fedorainfracloud.org:alebastr:waybar]
name=Copr repo for waybar owned by alebastr
baseurl=https://copr-be.cloud.fedoraproject.org/results/alebastr/waybar/fedora-$releasever-$basearch/
type=rpm-md
skip_if_unavailable=True
gpgcheck=1
gpgkey=https://copr-be.cloud.fedoraproject.org/results/alebastr/waybar/pubkey.gpg
repo_gpgcheck=0
enabled=1
enabled_metadata=1

[copr:copr.fedorainfracloud.org:skidnik:termite]
name=Copr repo for termite owned by skidnik
baseurl=https://copr-be.cloud.fedoraproject.org/results/skidnik/termite/fedora-$releasever-$basearch/
type=rpm-md
skip_if_unavailable=True
gpgcheck=1
gpgkey=https://copr-be.cloud.fedoraproject.org/results/skidnik/termite/pubkey.gpg
repo_gpgcheck=0
enabled=1
enabled_metadata=1

[copr:copr.fedorainfracloud.org:evana:fira-code-fonts]
name=Copr repo for fira-code-fonts owned by evana
baseurl=https://copr-be.cloud.fedoraproject.org/results/evana/fira-code-fonts/fedora-$releasever-$basearch/
type=rpm-md
skip_if_unavailable=True
gpgcheck=1
gpgkey=https://copr-be.cloud.fedoraproject.org/results/evana/fira-code-fonts/pubkey.gpg
repo_gpgcheck=0
enabled=1
enabled_metadata=1

Install Sway Tiling Window on Fedora

Sway is available in many Linux distributions official upstream repositories. In Fedora, the package is called “sway” – both Fedora Workstation and Silverblue.

--- Fedora Workstation ---
$ sudo dnf -y install sway

--- Fedora Silverblue ---
$ rpm-ostree install sway

Install Sway operation dependencies

We also need to install a number of packages that will ensure we have a complete tiling window management experience in our Fedora Desktop. Some of the packages used in i3 have replacements for sway.

These are the tools that we’ll use:

  • wl-clipboard: Command-line copy/paste utilities for Wayland.
  • Waybar: Highly customizable Wayland bar for Sway and Wlroots based compositors.
  • miko – A lightweight Wayland notification daemon
  • light – A program to control backlights (and other hardware lights) in GNU/Linux
  • mpd (Music Player Daemon) – A daemon for playing music of various format.
  • mpv – free (as in freedom) media player for the command line
  • ncmpcpp – Featureful ncurses based MPD client inspired by ncmpc
  • pavucontrol (PulseAudio Volume Control) – Simple GTK based volume control tool (“mixer”) for the PulseAudio sound server.
  • Ranger – A VIM-inspired file manager for the console
  • Rofi – A window switcher, application launcher and dmenu replacement
  • swaylock – Screen locker for Wayland
  • termite – A keyboard-centric VTE-based terminal, aimed at use within a window manager with tiling and/or tabbing support.
  • Powerline fonts – Patched fonts for Powerline users.
  • maim – (Make Image) is a utility that takes screenshots of your desktop. It’s meant to overcome shortcomings of scrot and performs better in several ways.
  • nnn – A full-featured terminal file manager. It’s tiny and nearly 0-config with an incredible performance.
  • grim – Tool for Grabbing images from a Wayland compositor.
  • slurp – Select a region in a Wayland compositor and print it to the standard output. Works well with grim.

Install these standard packages that will be used with sway.

sudo dnf -y install feh \
fira-code-fonts \
fontawesome-fonts \
powerline-fonts \
light \
mako \
ncmpcpp \
pavucontrol \
ranger \
rofi \
swaylock \
termite \
waybar \
wl-clipboard \
mpc \
mpd \
mpv \
grim \
slurp

For Silverblue, replace sudo dnf -y with rpm-ostree.

rpm-ostree install --idempotent feh \
fira-code-fonts \
fontawesome-fonts \
powerline-fonts \
light \
mako \
ncmpcpp \
pavucontrol \
ranger \
rofi \
swaylock \
termite \
waybar \
wl-clipboard \
mpc \
mpd \
mpv \
grim \
slurp

Configure Sway Window Manager

If you have an existing i3wm configuration file, you can port it to Sway. Copy your i3 configuration to ~/.config/sway/config.

The default configuration path for sway is ~/.config/sway/config. If the file doesn’t exist, sway will check the configuration added by installer, which is /etc/sway/config.

Here is my configuration file for sway located in ~/.config/sway/config.

# //computingforgeeks.com/
# Please see https://github.com/swaywm/sway/wiki for a complete reference!
#

set $mod Mod4
set $mod1 Mod1

# Set your terminal
set $terminal termite

# i3-gaps
# for_window [class="^.*"] border pixel 0
gaps inner 4
gaps outer 4
smart_gaps on
default_border pixel 1
#smart_borders on
#set $borderwidth 1
hide_edge_borders both

set $gnome-schema org.gnome.desktop.interface
# exec_always gsettings set $gnome-schema gtk-theme 'Arc-Dark'
# Set colors
set $bg-color            #333333
set $inactive-bg-color   #333333
set $text-color          #f3f4f5
set $inactive-text-color #676E7D
set $urgent-bg-color     #E53935
set $focus-text-color    #87CEEB

set $black       #282828
set $darkblack   #1d2021
set $transparent #000000AA

# Font for window titles. Will also be used by the bar unless a different font
# is used in the bar {} block below.

# This font is widely installed, provides lots of unicode glyphs, right-to-left
# text rendering and scalability on retina/hidpi displays (thanks to pango).

font pango: Inconsolata 12

# Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod

# start a terminal
bindsym $mod+Return exec $terminal
bindsym $mod+x exec $terminal

# Custom bindsyms
bindsym $mod+p exec ~/.config/i3/bin/logout
bindsym $mod+Shift+x exec ~/.config/i3/bin/screen

# kill focused window
bindsym $mod+q kill

# start dmenu (a program launcher)

bindsym $mod+d exec --no-startup-id rofi -show run  -m -1 

# change focus
bindsym $mod+j focus left
bindsym $mod+k focus down

# bindsym $mod+l focus up
bindsym $mod+semicolon focus right

# alternatively, you can use the cursor keys:
bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus right

# move focused window
bindsym $mod+Shift+j move left
bindsym $mod+Shift+k move down
bindsym $mod+Shift+l move up
bindsym $mod+Shift+semicolon move right

# alternatively, you can use the cursor keys:
bindsym $mod+Shift+Left move left
bindsym $mod+Shift+Down move down
bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right

# split in horizontal orientation
bindsym $mod+h split h

# split in vertical orientation
bindsym $mod+v split v

# enter fullscreen mode for the focused container
bindsym $mod+f fullscreen toggle

# change container layout (stacked, tabbed, toggle split)
bindsym $mod+s layout stacking
#bindsym $mod+w layout tabbed
bindsym $mod+t layout tabbed
bindsym $mod+e layout toggle split

# toggle tiling / floating
bindsym $mod+Shift+space floating toggle

# change focus between tiling / floating windows
bindsym $mod+space focus mode_toggle

# focus the parent container
bindsym $mod+a focus parent

# focus the child container
#bindsym $mod+d focus child

# Workspace Variables

set $ws1 "1:   "
set $ws2 "2:   "
set $ws3 "3:   "
set $ws4 "4:   "
set $ws5 "5:   "
set $ws6 "6:   "
set $ws7 "7: " "


# switch to workspace
bindsym $mod+1 workspace $ws1
bindsym $mod+2 workspace $ws2
bindsym $mod+3 workspace $ws3
bindsym $mod+4 workspace $ws4
bindsym $mod+5 workspace $ws5
bindsym $mod+6 workspace $ws6
bindsym $mod+7 workspace $ws7
bindsym $mod+8 workspace $ws8
bindsym $mod+9 workspace 9
bindsym $mod+0 workspace 10

# move focused container to workspace
bindsym $mod+Shift+1 move container to workspace $ws1
bindsym $mod+Shift+2 move container to workspace $ws2
bindsym $mod+Shift+3 move container to workspace $ws3
bindsym $mod+Shift+4 move container to workspace $ws4
bindsym $mod+Shift+5 move container to workspace $ws5
bindsym $mod+Shift+6 move container to workspace $ws6
bindsym $mod+Shift+7 move container to workspace $ws7
bindsym $mod+Shift+8 move container to workspace 8
bindsym $mod+Shift+9 move container to workspace 9
bindsym $mod+Shift+0 move container to workspace 10

# reload the configuration file
bindsym $mod+Shift+c reload

# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
bindsym $mod+Shift+r restart

# Exit sway (logs you out of your X session)
bindsym $mod+Shift+e exec swaynag -t warning -m 'Do you really want to exit sway' -b 'Yes, exit sway' 'swaymsg exit'

# Hibernate
bindsym $mod+Shift+z exec swaynag -t warning -m 'Sleepy time?!?!' -b 'ZzZz...' 'systemctl hibernate'

# resize window (you can also use the mouse for that)
mode "resize" {
        bindsym j resize shrink width 10 px or 10 ppt
        bindsym k resize grow height 10 px or 10 ppt
        bindsym l resize shrink height 10 px or 10 ppt
        bindsym semicolon resize grow width 10 px or 10 ppt

        # same bindings, but for the arrow keys
        bindsym Left resize shrink width 10 px or 10 ppt
        bindsym Up resize grow height 10 px or 10 ppt
        bindsym Down resize shrink height 10 px or 10 ppt
        bindsym Right resize grow width 10 px or 10 ppt

        # back to normal: Enter or Escape
        bindsym Return mode "default"
        bindsym Escape mode "default"
}

bindsym $mod+r mode "resize"
bindsym $mod+Shift+f exec ~/.config/i3/bin/rofi_finder

# Custom bind keys

bindsym $mod+l exec swaylock -i ~/Pictures/wallpaper-04.png 

# Start i3bar to display a workspace bar (plus the system information i3status
# finds out, if available)


# Pulse Audio controls
# run pactl list sinks

bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume $(pacmd list-sinks |awk '/* index:/{print $3}') +5% # Raise
bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume $(pacmd list-sinks |awk '/* index:/{print $3}') -5% # Lower
bindsym XF86AudioMute exec pactl set-sink-mute  $(pacmd list-sinks |awk '/* index:/{print $3}') toggle # Mute

# Sreen brightness controls -- # https://github.com/haikarainen/light
bindsym XF86MonBrightnessUp exec light -A 5    # increase screen brightness
bindsym XF86MonBrightnessDown exec light -U 5  # decrease screen brightness

# multimedia keys
bindsym XF86AudioPlay  exec "mpc toggle"
bindsym XF86AudioStop  exec "mpc stop"
bindsym XF86AudioNext  exec "mpc next"
bindsym XF86AudioPrev  exec "mpc prev"
bindsym XF86AudioPause exec "mpc pause"


bar {
  swaybar_command waybar
  workspace_buttons yes
}

# Startup programs
exec --no-startup-id mpd  

exec_always feh --bg-scale ~/Pictures/bestFriend-wallpaper-07-1920x1200.png
exec --no-startup-id /usr/lib/gsd-xsettings

# Bind App to workspace
# Check class by : xprop
# swaymsg -t get_tree
assign [class="Google-chrome"] $ws2
assign [class="KeePass2"] $ws3
assign [class="Pcmanfm"] $ws4
assign [class="Firefox"] $ws6
assign [class="Remmina"] $ws3
assign [class="Skype"] $ws7

# Custom Keybinds
bindsym $mod+c exec google-chrome-stable

# Press $mod+o followed by either f, t, Esc or Return to launch firefox,
# thunderbird or return to the default mode, respectively.
set $mode_launcher Launcher
bindsym $mod+o mode "$mode_launcher"

mode "$mode_launcher" {
    bindsym m exec terminator
    bindsym n exec nautilus
    bindsym v exec virt-manager 
    bindsym d exec deepin-screenshot 
    bindsym Return mode "default"
}

# Shutdown, Reboot, Lock Screen, and Logout 

set $power_mode "power"
bindsym $mod+Shift+q      mode $power_mode
mode $power_mode {
    bindsym p         exec systemctl poweroff
    bindsym r         exec systemctl reboot 
    bindsym l         exec swaylock -i ~/Pictures/wallpaper-04.png , mode "default"
    bindsym q         exec --no-startup-id i3-msg exit, mode "default"
    bindsym h         exec systemctl hibernate 
    #bindsym s        exec sudo  /lib/systemd/systemd-sleep hybrid-sleep 
    bindsym s         exec pm-suspend

    bindsym Return    mode "default"
    bindsym Escape    mode "default"
}

# Floating windows

for_window [window_role="pop-up"] floating enable
for_window [window_role="bubble"] floating enable
for_window [window_role="task_dialog"] floating enable
for_window [window_role="Preferences"] floating enable

for_window [window_role="task_dialog|bubble|page-info|Preferences|pop-up"] floating enable
for_window [window_role="Open Files"] floating enable sticky
for_window [window_role="File Operation Progress"] floating enable sticky
for_window [window_role="Save As"] floating enable

for_window [class="qBittorrent" window_role="pop-up"] floating enable
for_window [class="mtp-ng-qt" window_role="Open"] floating enable
for_window [window_type="dialog"] floating enable
for_window [window_type="menu"] floating enable
#for_window [class="VirtualBox"] floating enable

# Sticky window
for_window [instance="file_progress"]  sticky enable
for_window [class="info|Mate-color-select|gcolor2|timesup|QtPass|GtkFileChooserDialog"] sticky enable

# Teamviewer
for_window [instance="TeamViewer.exe"] floating enable
for_window [class="TeamViewer"] floating enable
#for_window [instance="Qt-subapplication" title="TeamViewer"] move scratchpad

# Focus window settings
no_focus [window_role="pop-up"]
focus_on_window_activation focus 
#for_window [class="(?i)"] focus 

# Rename workspace with i3-input using numbers and text

bindsym $mod+n exec i3-input -F 'rename workspace to "%s"' -P 'New name for this workspace: '

for_window [class="chromium" instance="chromium"] border none


# screenshot
bindsym --release Print exec --no-startup-id "maim -p 0 -c 0.96,0.5,0.09 $HOME/Pictures/screenshot-$(date +%Y-%m-%d_%H-%M-%S).png"
bindsym --release Shift+Print exec --no-startup-id "maim -s -p 0 -c 0.96,0.5,0.09 $HOME/Pictures/screenshot-$(date +%Y-%m-%d_%H-%M-%S).png"

# Configure outputs here
# How to get outputs configurable - $ swaymsg -t get_outputs
output eDP-1 {
                background ~/Pictures/bestFriend-wallpaper-07-1920x1200.png fill
                resolution 1920x1080
		scale 1.4
           }

# Inputs - Get your inputs with the command:
# swaymsg -t get_inputs
input 1267:35:Elan_Touchpad {
    tap enabled
    natural_scroll enabled
}

Configure Waybar

I recommend you visit Configuration and Styling wiki page for complete details on configuration and available modules.

Valid directories for Waybar configuration file are:

  • ~/.config/waybar/
  • ~/waybar/
  • /etc/xdg/waybar/

Put your Waybar configuration under ~/.config/waybar/config. Here is my configuration file. You’ll have to create yours or customize someone’s to work for you.

{
    "layer": "bottom",
    "position": "top",
    "height": 30,
    "modules-left": ["sway/workspaces", "sway/mode"],
    "modules-center": ["mpd", "custom/storage-root", "custom/storage-home"],
    "modules-right": ["memory", "cpu", "network", "pulseaudio", "battery", "backlight", "custom/time", "clock"],

    "sway/mode": {
        "format": " {}"
    },
    "sway/workspaces": {
        "format": "{name}",
        "disable-scroll-wraparound": true,
        "enable-bar-scroll": true,
        "smooth-scrolling-threshold": 30
    },
    "sway/window": {
        "max-length": 80,
        "tooltip": false
    },
    "mpd": {
        //"format": "{stateIcon} {consumeIcon}{randomIcon}{repeatIcon}{singleIcon}{artist} - {album} - {title} ({elapsedTime:%M:%S}/{totalTime:%M:%S})  ",
        "format": "{stateIcon} {consumeIcon}",
        "format-disconnected": "Disconnected",
        "format-stopped": "{consumeIcon}{randomIcon}{repeatIcon}{singleIcon}Stopped ",
        "unknown-tag": "N/A",
        "interval": 2,
        "consume-icons": {
            "on": " "
        },
        "random-icons": {
            "off": "<span color=\"#f53c3c\"></span> ",
            "on": " "
        },
        "repeat-icons": {
            "on": " "
        },
        "single-icons": {
            "on": "1 "
        },
        "state-icons": {
            "paused": "",
            "playing": ""
        },
        "tooltip-format": "MPD (connected)",
        "tooltip-format-disconnected": "MPD (disconnected)"
    },

    "clock": {
        //"format": "{:%d.%m.%y %a / W: %V}",
        "format": "{:%d.%m.%y %a}",
        "tooltip": false
    },
    "battery": {
        "format": "{icon} {capacity}%",
        "format-icons": ["", "", "", "", ""],
        "format-charging": " {capacity}%",
        "interval": 30,
        "states": {
            "warning": 25,
            "critical": 10
        },
        "tooltip": false
    },
    "pulseaudio": {
        "format": "{volume} {icon}",
        "format-alt": "{volume} {icon}",
        "format-alt-click": "click-right",
        "format-muted": "",
        "format-icons": {
            "headphones": "",
            "handsfree": "",
            "headset": "",
            "phone": "",
            "portable": "",
            "car": "",
            "default": ["", "", ""]
        },
        "scroll-step": 5,
        "on-click": "pavucontrol",
        "tooltip": false
    },
    "custom/storage-root": {
        "format": " {}",
        "format-alt": " {percentage}%",
        "format-alt-click": "click-right",
        "return-type": "json",
        "interval": 60,
        "exec": "~/.config/waybar/modules/storage-root.sh"
    },
    "custom/storage-home": {
        "format": " {}",
        "format-alt": " {percentage}%",
        "format-alt-click": "click-right",
        "return-type": "json",
        "interval": 60,
        "exec": "~/.config/waybar/modules/storage-home.sh",
        "on-click": "ranger"
    },
    "backlight": {
        "format": "{icon} {percent}%",
        "format-alt-click": "click-right",
        //"format-icons": ["", ""],
        //"format-icons": ["", ""],
        "format-icons": ["", ""],
        "on-scroll-down": "light -A 1",
        "on-scroll-up": "light -U 1"
    },
    "custom/time": {
        "format": " {}",
        "interval": 5,
        "return-type": "json",
        "exec": "~/.config/waybar/modules/time.sh"
    },
    "tray": {
        "icon-size": 18
    },
    "cpu": {
        "tooltip": false,
        "format": " {}%"
    },
    "memory": {
        "tooltip": false,
        "format": " {}%"
        // "format": "{used} / {total}  "
    },
    "network": {
        "format-wifi": " {essid} ({signalStrength}%)",
        "format-ethernet": " {ifname}: {ipaddr}/{cidr}",
        "format-linked": " {ifname} (No IP)",
        "format-disconnected": "Disconnected ⚠",
        "format-alt": "{ifname}: {ipaddr}/{cidr}"
    }
}

My style.css file.

* {
    border:        none;
    border-radius: 0;
    font-family:   Inconsolata;
    font-size:     17px;
    font-weight:     bold;
    box-shadow:    none;
    text-shadow:   none;
    transition-duration: 0s;
}

window {
    color:      rgba(217, 216, 216, 1);
    background: rgba(1, 1, 1, 0.40);
}

window#waybar.solo {
    background: rgba(1, 1, 1, 0.40);
}

#workspaces {
    border-radius: 10px;
    background: rgba(40, 42, 54, 0.85);
    transition: none;
}

#workspaces button {
    transition: none;
    color:      rgba(217, 216, 216, 0.4);
    background: transparent;
}

#workspaces button.visible {
    color:      rgba(217, 216, 216, 1);
}

#workspaces button.focused {
    border-top: 3px solid #9aedfe;
    color: #9aedfe;
}

#workspaces button:hover {
    border-top: 3px solid #ff79c6;
    transition: none;
    box-shadow: inherit;
    text-shadow: inherit;
    color: #ff79c6;
}

#workspaces button.urgent {
    color:      rgba(238, 46, 36, 1);
}

#mode, #battery, #cpu, #memory, #network, #pulseaudio, #idle_inhibitor, #backlight, #custom-storage, #custom-spotify, #custom-weather, #custom-mail {
    margin:     0px 6px 0px 5px;
    min-width:  25px;
}

#clock {
    margin-left: 2px;
    margin-right: 2px;
    padding-left: 5px;
    padding-right: 5px;
    border-radius: 10px;
    transition: none;
    color: #4d4d4d;
    background: rgba(107, 142, 35, 0.85);
}

#custom-notif {
    margin-left: 2px;
    margin-right: 2px;
    padding-left: 5px;
    padding-right: 5px;
    border-radius: 10px;
    transition: none;
    color: #4d4d4d;
    background: rgb(238,130,238);
}

#backlight {
    margin-left: 2px;
    margin-right: 2px;
    padding-left: 5px;
    padding-right: 5px;
    border-radius: 10px;
    transition: none;
    color: #4d4d4d;
    background: rgba(188, 143, 143, 0.85);
}

#battery.warning {
   color:       rgba(255, 210, 4, 1);
}

#battery.critical {
    color:      rgba(238, 46, 36, 1);
}

#battery.charging {
    color:      rgba(217, 216, 216, 1);
}

#custom-tidepool {
    margin-left: 2px;
    margin-right: 2px;
    padding-left: 5px;
    padding-right: 5px;
    border-radius: 10px;
    transition: none;
    color: #4d4d4d;
}

#custom-tidepool.red {
    background: rgba(205, 92, 92, 0.85);
}

#custom-tidepool.orange {
    background: rgba(243, 156, 18, 0.85);
}

#custom-tidepool.yellow {
    background: rgba(252, 214, 112, 0.85);
}

#custom-tidepool.green {
    background: rgba(154, 205, 50, 0.85);
}

#custom-time {
    margin-left: 2px;
    margin-right: 2px;
    padding-left: 5px;
    padding-right: 5px;
    border-radius: 10px;
    transition: none;
    color: #4d4d4d;
    background: rgba(154, 205, 50, 0.85);
}

#custom-weather {
    margin-left: 2px;
    margin-right: 2px;
    padding-left: 5px;
    padding-right: 5px;
    border-radius: 10px;
    transition: none;
    color: #4d4d4d;
    background: rgba(218, 112, 214, 0.85);
}

#custom-unsync {
    margin-left: 2px;
    margin-right: 2px;
    padding-left: 5px;
    padding-right: 5px;
    border-radius: 10px;
    transition: none;
    color: #4d4d4d;
    background: rgba(154, 237, 254, 0.85);
}

#custom-storage-home {
    margin-left: 2px;
    margin-right: 2px;
    padding-left: 5px;
    padding-right: 5px;
    border-radius: 10px;
    transition: none;
    color: #4d4d4d;
    background: rgba(154, 237, 254, 0.85);
}

#custom-storage-root {
    margin-left: 2px;
    margin-right: 2px;
    padding-left: 5px;
    padding-right: 5px;
    border-radius: 10px;
    transition: none;
    color: #4d4d4d;
    background: rgba(154, 237, 254, 0.85);
}

#custom-snapcount {
    margin-left: 2px;
    margin-right: 2px;
    padding-left: 5px;
    padding-right: 5px;
    border-radius: 10px;
    transition: none;
    color: #4d4d4d;
    background: rgba(154, 237, 254, 0.85);
}

#pulseaudio {
    margin-left: 2px;
    margin-right: 2px;
    padding-left: 5px;
    padding-right: 5px;
    border-radius: 10px;
    transition: none;
    color: #4d4d4d;
    background: rgba(189, 183, 107, 0.85);
}

#network {
    margin-left: 2px;
    margin-right: 2px;
    padding-left: 5px;
    padding-right: 5px;
    border-radius: 10px;
    transition: none;
    color: #4d4d4d;
    background: rgba(189, 183, 107, 0.85);
}

#cpu {
    margin-left: 2px;
    margin-right: 2px;
    padding-left: 5px;
    padding-right: 5px;
    border-radius: 10px;
    transition: none;
    color: #4d4d4d;
    background: rgba(205, 92, 92, 0.85);
}

#battery {
    margin-left: 2px;
    margin-right: 2px;
    padding-left: 5px;
    padding-right: 5px;
    border-radius: 10px;
    transition: none;
    color: #4d4d4d;
    background: rgba(176, 196, 222, 0.85);
}

#memory {
    margin-left: 2px;
    margin-right: 2px;
    padding-left: 5px;
    padding-right: 5px;
    border-radius: 10px;
    transition: none;
    color: #4d4d4d;
    background: rgba(222, 184, 135, 0.85);
}

#mpd {
    margin-left: 2px;
    margin-right: 2px;
    padding-left: 5px;
    padding-right: 5px;
    border-radius: 10px;
    transition: none;
    color: #4d4d4d;
    background: rgba(119, 136, 153, 0.85);
}

#custom-storage.warning {
    color:      rgba(255, 210, 4, 1);
}

#custom-storage.critical {
    color:      rgba(238, 46, 36, 1);
}

Used modules:

  • ~/.config/waybar/modules/storage-home.sh
#!/bin/sh

mount="/var/home"
warning=20
critical=10

df -h -P -l "$mount" | awk -v warning=$warning -v critical=$critical '
/\/.*/ {
  text=$4
  tooltip="Filesystem: "$1"\rSize: "$2"\rUsed: "$3"\rAvail: "$4"\rUse%: "$5"\rMounted on: "$6
  use=$5
  exit 0
}
END {
  class=""
  gsub(/%$/,"",use)
  if ((100 - use) < critical) {
    class="critical"
  } else if ((100 - use) < warning) {
    class="warning"
  }
  print "{\"text\":\""text"\", \"percentage\":"use",\"tooltip\":\""tooltip"\", \"class\":\""class"\"}"
}
'
  • ~/.config/waybar/modules/storage-root.sh
#!/bin/sh

mount="/"
warning=20
critical=10

df -h -P -l "$mount" | awk -v warning=$warning -v critical=$critical '
/\/.*/ {
  text=$4
  tooltip="Filesystem: "$1"\rSize: "$2"\rUsed: "$3"\rAvail: "$4"\rUse%: "$5"\rMounted on: "$6
  use=$5
  exit 0
}
END {
  class=""
  gsub(/%$/,"",use)
  if ((100 - use) < critical) {
    class="critical"
  } else if ((100 - use) < warning) {
    class="warning"
  }
  print "{\"text\":\""text"\", \"percentage\":"use",\"tooltip\":\""tooltip"\", \"class\":\""class"\"}"
}
'
  • ~/.config/waybar/modules/time.sh
#!/bin/bash
timez=$(date +%H:%M:%S)
echo -e "{\"text\":\""$timez"\"}"

Configure Login manager

Some login managers support Wayland, and others don’t. If you have issues starting sway and you use a login manager, your first step should be disabling the login manager and running sway as described by man 1 sway. If it works, report the bug to your login manager, not to sway.

You can start sway automatically without a login manager, for example, by adding this to your .bash_profile:

# If running from tty1 start sway
if [ "$(tty)" = "/dev/tty1" ]; then
	exec sway
fi

Once you have everything configured, logout and back in to enjoy using Sway and Waybar on Fedora. These configurations are not tied to Fedora distro only, With dependencies installed on any other Linux distribution, the configs will work just fine.

More guides:

Configure i3pystatus on Linux

How To Install Polybar Status bar on Fedora

How To Copy and Paste Text Content from Linux Terminal

How To Connect To Bluetooth Device from Linux Terminal

How To Google Search from a Linux Terminal

Best Console / Terminal File Managers for Linux

You can support us by downloading this article as PDF from the Link below. Download the guide as PDF