View Single Post
gnuite's Avatar
Posts: 1,245 | Thanked: 421 times | Joined on Dec 2005
#6
If you want some extra application buttons in an easily accessible place, and if you don't mind using an application I customized just for myself and thus isn't very "usable" in the HCI sense of the sense, then you can try out my customized version of the loadplugin script, which I call loadplugin-run.

It's basically the same as the original loadplugin, except with an additional option called "Run...", which acts like the "Run..." button on a normal operating system - you can run arbitrary shell commands with it.

Plus, you can (optionally) save particular commands for use later - it adds them to the loadplugin menu.

I use it mostly to turn on/off things, like swap. I have 4 saved commands that I can access from the loadplugin menu:
* Toggle MMC2
* Toggle SSHD
* Toggle Swap
* Toggle NFS Mount

And each of the commands is linked to a script that checks if the thing (e.g. Swap) is already on; if so, it turns it off; otherwise, it turns it on.

I'd post screenshots or the contents of my shell scripts, but I'm at work and don't have access to a WAP in order to pull the data from my Nokia 770, but if you guys are interested, I can post that when I get home in a few hours.

It's not complete yet - for example, you can't yet change or remove previously saved run commands without using gconftool-2 on the command line (or via the "Run..." menu, I guess; all the gconf keys are in "/apps/loadplugin"), and you have to reboot in order to see those manual changes.

Also, there's no threading involved, and the command is run in the GDK thread, so if it's a long-running command (like mounting an NFS share), it will hang the entire Hildon UI until it finishes - not really a big deal, since most of the things I use it for are quick.

Since I found that I use this mostly for toggling things, I plan on changing the UI to make it more of a "Status" tool, e.g. turning the plain menu items into "checkbox" menu items where the check tells you the status (e.g. "is swap on?"), and "toggling" the checkbox would change the status. I'll probably implement that sometime next week.

But since your discussion sort of fits with the use case of loadplugin-run, I thought I'd offer it up to you guys in case you were curious.