Here's a thing. I don't usually have a keyboard plugged in, and synergy segfaults right now. Sometimes, XBMC crashes, and I'd like to restart it without having to bother with my laptop and ssh and stuff.
I have CTRL, ALT and BACKSPACE all mapped on my wiimote, so I thought - I can reboot X that way, and that'll restart XBMC as well. But no!
Ctrl-Alt-Backspace rebooting of X has been disabled in recent xorg builds. Add this to your /etc/X11/xorg.conf to re-enable it:
Code:
Section "ServerFlags"
Option "DontZap" "false"
EndSection
Restart X, etc.
But, I think due to not using a display manager, X only stops on Ctrl-Alt-Backspace, not restarts. This is unideal, and I don't want to waste ram and startup time using (x|g)dm. Time for some more clever I found somewhere else on the internet:
in your xbmc user's .bash_profile, have the following:
Code:
# start x for tty1. respawn if x stops.
if [ $(tty) == /dev/tty1 ]; then
startx
logout
fi
BAM. You can now restart X using nothing more than a wiimote. Stop x, bash logs you out, event.d logs you back in, x restarts.
It does mean having two whole buttons mapped for CTRL and ALT (BACKSPACE is useful for 'back up one folder'), but I wasn't doing anything else with those buttons anyway.
This probably won't work if you're using XBMC's InputClient for the wiimote. I'm using wminput as described earlier in this guide.
Great howto, btw. Thanks very much.