indicator-sysmonitor icon indicating copy to clipboard operation
indicator-sysmonitor copied to clipboard

New Feature request - custom menu option(s)

Open pippim opened this issue 1 year ago • 7 comments

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"

pippim avatar Nov 17 '24 16:11 pippim

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.

fossfreedom avatar Nov 17 '24 18:11 fossfreedom

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)...

Bernmeister avatar Nov 17 '24 19:11 Bernmeister

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 avatar Nov 17 '24 22:11 pippim

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.

pippim avatar Nov 17 '24 22:11 pippim

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.

Bernmeister avatar Nov 17 '24 23:11 Bernmeister

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

pippim avatar Nov 18 '24 23:11 pippim

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!

Bernmeister avatar Nov 19 '24 05:11 Bernmeister