Profile selection screen on wake from suspend/sleep. Possible?
#1
As per the title, is it possible to have XBMC wake from sleep/suspend and go straight to the profile selection screen? That was the kids can't wake XBMC and be in the adult profile by default.

Cheers!
Reply
#2
Sorry to bump but does anyone have any suggestions for this? Have searched pretty much everywhere but can't find anything.

Remapping a key on the remote to log off would be a suitable replacement.
Reply
#3
Sorted it by remapping the red button on my remote to take me to the profile screen.
Reply
#4
You could also create a script /etc/pm/sleep.d/91xbmc. This will automatically be executed with the parameter "suspend" when you suspend the machine. This will log off the current user before the machine goes to sleep.
Code:
#!/bin/sh
[[ "$1" = "suspend" ]] && xbmc-send --action="System.LogOff"

I'm doing basically the same in my network pre-down script because I do other stuff there anyway, but this should work as well.

edit: don't forget to make the script executable (chmod +x ) and make sure you have xbmc-send installed.
Reply
#5
Interesting stuff, looks like an elegant solution.

I figure I still need the button to quick return to the login screen, for times when the box is already on. But this should put the icing on the cake.

Missus is gonna love me, more fiddling around with XBMC. She went to bed and left me to it last night Big Grin
Reply
#6
Tried this, didn't work. Sad

When enabled, pressing the power button to suspend makes the screen flash black once, then nothing. Doesn't even suspend any more. Removing the file puts things back to normal.

Any suggestions? I suppose I should drag up a logfile.
Reply
#7
Richy Freeway Wrote:Tried this, didn't work. Sad

When enabled, pressing the power button to suspend makes the screen flash black once, then nothing. Doesn't even suspend any more. Removing the file puts things back to normal.

Any suggestions? I suppose I should drag up a logfile.
Just tested it on my machine, works fine.

Please post the output of:
/etc/pm/sleep.d/91xbmc suspend

and:
ls -l /etc/pm/sleep.d/91xbmc

edit:
and /var/log/pm-suspend.log Wink

edit2:
I just saw in the Arch Linux Wiki that custom user hooks should actually be in the 00-49 range and 90-99 is reserved for "critical suspend hooks". So try to name the file 49xbmc instead. Although this shouldn't make any difference and 91 works fine for me, maybe this causes problems on your particular system setup.
Reply
#8
OK, so I first tried 49xbmc, same result.

Here's the outputs

Code:
root@xbmc:/etc/pm/sleep.d# /etc/pm/sleep.d/49xbmc suspend
/etc/pm/sleep.d/49xbmc: 2: [[: not found
root@xbmc:/etc/pm/sleep.d#

Code:
root@xbmc:/etc/pm/sleep.d# ls -l /etc/pm/sleep.d/49xbmc
-rwxr-xr-x 1 root root 71 2012-02-23 20:04 /etc/pm/sleep.d/49xbmc
root@xbmc:/etc/pm/sleep.d#

and finally, pm-suspend.log

http://rich.globular.org/pm-suspend.log
Reply
#9
There it is:

/etc/pm/sleep.d/49xbmc: 2: [[: not found

Turns out that in Ubuntu /bin/sh is not a symlink to /bin/bash (like in most distributions), but to /bin/dash, and dash doesn't unterstand [[. My bad, didn't know that.

And because the script fails, the whole suspend process fails.

replace the first line in the script with
#!/bin/bash

this should fix it.
Reply
#10
Literally as you posted this, I fixed it.

Instead of double square brackets, I changed it to single square brackets.

Code:
#!/bin/sh
[ "$1" = "suspend" ] && xbmc-send --action="System.LogOff"

Working like a dream now, exactly what I was after. Thanks for the help!
Reply
#11
Hi, can anyone post me a noddy guide on how to do this in Gotham, please?
Reply

Logout Mark Read Team Forum Stats Members Help
Profile selection screen on wake from suspend/sleep. Possible?0