Comments (3)
Have you read through the Writing plugins guide? Start there to get a general overview of how plugin development works.
from xbar-plugins.
I tried but it wasnt working
#!/bin/bash
# Specify the path to the Pictures folder
pictures_folder="~/Pictures"
# Specify the name of the app to toggle
app_name="MyApp"
# Check if the app is running
if pgrep -xq "$app_name"; then
# App is running, so we'll stop it
killall "$app_name"
echo "Start $app_name | shell=/usr/bin/open | param1=-a | param2=$app_name | emojize=false"
echo "----"
echo "Pictures Folder | href=file://$pictures_folder | image=base64_icon_data_here"
else
# App is not running, so we'll start it
open -a "$app_name"
echo "Stop $app_name | shell=pkill | param1=-x | param2=$app_name | emojize=false"
echo "----"
echo "Pictures Folder | href=file://$pictures_folder | image=base64_icon_data_here"
fi
from xbar-plugins.
One thing that jumps out is having too many hyphens for the menu separator.
This
echo "----"
should be
echo "---"
Three hyphens... That will at least get the plugin to have your Pictures Folder
menu item show up. If I run your plugin and substitute for MyApp
, the plugin loads up the application at startup and then shows the Stop <app name>
in the menu bar. However, I don't think the menu bar item does anything beyond opening up the menu when you click on it. If you want an action to stop the application, that would need to go in the menu after the echo "---"
line, as you have the Pictures Folder
link.
from xbar-plugins.
Related Issues (20)
- stock-ticker.py: Yahoo API needs auth. A free service is still available on another URL
- 001-riggedCoinFlip.1h.sh: HOT 2
- 001-emojiWeather.30m.js: request module has been deprecated HOT 1
- Adding a New System Information Plugin HOT 4
- notifications.30s.py: add support for Discussions notifications HOT 1
- Error when running script cmd line ":22:in `<main>': uninitialized constant API (NameError)" HOT 8
- 001-redditnotify.30s.py: Error when running HOT 4
- 001-bandwidth.1s.py: HOT 2
- 001-rbc.10m.sh: HOT 2
- Plugin can't call itself
- 001-robinhood.1m.py: HOT 1
- 001-exchange-rates.5m.sh: HOT 2
- xbar shows no icons at all if any plugin can't be executed HOT 1
- 001-dnsswitcher.1d.sh: HOT 3
- no module emoji
- 001-pubmed.py: HOT 7
- 001-pubmed.py: HOT 3
- orctoprint plugin doesn't show ETA
- Xbar result and terminal output differs
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xbar-plugins.