Sunday, May 20, 2012

Open Any File With One Command - xdg-open

When working in a terminal sometimes I want to open a file. I use the command xdg-open. This command will open the file in your preferred application. xdg-open is probably my most frequently used command. Here is a video demonstration of xdg-open.

Tuesday, May 15, 2012

Setting Up the MythTV Pretty Filenames Script

MythTV recording file names look like this: 1320_20120515120000.mpg. You can use a contributed perl script to create a symbolic link that looks like this: House_2012-05-14_9-00_PM_Holding_On.mpg

On my system, Ubuntu 12.04 MythTV 0.25, the perl script created by Chris Peterson is located here: /usr/share/doc/mythtv-backend/contrib/user_jobs/

You can set the script to rename your recordings after they are written with a MythTV user job but I prefer to run the script every hour.

This is the method I use. I setup my directory to hold the symbolic links and put my script in the /etc/cron.hourly directory. Below are the commands to set up the directory (your directory names will be different):

  • sudo mkdir /mnt/disk0/mythtv/pretty
  • sudo chown mythtv /mnt/disk0/mythtv pretty
  • sudo chgrp mythtv /mnt/disk0/mythtv pretty
  • sudo chmod g+w /mnt/disk0/mythtv/pretty

Create the script using nano text editor.

sudo nano /etc/cron.hourly/mythpretty

The script is just a one liner.

/usr/bin/perl /usr/share/doc/mythtv-backend/contrib/user_jobs/ --underscores --link /mnt/disk0/mythtv/pretty  --format %T_%Y-%m-%d_%g-%i_%A_%S

Make the script executable.

sudo chmod +x /etc/cron.hourly/mythpretty has many format options. You can read about here:

Monday, May 14, 2012

Custom MythTV Icon For Ubuntu Unity Launcher

To create an icon on the Ubuntu 12.04 Unity Launcher for a MythTV frontend with a certain window size, I created a text file ~/.local/share/MythTV800x450.desktop. I put the text below in the file. In Nautilus I set the file as executable and dragged the file to the Unity Launcher.
[Desktop Entry]
Name=MythTV 800x450 
Comment=MythTV 800x450 
Exec=mythfrontend -geometry 800x450
GenericName[en_US.UTF-8]=MythTV 800x450