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

New Feature request - custom menu option(s) #135

Open
pippim opened this issue Nov 17, 2024 · 7 comments
Open

New Feature request - custom menu option(s) #135

pippim opened this issue Nov 17, 2024 · 7 comments

Comments

@pippim
Copy link

pippim commented Nov 17, 2024

I've been using a custom script to display output for many years and it works excellent.

Is it possible to add new feature where a custom menu option can be added to the existing menu?

  • System Monitor
  • "My new custom menu option"
  • Preferences
  • Help
  • Quit

Then in Preferences you would create "My new custom menu option" - Exec: "my bash script.sh"

@fossfreedom
Copy link
Owner

Sounds like a reasonable request. Not sure on the best approach. Maybe a file if located in say .config/indicator-sysmonitor that has a predefined format like

"Menu text","script name"

Then the existing menu could be built on startup with the values in the file.

@Bernmeister
Copy link
Contributor

Not sure if Script Runner will do the trick for you.

Full disclosure: I'm the author.

Although only initially supported on Ubuntu, I'm expanding the supported platforms to include Debian, Fedora, openSUSE and Manjaro (along with better support for Ubuntu derivations). Will eventually switch from a PPA/deb install to a PyPI/pip install (hopefully soon)...

@pippim
Copy link
Author

pippim commented Nov 17, 2024

Not sure if Script Runner will do the trick for you.

Full disclosure: I'm the author.

Although only initially supported on Ubuntu, I'm expanding the supported platforms to include Debian, Fedora, openSUSE and Manjaro (along with better support for Ubuntu derivations). Will eventually switch from a PPA/deb install to a PyPI/pip install (hopefully soon)...

Ubuntu is fine. BTW, muru asked for you to confirm you are the author in the link you posted: https://askubuntu.com/questions/30334/what-application-indicators-are-available/786708#786708

Are there usage instructions for Script Runner in GitHub or some other place?

@pippim
Copy link
Author

pippim commented Nov 17, 2024

Sounds like a reasonable request. Not sure on the best approach. Maybe a file if located in say .config/indicator-sysmonitor that has a predefined format like

"Menu text","script name"

Then the existing menu could be built on startup with the values in the file.

~/.config/indicator-systemmonitor sounds like a great place. Users can create the directory themselves. Perhaps you might want to make a rule that the file extension name must end in ".menu". Just in case someday you want to support other file types like ".language" where users can rename words in the GUI. Or perhaps you will want ".uom" for Units of Measure, etc. etc.

@Bernmeister
Copy link
Contributor

Are there usage instructions for Script Runner in GitHub or some other place?

When you run the indicator, open the Preferences and there are sample scripts. You should be able to base your custom script on those.

@pippim
Copy link
Author

pippim commented Nov 18, 2024

Are there usage instructions for Script Runner in GitHub or some other place?

When you run the indicator, open the Preferences and there are sample scripts. You should be able to base your custom script on those.

Unfortunately there is an error on the last (third) step:

E: Unable to locate package indicator-script-runner

I'm on Ubuntu 16.04 LTS Pro with Unity and Compiz. I develop in Python 2.7.12 and Python 3.5. It appears the package only works with Ubuntu 20.04 and 22.04? Eventually I'll upgrade to 24.04 or 26.04 when 16.04 ESM hits EOL.

I found a tutorial and it was less than an hour to create an app-indicator from scratch: http://candidtim.github.io/appindicator/2014/09/13/ubuntu-appindicator-step-by-step.html

@Bernmeister
Copy link
Contributor

I'm on Ubuntu 16.04 LTS Pro with Unity and Compiz. I develop in Python 2.7.12 and Python 3.5. It appears the package only works with Ubuntu 20.04 and 22.04? Eventually I'll upgrade to 24.04 or 26.04 when 16.04 ESM hits EOL.

As 16.04 is now end of life (standard support) I pulled the release for that version. As you mentioned, either install the 20.04 or 22.04 version (after upgrade) or wait until you install 24.04 (and I hopefully soon release to PyPI)...or write your own indicator which sounds like you've started...well done!

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

No branches or pull requests

3 participants