Closed realhackcraft closed 5 months ago
I stole some code from https://github.com/crissNb/Dynamic-Island-Sketchybar to display the front app's icon.
front_app_icon.sh
#! /bin/bash if [ "$SENDER" = "front_app_switched" ]; then BUNDLENAME=$(osascript -e "id of app \"$INFO\"") sketchybar --set $NAME background.image.string="app.$BUNDLENAME" fi
code to add the item
#!/bin/bash sketchybar --add item front_app_icon left \ --set front_app_icon background.image.scale=0.4 \ script="$PLUGIN_DIR/front_app_icon.sh" \ --subscribe front_app_icon front_app_switched
I tried to see if the $BUNDLENAME var is wrong by displaying it as the label, but that seems to be correct.
I fixed it by adding background.drawing=on when initializing the item.
background.drawing=on
I stole some code from https://github.com/crissNb/Dynamic-Island-Sketchybar to display the front app's icon.
front_app_icon.sh
code to add the item
I tried to see if the $BUNDLENAME var is wrong by displaying it as the label, but that seems to be correct.