Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for aliasing dock icons into sketchybar #204

Closed
ghost opened this issue Jun 19, 2022 · 2 comments
Closed

Add support for aliasing dock icons into sketchybar #204

ghost opened this issue Jun 19, 2022 · 2 comments
Labels
Milestone

Comments

@ghost
Copy link

ghost commented Jun 19, 2022

It would be really nice if there was some way to mirror dock icons to sketchy bar, or even just app icons themselves

@FelixKratz FelixKratz added the enhancement New feature or request label Jun 19, 2022
@FelixKratz
Copy link
Owner

I have played with app icons a while back, but did not come up with a way to include it in the configuration syntax.
Much has changed since then so maybe I will think about it again. It would not be an alias, because it is not dynamic, but could be a special kind of image where images could also take some syntactical abstraction of the application name and display the app icon as the image.

@FelixKratz
Copy link
Owner

FelixKratz commented Jun 23, 2022

All image properties can now be supplied app.<bundle_identifier> like I have done in this small example which shows the active application icon

app_icons.mp4

sketchybarrc:

sketchybar --add item front_app left                            \
           --set front_app label=Window                         \
                           icon.drawing=on                      \
                           icon.background.drawing=on           \
                           icon.background.color=0x00000000     \
                           icon.background.image.scale=0.5      \
                           script="$PLUGIN_DIR/window_title.sh" \
           --subscribe front_app front_app_switched

window_title.sh:

update() {
  sketchybar --set $NAME label="$INFO" \
                         icon.background.image="app.$(osascript -e "get id of app \"$INFO\"")"
}

case "$SENDER" in
  "front_app_switched") update
  ;;
esac

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant