Skip to content

Instantly share code, notes, and snippets.

@dmelliot
Last active August 1, 2022 01:22
Show Gist options
  • Star 13 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dmelliot/437924ff581f3f1edd59f44833be6cc6 to your computer and use it in GitHub Desktop.
Save dmelliot/437924ff581f3f1edd59f44833be6cc6 to your computer and use it in GitHub Desktop.
i3wm window icon alternative using FontAwesome (or other icon based fonts)
# Title bar icons
for_window [class="(?i)firefox"] title_format "<tt></tt><span foreground='#FF6611'>  </span><tt> </tt>%title"
for_window [class="(.*)terminal(.*)"] title_format "<tt></tt><span foreground='#00FF00' background='#000000'>  </span><tt> </tt>%title"
for_window [class="(.*)Chromium-browser(.*)"] title_format "<tt></tt><span foreground='#367dd0' background='#d9e5f4'>  </span><tt> </tt>%title"
for_window [class="Evolution"] title_format "<tt></tt><span foreground='#FFFFFF' >  </span><tt> </tt>%title"
for_window [title=".* Evolution"] title_format "<tt></tt><span foreground='#FFFFFF' >  </span><tt> </tt>%title"
for_window [class="Slack"] title_format "<tt></tt><span foreground='#FFFFFF' >  </span><tt> </tt>%title"
for_window [class="Signal"] title_format "<tt></tt><span background='#2090ea' foreground='#FFFFFF' >  </span><tt> </tt>%title"
for_window [class="VirtualBox Machine"] title_format "<tt></tt><span background='#073624' foreground='#AAAAFF' >  </span><tt> </tt>%title"
for_window [class="VirtualBox Manager"] title_format "<tt></tt><span background='#073642' foreground='#AAAAFF' >  </span><tt> </tt>%title"
for_window [class="libreoffice-writer"] title_format "<tt></tt><span background='#073642' foreground='#adc5e7' >  </span><tt> </tt>%title"
for_window [class="libreoffice-calc"] title_format "<tt></tt><span background='#073642' foreground='#add58a' >  </span><tt> </tt>%title"
for_window [class="libreoffice-impress"] title_format "<tt></tt><span background='#073642' foreground='#d07e7e' >  </span><tt> </tt>%title"
@dmelliot
Copy link
Author

dmelliot commented Jan 15, 2019

Example of what this can look like:
image

Colours need to be chosen to suit your theme - I'm running with a variation of dark Solarized.
The above snippet depends on FontAwesome, but is applicable to any icon font.

@webian
Copy link

webian commented Mar 27, 2019

Nice solution... thanks!
I add that icons can be copy/pasted from https://fontawesome.com/cheatsheet

@siikamiika
Copy link

In case anyone doesn't get a solid variant of the envelope icon for email by default, you can set weight='bold' inside the span. Full documentation for the Pango markup here: https://developer.gnome.org/pygtk/stable/pango-markup-language.html

@Harliff
Copy link

Harliff commented Dec 31, 2019

Nice solution. Thanks!

@adam4235
Copy link

adam4235 commented Jun 4, 2020

Great idea. You should also explain how to set this up. This is what I had to do:

  1. Download Font Awesome, the "Free for Desktop" option, from its website

  2. Unzip the zip file

  3. Find the .otf (font) files

  4. Double click each one to open it and click Install in the top right
    (from https://itsfoss.com/install-fonts-ubuntu/)

  5. Add to the i3 config a line like this (from https://stackoverflow.com/questions/32596646/font-awesome-and-i3bar)
    font pango:DejaVu Sans Mono, Awesome 8

  6. Add the for_window lines to the i3 config file.

@ilovepumpkin
Copy link

Nice! Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment