sway: Icons icons icons

This commit is contained in:
Sijmen 2020-09-09 15:59:06 +02:00
parent 9fb763c613
commit 8dc467b41b
Signed by: vijfhoek
GPG key ID: DAF7821E067D9C48

View file

@ -21,29 +21,31 @@ import re
# (WM_CLASS) names and the icons can be any text you want to display. However # (WM_CLASS) names and the icons can be any text you want to display. However
# most of these are character codes for font awesome: # most of these are character codes for font awesome:
# http://fortawesome.github.io/Font-Awesome/icons/ # http://fortawesome.github.io/Font-Awesome/icons/
FA_BEZIER_CURVE = "\uF55B"
FA_BOOK = "\uF02D"
FA_CALENDAR = "\uF133"
FA_CHROME = "\uF268" FA_CHROME = "\uF268"
FA_CODE = "\uF121" FA_CODE = "\uF121"
FA_CODE_BRANCH = "\uF126" FA_CODE_BRANCH = "\uF126"
FA_COMMENT_ALT = "\uF27A"
FA_CUBE = "\uF1B2"
FA_DISCORD = "\uF392" FA_DISCORD = "\uF392"
FA_DOWNLOAD = "\uF019" FA_DOWNLOAD = "\uF019"
FA_ENVELOPE = "\uF0E0"
FA_FILE_PDF_O = "\uF1C1" FA_FILE_PDF_O = "\uF1C1"
FA_FILE_TEXT_O = "\uF0F6" FA_FILE_TEXT_O = "\uF0F6"
FA_FILES_O = "\uF0C5" FA_FILES_O = "\uF0C5"
FA_FIREFOX = "\uF269" FA_FIREFOX = "\uF269"
FA_FOLDER = "\uF07C"
FA_GAMEPAD = "\uF11B"
FA_PAINT_BRUSH = "\uF1FC"
FA_PICTURE_O = "\uF03E" FA_PICTURE_O = "\uF03E"
FA_SPOTIFY = "\uF1BC" FA_SPOTIFY = "\uF1BC"
FA_TERMINAL = "\uF120" FA_STEAM = "\uF1B6"
FA_TELEGRAM = "\uF3FE" FA_TELEGRAM = "\uF3FE"
FA_CUBE = "\uF1B2" FA_TERMINAL = "\uF120"
FA_PAINT_BRUSH = "\uF1FC"
FA_BOOK = "\uF02D"
FA_FOLDER = "\uF07C"
FA_CALENDAR = "\uF133"
FA_BEZIER_CURVE = "\uF55B"
FA_VECTOR_SQUARE = "\uF5CB" FA_VECTOR_SQUARE = "\uF5CB"
FA_VOLUME_UP = "\uF028" FA_VOLUME_UP = "\uF028"
FA_STEAM = "\uF1B6"
FA_COMMENT_ALT = "\uF27A"
FA_YOUTUBE = "\uF167" FA_YOUTUBE = "\uF167"
XORG_ICONS = { XORG_ICONS = {
@ -123,6 +125,7 @@ WAYLAND_ICONS = {
"subl3": FA_CODE, "subl3": FA_CODE,
"sublime_merge": FA_CODE_BRANCH, "sublime_merge": FA_CODE_BRANCH,
"telegramdesktop": FA_TELEGRAM, "telegramdesktop": FA_TELEGRAM,
"evolution": FA_ENVELOPE,
"termite": FA_TERMINAL, "termite": FA_TERMINAL,
"thunar": FA_FOLDER, "thunar": FA_FOLDER,
"transmission-gtk": FA_DOWNLOAD, "transmission-gtk": FA_DOWNLOAD,
@ -131,9 +134,10 @@ WAYLAND_ICONS = {
} }
TERMINAL_APPS = { TERMINAL_APPS = {
"vim": FA_CODE, "aerc": FA_ENVELOPE,
"emacs": FA_CODE, "emacs": FA_CODE,
"emacsclient": FA_CODE, "emacsclient": FA_CODE,
"vim": FA_CODE,
"weechat": "\uf075", "weechat": "\uf075",
} }
@ -176,7 +180,10 @@ def icon_for_window(window):
for cls in classes: for cls in classes:
if cls in XORG_ICONS: if cls in XORG_ICONS:
return XORG_ICONS[cls] return XORG_ICONS[cls]
if "Minecraft" in cls:
return FA_GAMEPAD
print("No icon available for window with classes: %s" % str(classes)) print("No icon available for window with classes: %s" % str(classes))
return "*" return "*"