17 November 2012

Using laptop as wake up radio alarm (v2)

I have the laptop connected to an external monitor (VGA).

Using lxrand I can switch off/on any/both of the screens.

The problem is that, sometimes, when I use pm-suspend, the computer enters on a 'kind of suspended mode' from where it cannot get unsuspended (resume). The only choice I have is to do a hard power-off.

I have observed that that does not happen if both screens are on, so I added one more thing to the wake up alarm line, which is getting quite long by the way.


[solution]

#Switch on both screens before suspend
su -c "DISPLAY=:0.0   xrandr --output LVDS --auto"  username



#After suspend, go back to only external monitor
su -c "DISPLAY=:0.0   xrandr --output LVDS --off"  username


What goes in the middle is now

sleep 3; chmod 666 /sys/class/rtc/rtc0/wakealarm ;  echo 0 > /sys/class/rtc/rtc0/wakealarm;   echo `date -d "tomorrow 7:05" +%s` > /sys/class/rtc/rtc0/wakealarm ; pm-suspend; sleep 10 ; grep names /etc/resolv.conf.june.2011 > /etc/resolv.conf ; mplayer-playlist http://yp.shoutcast.com/sbin/tunein-station.pls?id=65456


The grep thing is to update resolv.conf as it gets messed sometimes :o)

0 Comments:

Post a Comment

<< Home

Too Cool for Internet Explorer