preload
Jun 09

So very recently I setup up another mythtv pvr that runs in my bedroom. The point of this was to encourage me to get to bed at a decent hour and to put a stop to me falling asleep on the couch.

The setup went okay, although I must admit I encountered some issues with the whole frontend/backend slave setup which I will detail in a later post.

This post is about blanking the screen as I often fall asleep while watching a movie or show. This increases the chance of screen burn in, and is something I want to avoid.

I am still researching how this can be done automatically but in the interim I have come up with the following solution. I have setup the power button on my hauppauge remote to execute a script with changes the runlevel from 5, to 3. Essentially stopping the frontend and bringing the system down to a terminal.

Since most default installs automatically blank the terminal after a set period of time of inactivity I am set. Now when I am drifting off and far to cozy to get out of bed to shut off the monitor I can simply press power and let the system enter runlevel 3. Then after a few minutes the screen will blank automatically.

To get this to work I added the following configuration to the .lircrc file in /home/mythtv.

# Power Button begin
prog = irexec
button = Power
config = /home/mythtv/powerbutton.sh
end

With that done the next step is to create the actual script that will switch runlevels. (Keep in mind this assumes your mythtv user has sudo access to run the init command) The following script is run from /home/mythtv/powerbutton.sh.

#!/bin/bash
 
RL=`/sbin/runlevel | awk '{print $2}'`;
LOG="/home/mythtv/pb.log";
 
if [ $RL -eq 5 ]
then
   # shutdown
   sudo /sbin/init 3;
   printf "`date`: powerbutton.sh: [$RL] switching to runlevel 3\n" >> $LOG
   killall irexec
   sleep 1;
   /usr/bin/irexec &
   printf "`date`: powerbutton.sh: starting irexec.\n" >> $LOG
   sleep 1;
   setterm -reset
   printf "`date`: powerbutton.sh: resetting terminal.\n" >> $LOG
   sleep 20;
   RL=`/sbin/runlevel | awk '{print $2}'`;
   printf "`date`: powerbutton.sh: switched to [$RL], exiting.\n" >> $LOG
else
   # startup
   sudo /sbin/init 5;
   printf "`date`: powerbutton.sh: [$RL] switching to runlevel 5\n" >> $LOG
   sleep 20;
   RL=`/sbin/runlevel | awk '{print $2}'`;
   printf "`date`: powerbutton.sh: switched to [$RL], exiting.\n" >> $LOG
fi
exit 0

With that done, all that is left is to test it out. Of course you will need to either reboot to pickup the changes or restart lircd, then the mythtv frontend.

Keep in mind this is just temporary solution and not something I plan to keep doing. I know there are probably far better ways of doing this and I will be looking into them in the future.

Tagged with:
Jun 09

I was surfing around the web lastnight and happened upon a site 10 linux commands you’ve never used. I went through the list. And learned a few things. With my interest peaked I headed to the main page, and thats when I saw it.

A contest, thats right a script writing contest. Now I am no expert, but I do like to write scripts, and do like to tinker. At first I had no intention of entering, but I figured I’d give it a try and see if I could improve the script.

I tinkered and I tinkered, and finally got something working, started adding features and before I knew it I had something pretty good and useful. So I submitted it. My entry can be downloaded here.

So what is it? What is it used for? Well it allows you to make http requests to webservers via the command line. You can view the header information and raw html output.

I’m not sure how I will stack up, or how many entries have been submitted, but wish me luck still the same. For me it wasn’t about winning, it was more about writing something useful.

Tagged with:
Jun 09

Recently my need for the nice smooth look of OSX forced me into trying to take a simple kubuntu install and seeing just how close I could get it to the osx look and feel.

I used baghira to do most of this and followed the guide located here. Now I like to think I got really close, and I was very happy with the overall look and feel of the system. But the more I used it the more problems I found.

It seems baghira doesn’t play well with common linux programs like the Gimp, Firefox, and others, causing them to show up completely black, crash, or to just run like ass.

For what it was worth it was a fun exercise, but I don’t think I will try it again. Perhaps there are other forms of eye candy for linux. I will continue to play around until I have the desktop install I want. Take a look at some of the screen shots I took of my efforts.

Tagged with: