kvndrsslr / sketchybar-app-font

A symbol font for sketchybar, initialized with the symbols from simple-bar
Creative Commons Zero v1.0 Universal
144 stars 52 forks source link

Unable to use icons from sketchybar-app-font library #123

Closed Manas8803 closed 3 weeks ago

Manas8803 commented 3 weeks ago

Description

I'm encountering difficulties using icons from the sketchybar-app-font library in my sketchybar configuration. Despite following the setup instructions, the icons are not displaying correctly.

Current Setup

My icons.sh file looks like this:

#!/bin/bash
source "/path/to/sketchybar-app-font/dist/icon_map.sh"
# General Icons
LOADING=􀖇
APPLE=􀣺
PREFERENCES=􀺽
ACTIVITY=􀒓
LOCK=
BELL=􀋚
BELL_DOT=􀝗
MUSIC=􀑪
# ... more icons ...
export ICON_ARC="$(__icon_map "Arc")" # Not able to get this icon, comes out to be blank space

Steps Taken

  1. I've sourced the icon_map.sh file from the sketchybar-app-font library.
  2. I've attempted to use the icons in my configuration.
  3. I've tried exporting the __icon_map function from icon_map.sh, but this didn't resolve the issue.

Expected Behavior

The icons should display correctly in my sketchybar setup.

Actual Behavior

The icons are not displaying as expected. It seems that the icon mappings are not being recognized or applied correctly.

Questions

  1. Are there any additional configuration steps required to use these icons?
  2. Is there a specific way to troubleshoot icon display issues in sketchybar?
  3. Are there any known compatibility issues with certain systems or setups?

Environment


Thank you for your help in resolving this issue!

kvndrsslr commented 3 weeks ago

ICON_ARC="$(__icon_map "Arc")"

This is not the correct usage of __icon_map, which should be apparent by reading the README (or the code). It is a bash function, which can not return a string like you would expect from a function in C or javascript. As such, the usual pattern in bash programming when you need to get a value from a function which is not an i8 (exit code type) goes like this:

  1. Call the function
  2. The function assigns the value to a global variable
  3. You use the global variable

In our case, the global variable is $icon_result. So in your code it should be:

__icon_map "Arc"
export ICON_ARC="${icon_result}"