Release Nub configuration alternative


Caine

Hardcore Member
Joined
Jun 5, 2008
Messages
4,136
Location
Netherlands
Here is a small python script which provides an alternative way to configure the nubs of the Pandora.


I didn't really like digging through the nested menu structure of the nub settings configuration script so I decided to create a tiny project to replace it. It is mainly a play project to learn a bit of GTK and PND creation, but I decided to share it anyway as someone might like the outcome.


This application presents all the settings for both the left and right nub in a single screen. It allows saving and loading of the configuration as a profile to quickly switch between common configurations and also provides command-line options to incorporate that behaviour into scripts (although passing parameters to PNDs isn't the greatest user experience in the world).





I did encounter the issue that writing a value to /proc/pandora/nub0/scrollx_sensitivity actually stored a value one lower (if positive) or one higher (if negative) instead (this also holds for scrolly and nub1). The default nub configuration script /usr/pandora/scripts/op_nubmode.sh is also affected by this. I worked around it by adjusting the values accordingly in the opposite direction though the behaviour itself seems a bit odd. Is it intentional?


Anyway, feedback and/or feature requests are welcome.


PND file


Preview image


Second release is up (changelog):


This is the 5th build of release 2 and purely a cosmetic update over build number 4. The final logo and icon by FaeMinx are now included.


PND file


Preview image (not updated)


Remove your profiles.txt in appdata/nubconfigurator if upgrading from release 1 (see changelog for details).


Third release is up (changelog):


PND file


Preview image


Thanks to cosurgi for identifying the joystick issue and solution which allowed me to incorporate this behaviour into the configurator.


Profiles should be backwards compatible with release 2, but not with release 1.
 
Last edited by a moderator:
Well done for doing this! Downloading now.


I'm sure there will be many users who will find this most useful. :)


A far more elegant solution to what we have at the moment!
 
I don't have my Pandora yet and don't know how the build-in configuration works or looks like, but from the screenshot your PND looks really nice and very useful.


What does the "Reset"-button do?


Is it to calibrate the nubs? Otherwise such an option might be useful a addition (if this is possible).


I added it to my "Must-have-PND's to download once my Pandora is send out"-list, thanks! :)
 
What does the "Reset"-button do?
I copied over all the functionality from the original script which does the following:



Code:
echo 1 > /sys/bus/i2c/drivers/vsense/3-0066/reset

sleep 1

echo 0 > /sys/bus/i2c/drivers/vsense/3-0066/reset

My estimate from this is that it is supposed to reset the driver. Unfortunately, (and this holds for the original script by ED as well), you need superuser privileges to do so, so currently it doesn't do much more than throw a Permission denied error :p


It needs some more work.


As for the regular script, it presents a dialog with the choice "What do you want to do? (Configure left nub, Configure right nub, Restore default settings for both nubs)". If you then choose Configure left nub it presents the dialog "What do you want to do? (Change Nub mode, Change the mouse speed, Change the scroll sensitivity, Change the scroll speed, Change the mouse button sensitivity, Reset Nub)", etc... Some basic zenity stuff.
 
Last edited by a moderator:
I don't suppose you could work in configuration for the shoulder buttons to act as mouse buttons could you? ;)


This is really nice. I wonder whether it could be included in HF6 or whether they consider there's not been enough testing of it yet? Could be worthwhile though.
 
Wow, that's totally awesome :D


Are you okay if we include that in the official OS?


Seems way more useful than our current script :)
 
Wow, that's totally awesome :D


Are you okay if we include that in the official OS?


Seems way more useful than our current script :)
I was just about to put a link to this thread in the HF6 requests thread in General. There doesn't seem much point now. ;)


Actually, I will, it may make some other users aware of it. Raise it's profile a bit.
 
Nice, good to see all those kernel knobs finally exposed in a GUI.

What does the "Reset"-button do?
I copied over all the functionality from the original script which does the following:



Code:
echo 1 > /sys/bus/i2c/drivers/vsense/3-0066/reset

sleep 1

echo 0 > /sys/bus/i2c/drivers/vsense/3-0066/reset

My estimate from this is that it is supposed to reset the driver. Unfortunately, (and this holds for the original script by ED as well), you need superuser privileges to do so, so currently it doesn't do much more than throw a Permission denied error :p
It toggles the reset signal to microcontrollers, so they are reset.


You could wrap this in a small .sh script and start 'gksudo reset_nubs.sh' when reset button is pressed. This way your GUI would start without asking passwords and only ask first time reset is pressed.


Also the reset signal is shared by both nubs, so one reset button is enough.
 
Last edited by a moderator:
Wow, that's totally awesome :D


Are you okay if we include that in the official OS?


Seems way more useful than our current script :)
I was just about to put a link to this thread in the HF6 requests thread in General. There doesn't seem much point now. ;)


Actually, I will, it may make some other users aware of it. Raise it's profile a bit.

If I can use it, I will include it in HF6 Alpha 2 :)


Caine: I will take care of the permission errors, so just keep the reset nubs features in there :)
 
