matryer / xbar-plugins

Plugin repository for xbar (the BitBar reboot)
https://xbarapp.com
2.44k stars 1.04k forks source link

re: Countdown Timer -- How/where can I pass arguments? #849

Closed danmandle closed 7 years ago

danmandle commented 7 years ago

I'm trying to run the countdown script. Looking at the source, it expects some command line arguments. I'm not seeing anywhere to pass those. I've done some fairly extensive looking around for this and the closest thing I can find is #88, but that is mostly about env vars. What am I missing here?

tresni commented 7 years ago

FOA: @Furkanzmc

Furkanzmc commented 7 years ago

Hi @danmandle.

You can see the arguments documentation here.

And here's an example:

countdown.py "--bar-title" "Custom Bar Title" "--no-cycle" "--date-format" "%d-%m-%Y" "Time #1" "17-07-2017" "Time #2" "15-08-2017"
tresni commented 7 years ago

I think the question is how you are getting that to show up in the bitbar menu. Given Bitbar just looks for the file on disc and there is no way to pass command line params. Are you just using a wrapper script?

Furkanzmc commented 7 years ago

Sorry. I misinterpreted the question. I personally use an .sh file that calls the main script with the appropriate arguments. If that's not a wanted behaviour with the community, I can quickly add the environment variable support.

danmandle commented 7 years ago

I don't think that environment variables would be appropriate for this application, but some documentation about needing the wrapping script sure would be helpful. As a new user there was no indication that it would be needed.

Furkanzmc commented 7 years ago

Sure thing. Thank you for pointing it out. I'll add it to the <bitbar.desc> tag and also to the --help parameter output.

EDIT: I added the changes with #850

Furkanzmc commented 6 years ago

I use the same as the one in the help text.

chmod +x /Path/to/countdown.py && /Path/to/countdown.py "--bar-title" "Custom Bar Title" "--no-cycle" "--date-format" "%d-%m-%Y" "Time #1" "17-07-2017" "Time #2" "15-08-2017"