matryer / xbar

Put the output from any script or program into your macOS Menu Bar (the BitBar reboot)
https://xbarapp.com
MIT License
17.5k stars 642 forks source link

Flag for first launch #790

Open donysukardi opened 2 years ago

donysukardi commented 2 years ago

I'm wondering if there's any way to detect if the plugin starts for the first time. Also, if there's anyway to perform clean up when xbar closes or the OS shuts down

matryer commented 2 years ago

@donysukardi most plugins do cleanup on startup (i.e. delete old temp files).

We have discussed having a way to know if the plugin is being run for the first time. Others have needed this.

Do you mean plugin run for the first time today (or since the last restart), or do you need to know when the plugin was first run on the computer?

donysukardi commented 2 years ago

my use case is for clean up, so perhaps since last restart restart (which should also include when plugin first run on the computer) would be sufficient