Pandora Button Issue


Hi,


Thank you Notaz!


The issue on my machine is that:



Code:
ps u -C xfce4-session | tail -n1 | awk '{print $1}'



produces:



Code:
1000



which results in the su call logging:



Code:
Unknown id: 1000



This seems to be related to this: 'bug' or rather aspect of ps

i.e. usernames that are longer than 8 characters are displayed as an ID and hence why this only effects some users.



replacing the code with:





Code:
ps -eo user:20,comm | grep "xfce4-session" | tail -n1 | awk '{print $1}'


Seems to do the trick (at least in a shell), though I am sure a shell ninja will laugh at that and produce something more elegant :)


-(e)


[edit: changed name length to saner 20 and tested the command, it seems to work!]
 
Last edited by a moderator:
FYI


While in XFCE and using the Pandora button and Power Switch to Reset the unit does work. Sounds like this is XFCE specific?

Yes it does reset the unit when I do the Pandora Button + Power Switch Combo. I am going to try running it with sudo and will report back. Also, for the record, my username is greater than 8 chars. I am going to make a shorter username and see if that fixes it.
 
Last edited by a moderator:
Shortening my username to 8 chars fixed the problem. I want to use my original username, so I changed op_menu.sh as sweetlilmre suggested, and everything works!


Thanks sweetlilmre!
 
Last edited by a moderator:
Hi,


Awesome, glad this is sorted.


lordbobjones: could you mark this topic as [sOLVED] (if possible).


I will PM Ed with the solution, hopefully this can make it into the firmware image.


-(e)
 
Great! Am so glad this solved. Notaz you are amazing.


Someone else has to mark it solved. I cannot do that.


Have fun all.
 
As ED is overloaded as usual and I have commit access I've pushed this:



Code:
xfceuser=$(ps -o user:20= -C xfce4-session | tail -n1 | awk '{print $1}')


Note that this script is still broken as it runs 'xfce4-popup-menu' to show the menu and if you press the button again, it will create another popup for each press. This happens because xfce4-popup-menu just sends a message to xfce and exits, but the script thinks it's separate process and checks the process list to decide to open another menu or not.


No idea how to fix it though.
 
Last edited by a moderator:
So between May and now, something has changed with the flashing process on new units? I really like the Pandora button, I've grown used to it while avoiding the nubs in XFCE, it seems quicker when you use the D Pad vs trying to point and click with the nubs.
 
Nothing changed with the flashing process. It would seem that the issue was always there. It affects users who choose a login name longer than 8 characters. The fix is a valid fix that will solve the problem, it just isn't official. It'll probably be worked into HF6.


notaz mentions the script still being "broken" because while it works, there is probably a better way of accomplishing what it wants to do.
 
Last edited by a moderator:
Well. I tried editing the script and got the message "can't open file to write." Decided to change my login name instead to make it shorter than the 8 chars and guess what? Can't find an option to enable me to do that either. Usermanager only lets me create or delete but not edit and I can't delete my existing user name.
 
Well. I tried editing the script and got the message "can't open file to write." Decided to change my login name instead to make it shorter than the 8 chars and guess what? Can't find an option to enable me to do that either. Usermanager only lets me create or delete but not edit and I can't delete my existing user name.
Create a new one, then delete the old one.


Where did you find this Usermanager? I haven't installed any hotfixes on my unit that is going back to the UK tomorrow, but I wanted to delete what was in there and try this fix.
 
Well I am a bit late to the party but I can confirm the behavior.


Re flashed with the same firmware, only used a longer username and the pandora didn't work in XFCE.


Obviously I didn't realize what was the issue and found this topic :)


I did fix the problem by changing my user name to a shorter one.


The easiest way I could think of was to create another user (because you can't change your name if you're logged in)


Then with this new user I change the name (command line: usermod -l ...).


Now my Pandora button work fine however I found another "bug" or at least strange behavior.


In the initial set-up I haven chosen that my Pandora login screen be populated with my username.


Now that I change the user name, it is still showing my inial username. I tried rebooting and it doesn't change anything. It's maybe just a small thing but I believe the username shouldn't be hard coded (at least it seems like it is). It not the nicest behavior to display a username that doesn't correspond to anything.


EDIT:


samedizombie: If it can help you here is how to change your username step by step (or at least one way to do it)


1. Create another username: system > usermanager


2. Logout and Login with the new account


3. Open a console and type "sudo usermod -l new_name old_name"


- It will ask you for your password


4. Logout and log in into your initial account (with you new shortened username)


5. In system > usermanager you can now deleted the account you created before.


:)
 
Last edited by a moderator:
Note that this script is still broken as it runs 'xfce4-popup-menu' to show the menu and if you press the button again, it will create another popup for each press. This happens because xfce4-popup-menu just sends a message to xfce and exits, but the script thinks it's separate process and checks the process list to decide to open another menu or not.


No idea how to fix it though.

It appears that they've added the ability to send a plugin event in xfce 4.8 (link) but we're still running 4.6. I think I remember reading somewhere on the other forum that it would be problematic to update the shipped version, but if we could do this, we might be able to send a mousedown or mouseup event to the menu-plugin directly, eliminating the need for a state check.
 
As ED is overloaded as usual and I have commit access I've pushed this:



Code:
xfceuser=$(ps -o user:20= -C xfce4-session | tail -n1 | awk '{print $1}')



Note that this script is still broken as it runs 'xfce4-popup-menu' to show the menu and if you press the button again, it will create another popup for each press. This happens because xfce4-popup-menu just sends a message to xfce and exits, but the script thinks it's separate process and checks the process list to decide to open another menu or not.



No idea how to fix it though.


Notaz, with user:20= piping to awk becomes unnecessary as you are already only emitting the username:



Code:
xfceuser=$(ps -o user:20= -C xfce4-session | tail -n1)


As for the open close functionality. I am working on a fix that uses state tracking and xdotool (esc should close the menu).


-(e)
 
Back
Top