Create a file setwakeup.sh in /usr/bin:
sudo nano /usr/bin/setwakeup.sh
Quellcode
1
2
3
4
5
6
#!/bin/sh
#$1 is the first argument to the script. It is the time in seconds since 1970
#this is defined in mythtv-setup with the time_t argument
echo 0 > /sys/class/rtc/rtc0/wakealarm #this clears your alarm.
echo $1 > /sys/class/rtc/rtc0/wakealarm #this writes your alarm
Make sure it is executable:
sudo chmod +x /usr/bin/setwakeup.sh
No you have to add your user or group to enable XBMC executing sudo elevation on the command.
sudo visudo
Add the following to the end of the file:
Quellcode
1
%xbmc ALL = NOPASSWD: /usr/bin/setwakeup.sh, /usr/sbin/pm-suspend
Replace %xbmc by the group of your user, or just use xbmc without % for the user only. If xbmc is the default user for XBMCBuntu (I don't know), the line would be:
Quellcode
1
xbmc ALL = NOPASSWD: /usr/bin/setwakeup.sh, /usr/sbin/pm-suspend
Now in the XBMC configuration, go to Settings, TV, Energy and fill in the wake up command
sudo setwakeup.sh
Now when XBMC suspends, it will call sudo setwakeup.sh *timestamp* and it will always log an error in xbmc.log about a -1 exit status. Ignore that.
You can check if the correct time is written using
cat /sys/class/rtc/rtc0/wakealarm
You will get a timestamp there and run it through this website for a human readable time:
http://www.epochconverter.com/