Inspired by this comment, this is a sway config file for adding icons in title bars using Font Awesome and Nerd Fonts Symbols.
Normally, this is very tedidous to do; so to not waste time on a grand scale with everyone manually trying to specifiy an icon for each app, I decided to make this repo as a shortcut for people who are interested.
- Install Font Awesome.
Arch-based:
sudo pacman -S ttf-font-awesome
Debian-based:
sudo apt install fonts-font-awesome
Every other distro: https://fontawesome.com/download
- Install Nerd Fonts Symbols.
Arch-based:
sudo pacman -S ttf-nerd-fonts-symbols
Every other distro: https://github.com/ryanoasis/nerd-fonts/releases
- Clone the repo to
~/.config/sway/
cd ~/.config/sway/
git clone https://github.com/iguanajuice/sway-font-awesome
- Add lines...
# Enable title bar icons
exec cd ~/.config/sway/sway-font-awesome && git reset --hard && git pull
include sway-font-awesome/icons-wl
include sway-font-awesome/icons-x11 # exclude if sway is compiled without xwayland
...to ~/.config/sway/config
- Enable pango in sway's config:
font pango:YourChoiceOfFont [font_size]
If there are any apps that I haven't added an icon for yet; please open an issue with the app_id
or class
of the application that's missing an icon.
You can find the app_id/class by launching the app and running swaymsg -t get_tree
in a terminal.
Please follow these rules:
- Be sure to update icons by relogging in before opening any issues.
- Everything should be sorted alphabetically.
app_id
andclass
entries should stay seperated.- Icon should be from Font Awesome primarily. Use Nerd Fonts Symbols if FA has nothing better.
- Icon should be wrapped in
<span size='100%' font-weight='normal'>
and</span>
tags. - There must be a space between
</span>
and%title
. - Due to a bug in god knows where, the first
<span>
tag must be preceded by a soft-hyphen. You can type this special character by pressing Ctrl+Shift+u, typing "ad", then pressing enter. - If an icon is rendered too small, increase size to 110%, 120%, 133%, or 150%. Icon size should be consistent to one another.
- If an icon is placed too high, use
rise='-1pt'
to lower it.