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/mythlink.pl

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.

#!/bin/sh 
/usr/bin/perl /usr/share/doc/mythtv-backend/contrib/user_jobs/mythlink.pl --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

Mythlink.pl has many format options. You can read about Mythlink.pl here: http://www.mythtv.org/wiki/Mythlink.pl

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]
Encoding=UTF-8
Name=MythTV 800x450 
Comment=MythTV 800x450 
Icon=mythtv
Exec=mythfrontend -geometry 800x450
Terminal=false
Type=Application
Categories=GNOME;Application;AudioVideo;Audio;Video
X-AppInstall-Package=mythtv
GenericName[en_US.UTF-8]=MythTV 800x450