#!/bin/bash

# only Override if no dynamice icon map found
if [[ -f ~/.config/sketchybar/dyn-icon_map.sh ]]; then 
  source ~/.config/sketchybar/dyn-icon_map.sh
else 
  __icon_map() {
    case $1 in
    "Brave Browser")
      icon_result=":brave_browser:"
      ;;
    "Keyboard Maestro")
      icon_result=":keyboard_maestro:"
      ;;
    "Min")
      icon_result=":min_browser:"
      ;;
    "Final Cut Pro")
      icon_result=":final_cut_pro:"
      ;;
    "FaceTime")
      icon_result=":face_time:"
      ;;
    "Affinity Publisher")
      icon_result=":affinity_publisher:"
      ;;
    "Messages" | "Nachrichten")
      icon_result=":messages:"
      ;;
    "Tweetbot" | "Twitter")
      icon_result=":twitter:"
      ;;
    "Maps")
      icon_result=":maps:"
      ;;
    "ChatGPT")
      icon_result=":openai:"
      ;;
    "ClickUp")
      icon_result=":click_up:"
      ;;
    "KeePassXC")
      icon_result=":kee_pass_x_c:"
      ;;
    "Microsoft Edge")
      icon_result=":microsoft_edge:"
      ;;
    "VLC")
      icon_result=":vlc:"
      ;;
    "Emacs")
      icon_result=":emacs:"
      ;;
    "Thunderbird")
      icon_result=":thunderbird:"
      ;;
    "Notes")
      icon_result=":notes:"
      ;;
    "Caprine")
      icon_result=":caprine:"
      ;;
    "Zulip")
      icon_result=":zulip:"
      ;;
    "Spark")
      icon_result=":spark:"
      ;;
    "Microsoft To Do" | "Things")
      icon_result=":things:"
      ;;
    "DEVONthink 3")
      icon_result=":devonthink3:"
      ;;
    "GitHub Desktop" | "GitHub")
      icon_result=":git_hub:"
      ;;
    "App Store")
      icon_result=":app_store:"
      ;;
    "Chromium" | "Google Chrome" | "Google Chrome Canary")
      icon_result=":google_chrome:"
      ;;
    "zoom.us")
      icon_result=":zoom:"
      ;;
    "MoneyMoney")
      icon_result=":bank:"
      ;;
    "Color Picker" | "Digital Color Meter")
      icon_result=":color_picker:"
      ;;
    "Microsoft Word")
      icon_result=":microsoft_word:"
      ;;
    "Microsoft Teams")
      icon_result=":microsoft_teams:"
      ;;
    "Iris")
      icon_result=":iris:"
      ;;
    "WebStorm")
      icon_result=":web_storm:"
      ;;
    "Neovide" | "MacVim" | "Vim" | "VimR")
      icon_result=":vim:"
      ;;
    "Sublime Text")
      icon_result=":sublime_text:"
      ;;
    "TextEdit")
      icon_result=":textedit:"
      ;;
    "PomoDone App")
      icon_result=":pomodone:"
      ;;
    "Setapp")
      icon_result=":setapp:"
      ;;
    "qutebrowser")
      icon_result=":qute_browser:"
      ;;
    "Mattermost")
      icon_result=":mattermost:"
      ;;
    "Notability")
      icon_result=":notability:"
      ;;
    "WhatsApp")
      icon_result=":whats_app:"
      ;;
    "OBS")
      icon_result=":obsstudio:"
      ;;
    "Parallels Desktop")
      icon_result=":parallels:"
      ;;
    "VMware Fusion")
      icon_result=":vmware_fusion:"
      ;;
    "Pine")
      icon_result=":pine:"
      ;;
    "Microsoft Excel")
      icon_result=":microsoft_excel:"
      ;;
    "Microsoft PowerPoint")
      icon_result=":microsoft_power_point:"
      ;;
    "Matlab")
      icon_result=":matlab:"
      ;;
    "Numbers")
      icon_result=":numbers:"
      ;;
    "Default")
      icon_result=":default:"
      ;;
    "Element")
      icon_result=":element:"
      ;;
    "Bear")
      icon_result=":bear:"
      ;;
    "TeamSpeak 3")
      icon_result=":team_speak:"
      ;;
    "Airmail")
      icon_result=":airmail:"
      ;;
    "Firefox Developer Edition" | "Firefox Nightly")
      icon_result=":firefox_developer_edition:"
      ;;
    "Trello")
      icon_result=":trello:"
      ;;
    "TickTick")
      icon_result=":tick_tick:"
      ;;
    "Notion")
      icon_result=":notion:"
      ;;
    "Live")
      icon_result=":ableton:"
      ;;
    "Evernote Legacy")
      icon_result=":evernote_legacy:"
      ;;
    "Calendar" | "Fantastical")
      icon_result=":calendar:"
      ;;
    "Android Studio")
      icon_result=":android_studio:"
      ;;
    "Calculator")
      icon_result=":calculator:"
      ;;
    "Xcode")
      icon_result=":xcode:"
      ;;
    "Slack")
      icon_result=":slack:"
      ;;
    "Sequel Pro")
      icon_result=":sequel_pro:"
      ;;
    "Bitwarden")
      icon_result=":bit_warden:"
      ;;
    "System Preferences" | "System Settings")
      icon_result=":gear:"
      ;;
    "Discord" | "Discord Canary" | "Discord PTB")
      icon_result=":discord:"
      ;;
    "Vivaldi")
      icon_result=":vivaldi:"
      ;;
    "Firefox")
      icon_result=":firefox:"
      ;;
    "Skype")
      icon_result=":skype:"
      ;;
    "Dropbox")
      icon_result=":dropbox:"
      ;;
    "微信")
      icon_result=":wechat:"
      ;;
    "Typora")
      icon_result=":text:"
      ;;
    "Blender")
      icon_result=":blender:"
      ;;
    "Canary Mail" | "HEY" | "Mail" | "Mailspring" | "MailMate" | "邮件" | "Outlook")
      icon_result=":mail:"
      ;;
    "Safari" | "Safari Technology Preview")
      icon_result=":safari:"
      ;;
    "Telegram")
      icon_result=":telegram:"
      ;;
    "Keynote")
      icon_result=":keynote:"
      ;;
    "Reeder")
      icon_result=":reeder5:"
      ;;
    "Spotify")
      icon_result=":spotify:"
      ;;
    "MAMP" | "MAMP PRO")
      icon_result=":mamp:"
      ;;
    "Figma")
      icon_result=":figma:"
      ;;
    "Joplin")
      icon_result=":joplin:"
      ;;
    "Spotlight")
      icon_result=":spotlight:"
      ;;
    "Music")
      icon_result=":music:"
      ;;
    "Insomnia")
      icon_result=":insomnia:"
      ;;
    "TIDAL")
      icon_result=":tidal:"
      ;;
    "Alfred")
      icon_result=":alfred:"
      ;;
    "Pages")
      icon_result=":pages:"
      ;;
    "Folx")
      icon_result=":folx:"
      ;;
    "Android Messages")
      icon_result=":android_messages:"
      ;;
    "mpv")
      icon_result=":mpv:"
      ;;
    "网易云音乐")
      icon_result=":netease_music:"
      ;;
    "Transmit")
      icon_result=":transmit:"
      ;;
    "Pi-hole Remote")
      icon_result=":pihole:"
      ;;
    "Nova")
      icon_result=":nova:"
      ;;
    "Affinity Designer")
      icon_result=":affinity_designer:"
      ;;
    "IntelliJ IDEA")
      icon_result=":idea:"
      ;;
    "Drafts")
      icon_result=":drafts:"
      ;;
    "Audacity")
      icon_result=":audacity:"
      ;;
    "Affinity Photo")
      icon_result=":affinity_photo:"
      ;;
    "Atom")
      icon_result=":atom:"
      ;;
    "Obsidian")
      icon_result=":obsidian:"
      ;;
    "CleanMyMac X")
      icon_result=":desktop:"
      ;;
    "Zotero")
      icon_result=":zotero:"
      ;;
    "Todoist")
      icon_result=":todoist:"
      ;;
    "LibreWolf")
      icon_result=":libre_wolf:"
      ;;
    "Grammarly Editor")
      icon_result=":grammarly:"
      ;;
    "OmniFocus")
      icon_result=":omni_focus:"
      ;;
    "Reminders")
      icon_result=":reminders:"
      ;;
    "Preview" | "Skim" | "zathura")
      icon_result=":pdf:"
      ;;
    "1Password 7")
      icon_result=":one_password:"
      ;;
    "Passwords")
      icon_result=":passwords:"
      ;;
    "SF Symbols")
      icon_result=":sf_symbols:"
      ;;
    "Shortcuts")
      icon_result=":shortcuts:"
      ;;
    "Code" | "Code - Insiders")
      icon_result=":code:"
      ;;
    "Steam" )
      icon_result=":steam:"
      ;;
    "Weather" )
      icon_result=":weather:"
      ;;
    "VSCodium")
      icon_result=":vscodium:"
      ;;
    "Tower")
      icon_result=":tower:"
      ;;
    "Calibre")
      icon_result=":book:"
      ;;
    "Finder" | "访达")
      icon_result=":finder:"
      ;;
    "Linear")
      icon_result=":linear:"
      ;;
    "League of Legends")
      icon_result=":league_of_legends:"
      ;;
    "Zeplin")
      icon_result=":zeplin:"
      ;;
    "Signal")
      icon_result=":signal:"
      ;;
    "Podcasts")
      icon_result=":podcasts:"
      ;;
    "Alacritty" | "Hyper" | "iTerm2" | "kitty" | "Terminal" | "WezTerm" | "Ghostty")
      icon_result=":terminal:"
      ;;
    "Activity Monitor")
      icon_result=":activity_monitor:"
      ;;
    "Tor Browser")
      icon_result=":tor_browser:"
      ;;
    "Kakoune")
      icon_result=":kakoune:"
      ;;
    "GrandTotal" | "Receipts")
      icon_result=":dollar:"
      ;;
    "Sketch")
      icon_result=":sketch:"
      ;;
    "Sequel Ace")
      icon_result=":sequel_ace:"
      ;;
    "YouTube")
      icon_result=":youtube:"
      ;;
    *)
      icon_result=":default:"
      ;;
    esac
  }
fi