Saturday, March 31, 2012

Setting Picasa Photo Viewer as the Default Image viewer in Linux Mint (12)

There are some things in life, you can't just compromise upon. Image viewer is one of them and Picasa Photo Viewer happens to be my favorite amongst all that I have used till date. So, when I moved to Linux Mint (Lisa), I was itching to use the same on Linux too. As it turned out, some gentleman (caiacoa) had designed a wrapper (it actually still runs through wine) for Picasa Photo Viewer and to open a particular image, one had to just type

/usr/bin/PicasaPhotoViewer <Image-File-Name>


However, it is rather cumbersome to go to the terminal every time to open a image(!), and if you wanted to set the default image viewer through 'right-click->Properties', Picasa Photo Viewer just won't show up in the list. In Ubuntu, we do have a field (a text box) to specify the path of the app to open a particular file; but in Linux Mint, they don't have even that.

The solution that I found out, is as follows:

The problem basically was to get 'PicasaPhotoViewer' listed in the list of applications, when one does a right click->Properties->Open With. And this link got me going (see last point: TroubleShooting).

This was just a minor variation of what is mentioned in the link above. Instead of PicasaPhotoViewer.desktop being located at /usr/share/applications, it was located at /usr/local/share/applications/PicasaPhotoViewer.desktop. As also mentioned on the linked page, adding a %U to the Exec line did the trick.
ie.
< Exec=PicasaPhotoViewer # Goes out
> Exec=PicasaPhotoViewer %U # Comes in

Picasa Photo Viewer would now show up as an app to open images, and rest is easy.

P.S: Btw, I also found a small bug in /usr/bin/PicasaPhotoViewer script. Would post on it, once it is confirmed by the developer Irakli Gozalishvili.

/etc/motd

Ever wondered, what does 'motd', as in, /etc/motd - the ubiquitous file that contains the 'welcome message' to greet any user who logs in - stand for? Well, it stands for - "Message of the day". Pretty guessable, I guess.

Thursday, March 29, 2012

File Name pattern matching versus Regular Expressions

"Wherever women are concerned, the unexpected always happens!" - so goes the saying. However, I would say, add 'unix' to it too.

So, it happened that I was using 'find' command to find a certain set of files:

  • find . -name "filename*"
Now, having been brought up on the diet of regular expressions, I naively assumed that "filename*" must be also acting as a regular expression. However, as it turned out instead of being a regular expression, it is what they call a 'shell pattern'. To cut the long story short, the semantics of special characters in shell-pattern is different than that in regular expressions.
For example, the asterisk (*) means matching zero or more of any character in shell-pattern while in case of regular expressions, it means matching zero or more of the previous character, which could change the meaning entirely depending on context.

Find more on this at:


hello world

This blog is going to be a dump of all the interesting (annoying?) things that I come to know about Unix, Networks and all things computers, in daily life. Basically, it is to serve as a persistent record of all the good things in this world, so that I don't have to run back and search for that elusive URL in my browser's history again and again. That others might find it useful, is an added bonus and a minor motivation.