Last edited by a moderator:
I did encounter the issue that writing a value to /proc/pandora/nub0/scrollx_sensitivity actually stored a value one lower (if positive) or one higher (if negative) instead (this also holds for scrolly and nub1). The default nub configuration script /usr/pandora/scripts/op_nubmode.sh is also affected by this. I worked around it by adjusting the values accordingly in the opposite direction though the behaviour itself seems a bit odd. Is it intentional?
It's a bug, for which I've just commited a fix, should be there in next HF build.
 
I don't suppose you could work in configuration for the shoulder buttons to act as mouse buttons could you? ;)
Haven't looked at that yet. There was a thread about how to do it, wasn't there. Ok, let's call it a planned feature.


Actually, my slightly longer term plan was to make one of these for editing the entire keyboard layout as well.


[edit]Just checked on the L/R mouse buttons tweak. It relies on xmodmap, so I'm going to postpone that functionality to the keyboard editor. The keyboard editor will need to do extensive editing of xmodmap profiles and as such is a better fit.


This is not a mouse configuration tool, but a nub configuration tool. Perhaps I'll merge them in the end, I'll see how it works out.[/edit]

Wow, that's totally awesome :D


Are you okay if we include that in the official OS?


Seems way more useful than our current script :)
Sure, allow me to polish the internals a bit and address issues raised in this thread.

You could wrap this in a small .sh script and start 'gksudo reset_nubs.sh' when reset button is pressed. This way your GUI would start without asking passwords and only ask first time reset is pressed.


Also the reset signal is shared by both nubs, so one reset button is enough.
Good idea. So setting vsense/3-0066 and vsense/3-0067 has the same effect. Hmmm... I'll probably keep the dual buttons though, ED had a feature in his script which allowed you to test the nub and I want to add that as well.

It's a bug, for which I've just commited a fix, should be there in next HF build.
Alright, then I'll make a version with my fix removed.
 
Last edited by a moderator:
Quickest turnaround ever from Beta to inclusion in an official distro?


10/10 for a great piece of work! B)
 
It's a bug, for which I've just commited a fix, should be there in next HF build.
Alright, then I'll make a version with my fix removed.
You can also detect it at startup by doing a quick write and read. This is just a variable in driver and does not affect hardware, in case you are worried about chips not liking too many writes.
 
great gui, any interest in writing a gui to configure keyboard shortcuts? after flashing hotfix 6 to test be handy to be able to set wifi, terminal shortcuts.


cheers
 
great gui, any interest in writing a gui to configure keyboard shortcuts? after flashing hotfix 6 to test be handy to be able to set wifi, terminal shortcuts.


cheers
Thanks.


Doesn't settings->keyboard already allow you to define keyboard shortcuts? Could you specify what is missing and/or exactly what you envision?
 
i would like a onescreen gui which would give you easy setup , with setting>keyboard the process is a bit laborious e.g. finding program to start or with wifi long pnd_run path needed etc.


sorry if above description is not clear, essentially what you did with mouse could you do with keyboard shortcuts?
 
i would like a onescreen gui which would give you easy setup , with setting>keyboard the process is a bit laborious e.g. finding program to start or with wifi long pnd_run path needed etc.


sorry if above description is not clear, essentially what you did with mouse could you do with keyboard shortcuts?
This is largely due to the inherent "complexity" of the keyboard setup. There are few shortcuts to take in program selection for example. If there are programs which are assigned shortcuts very frequently, then that's an argument to include shortcuts for them in the stock firmware itself.


The long pnd_run paths are indeed annoying, especially if you utilize pnd_run.sh rather than pnd_run.


The better way to address this is to make pnds themselves directly executable as this issue always occurs when interacting with PNDs.
 
I would just like to point out that if you are using a dark theme in XFCE the Pandora logo doesn't look very good.


Example:


closeUp.png


screen110610-191133.png


Any chance of having it cleaned up before it gets included in Hotfix6?
 
i would like a onescreen gui which would give you easy setup , with setting>keyboard the process is a bit laborious e.g. finding program to start or with wifi long pnd_run path needed etc.


sorry if above description is not clear, essentially what you did with mouse could you do with keyboard shortcuts?
This is largely due to the inherent "complexity" of the keyboard setup. There are few shortcuts to take in program selection for example. If there are programs which are assigned shortcuts very frequently, then that's an argument to include shortcuts for them in the stock firmware itself.


The long pnd_run paths are indeed annoying, especially if you utilize pnd_run.sh rather than pnd_run.


The better way to address this is to make pnds themselves directly executable as this issue always occurs when interacting with PNDs.

One age old problem with making pnd (any packaged format) executable is .... multiple applications. You can associate .pnd to pnd_run (might be in firmware now by default, I forget), but that implies always running the default (first) app in the pnd .. what if you want the second?


jeff
 
I would just like to point out that if you are using a dark theme in XFCE the Pandora logo doesn't look very good.


Any chance of having it cleaned up before it gets included in Hotfix6?
Thank you, I missed that one. I just copied it of the wiki. I'm almost finished wrapping up a newer version, so I'll postpone that one until the logo is replaced.


Does anyone have a good quality Pandora logo image? I'm also still searching for a good icon file.
 
Back
Top