Release Pandora config tray icon


usbmass.c attached for anyone who's interested
Can you get slaeshjag to push this into his git (send a pull request or something)? Otherwise it's more difficult to include it in firmware.

Also a question, don't you need to rescan for each getinfo(), as the user might have ejected/inserted some cards?
 
Because I cloned the script, and was hosting it next to the plugin, it was failing the "sudo" function. Apparently certain scripts are given auto-sudo access, which my new one didn't. So I replaced the original op_storage.sh, which does have the auto-sudo permission, and hey presto
Pandora's scripts like op_storage.sh can be run as 'sudo' without a password because they have an entry in /etc/sudoers.d/50_openpandora. If you want to create a new script, you can add an entry for it in that file, or create a new file in that directory (e.g. I made a /etc/sudoers.d/51_openbox so that GUI can do sudo-without-a-password stuff).
 
usbmass.c attached for anyone who's interested
Can you get slaeshjag to push this into his git (send a pull request or something)? Otherwise it's more difficult to include it in firmware.

Also a question, don't you need to rescan for each getinfo(), as the user might have ejected/inserted some cards?
getinfo is called every time the user clicks the config button, so it should always show the current SD cards, unless they click the button then eject/swap the SD cards, but there's not much I can do at that point.

Pull request: https://github.com/slaeshjag/pandora-configbutton/pull/1

I've put the script replacement in another folder (called script_replacements)

Because I cloned the script, and was hosting it next to the plugin, it was failing the "sudo" function. Apparently certain scripts are given auto-sudo access, which my new one didn't. So I replaced the original op_storage.sh, which does have the auto-sudo permission, and hey presto
Pandora's scripts like op_storage.sh can be run as 'sudo' without a password because they have an entry in /etc/sudoers.d/50_openpandora. If you want to create a new script, you can add an entry for it in that file, or create a new file in that directory (e.g. I made a /etc/sudoers.d/51_openbox so that GUI can do sudo-without-a-password stuff).
Why create another script when this does the same job as the original? It's just been extended to support command line options. So the original SD Mass Storage icon still works with this script. But yeah, if somebody wants to rename and include this as another script, go ahead, just seems a little redundant
 
getinfo is called every time the user clicks the config button, so it should always show the current SD cards, unless they click the button then eject/swap the SD cards, but there's not much I can do at that point.
It is, but you only rescan if info->submenu is NULL, does configbutton free all that stuff and set it to NULL automatically? If so, how does it know how to destroy sub->internal, also what's the point having that info->submenu check there anyway?
 
Last edited by a moderator:
Why create another script when this does the same job as the original? It's just been extended to support command line options. So the original SD Mass Storage icon still works with this script. But yeah, if somebody wants to rename and include this as another script, go ahead, just seems a little redundant
Hi,

Apologies - I wasn't suggesting that you or anybody should create another script, I just got the impression that it was something you wanted to do from your post here. It took me a while to figure out why some scripts could be executed as 'sudo' without a password, so I was just sharing that knowledge.
 
Last edited by a moderator:
getinfo is called every time the user clicks the config button, so it should always show the current SD cards, unless they click the button then eject/swap the SD cards, but there's not much I can do at that point.
It is, but you only rescan if info->submenu is NULL, does configbutton free all that stuff and set it to NULL automatically? If so, how does it know how to destroy sub->internal, also what's the point having that info->submenu check there anyway?
I'm afraid I don't know, I'm assuming it must be done automatically, because there's nowhere for me to put destructor code. If you have a look at any of the other plugin sources (I copied the Dummy.c source and added my functionality), they too mallocs into info->internal, but never frees.

I'm afraid I've not really looked through the rest of the config button code to see what happens. If it doesn't, then it isn't just my plugin that could have a memory leak issue.

Edit: Sorry, I was kind of talking about the wrong bit, though my answer is still pretty much the same. I used the cpuspeed.c file as a guide to making custom menu options

Apologies - I wasn't suggesting that you or anybody should create another script, I just got the impression that it was something you wanted to do from your post here. It took me a while to figure out why some scripts could be executed as 'sudo' without a password, so I was just sharing that knowledge.
Ah, yeah, no worries. Thanks. It took a while before somebody told me how that worked too
 
Last edited by a moderator:
The submenu stuff is entierly managed by the get_info function. As far as I know, GTK automatically frees the gtkmenuentry even if the submenu entry is deleted. I destroy the menu when it's closed, and GTK should do a recursive free on everything. So I guess that member is a bit redundant.

submenu is not set to NULL automatically, it's only null first time you click.

After get_info has been called, the menu is created from the submenu entries it finds in the linked list.
 
Tried "upgrade OS" but didn't notice any difference in the configbutton. Found the following (and maybe related) line in the log:
 

Not downgrading package pandora-scripts on root from 1.0-r128.5 to 1.0-r122.5
Or did i miss some additional stuff i should've done?
 
You need to restart the configbutton. This can either be done by relogging or running configbutton via xfce-menu -> run program -> type in "configbutton" and press enter.
 
The max and min values in /etc/pandora/conf/cpu.conf sets the presets in the cpuspeed-plugin, what's the easiest way to customize presets to my liking instead?
 
There's no built in functionality to set your own values, so I guess hacking up the plugin would be the only way apart from modifying min-max :p  
 
Is it possible to open the menu via a keyboard shortcut ? One of the main reasons I do not use it very often is, that I usually use the keyboard only to control my Pandora.
 
I don't think there's a way for a statusbar widget to register a global hotkey. I guess I could make it toggle on SIGUSR1 though, which means you would set it up in xfce by making a custom shortcut that runs "killall -USR1 configbutton"...
 
I have implemented user-definable CPU-speed presets. The menu now also opens when SIGUSR1 is caught.

To set custom presets, create the file cpu-speed inside ~/.config-button. Enter each CPU-speed on one line as a number in MHz. Note that the first entry in the file will be the last entry in the CPU-speed menu.

Someone will have to push my changes to the firmware updater. Changes are in my git-repo as usual.
 
Last edited by a moderator:
I have implemented user-definable CPU-speed presets. The menu now also opens when SIGUSR1 is caught.

To set custom presets, create the file cpu-speed inside ~/.config-button. Enter each CPU-speed on one line as a number in MHz. Note that the first entry in the file will be the last entry in the CPU-speed menu.

Someone will have to push my changes to the firmware updater. Changes are in my git-repo as usual.
Thanks !!

looking foward to its firmware integration
 
Back
Top