Setting up Sway Tiling Window Manager on Fedora with Waybar

Sway is a tiled Wayland synthesizer that is fully compatible with existing i3 configurations. It makes it easy to replace i3 and use Wayland as the display protocol. I have been using Sway since switching the Linux distribution from Arch Linux to Fedora Silverblue. In this guide, we will discuss how to install and configure the Sway Tile Window Manager on Fedora.

Before you begin, add the required repositories. Create a new file.

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

Added in the copr repository below.

[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 swing tile windows on Fedora

Sway is available in the official upstream repositories of many Linux distributions. In Fedora, the package is called “swing“– 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 to ensure that we have full tile window management experience in Fedora Desktop. Some software packages used in i3 can replace sway.

These are the tools we will use:

  • wl-clipboard: Wayland’s command line copy / paste utility.
  • Navigation Bar: Highly customizable Wayland bar for Sway and Wroots based synthesizers
  • koko – Lightweight Wayland notification daemon
  • Light -Programs to control backlight (and other hardware lights) in GNU / Linux
  • mpd (music player daemon) -A daemon that plays various formats of music.
  • mpv -Command-line free (same as free) media player
  • ncmpcpp – Powerful ncurses-based MPD client inspired by ncmpc
  • pavucontrol (PulseAudio volume control) – Simple GTK-based volume control tool (“Mixer”) for PulseAudio sound server.
  • Ranger –VIM-inspired console file manager
  • Roffi – Window switcher, application launcher and dmenu replacement
  • Swing lock – Wayland Screen Lock
  • termite – Keyboard-centric VTE-based terminal, designed to be used in a window manager, with tiling and / or tabbing support.
  • Power line font – Patched fonts for powerline users.
  • im – (Make Image) is a utility for taking screenshots of your desktop. Its purpose is to overcome the shortcomings of sc shrinking and perform better in several ways.
  • nn – A full-featured terminal file manager. It’s small with almost zero configuration and has incredible performance.
  • severe -A tool for capturing images from Wayland synthesizers.
  • Murmur – Select a region in the Wayland synthesizer and print it to standard output. Suitable for severe.

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 versus 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 profile, you can port it to Sway. Copy your i3 configuration to ~ / .config / sway / config.

sway’s default configuration path is ~/.config/sway/config. If the file does not exist, sway will check the configuration added by the installer, ie /etc/sway/config.

This is my configuration file on sway, located at ~ / .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 suggest you visit Configuration and style Wiki page with complete details on configuration and available modules.

The valid directories for Waybar configuration files are:

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

Put your Waybar configuration in ~ / .Config / roadbar / config. This is my configuration file. You must create your own or customize someone 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": " ",
            "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}"
    }
}

mine 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, while others do not. if you have
The problem starts to sway and you use the login manager, the first step should be
Disable the login manager and run as described below man 1 sway. If possible, report the error to your login manager instead of setting it as it is.

You can automatically start swinging without a login manager, for example, adding it to your .bash_profile:

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

Once everything is configured, log out and log back in to use Sway and Waybar on Fedora. These configurations are not only tied to Fedora distributions, they can work after installing dependencies on other Linux distributions.

Configure i3pystatus on Linux

How to install Polybar status bar on Fedora

How to copy and paste text content from a Linux terminal

How to connect to a Bluetooth device from a Linux terminal

How to do a Google search from a Linux terminal

The best console / terminal file manager for Linux

Sidebar