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

scripting: expose icon in config #6916

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

naveenrajm7
Copy link
Contributor

  • Allows to get/set built-in icons
    iconURL is URL in UTMConfig, but stored as string in config.plist, same is done for scripting interface.

Usage:

tell application "UTM"
  set vm to virtual machine named "OpenBSD"
  set config to configuration of vm
  set icon of config to "openbsd"
  update configuration of vm with config
end tell

Say hi to puffy!

For reference :
All available icons are in https://github.com/utmapp/UTM/tree/main/Icons
corresponding icon keys in

private let ICON_TITLE_MAP: [String: LocalizedStringKey] = [

* Allows to get/set built-in icons
iconURL is URL in UTMConfig, but stored as string in config.plist, same is done for scripting interface.
@naveenrajm7
Copy link
Contributor Author

naveenrajm7 commented Dec 23, 2024

fixes #6914

For future :
If you want to allow custom icons through scripting,

  • Take icon as URL from scripting,
  • Expose isIconCustom field in config
  • Take care of sandbox permissions of the given icon file
  • Copy icon file to VM bundle, set URL in config accordingly
    ...

not worth it

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

Successfully merging this pull request may close these issues.

1 participant