Feeds:
Posts
Comments

Archive for the ‘File Management’ Category

If you’ve upgraded to Ubuntu 13.04, you may have noticed that its file manager, Nautilus, has lost some of its functionality. One of the glaring omissions in the 3.6x versions (the current is 3.6.3) is the Open With sub-menu when right-clicking a selected folder. Previously, you could use it to open a folder with a program, like Movie Player (now called Videos, though technically it’s totem) to open a folder full of video clips, or a folder full of pictures with Image Viewer (or eogEye Of Gnome – to be precise).

In this guide I’ll show you how to do both, but you can of course apply this to any program you want, as long as it has the ability to open a folder starting with the first file. In the case of Image Viewer, it will open the first file within the folder and continue to cycle through the rest as you use your arrow keys; in the case of Videos, it will open the media player with all videos from the selected folder in its playlist, in alphanumerical order.

To get around the missing Open With option, you will first need to install Nautilus Actions. To do so, run the following command in the terminal:

sudo apt-get install nautilus-actions

Once installed, you can use the Nautilus-Actions Configuration Tool to define your own actions (in Unity’s Dash menu, just start typing the name; in Gnome Classic, it will be in Applications > System Tools).

New Menu Item for Image Viewer:

In the Nautilus-Actions Configuration Tool, click the Define a new action button and name that action to what you want to appear in the menu (eg: Open with Image Viewer; whatever name you choose will also appear in the Context label: field in the first tab in the right-pane, Action).

Nautilus-Actions: Adding Image Viewer to Context Menu

Making sure that the new action is selected in the left-pane, in the right-pane go to the second tab – Command – where you define what that menu option will do. For the Path: enter eog (or the full path /usr/bin/eog), for Parameters: enter %b (for first basename), and finally for Working directory: enter %d (for first base directory). While there are a bunch of other tabs in the tool, that is all you should need to do.

Nautilus-Actions: Adding Image Viewer to Context Menu Step 2

If you want to add an icon for that menu option, you will see Icon: in the Action tab, where you can browse for an icon to use.

Nautilus-Actions Icon Chooser

Once you’re finished, click the Save button, and exit the tool. You will find your new action in the Nautilus-Actions actions sub-menu in your context menus.

Nautilus-Actions: Adding Image Viewer to Context Menu (DONE!)

(OPTIONAL: If you also want this action to appear in context menus for locations – in other words, not just the selected folder, but when you right-click an empty area of the folder you’re currently in – check the box next to Display item in location context menu in the Action tab)

New Menu Item for Movie Player (Videos):

In the Nautilus-Actions Configuration Tool, click the Define a new action button and name that action to what you want to appear in the menu (eg: Open with Movie Player or Play Movies in Folder; whatever name you choose will also appear in the Context label: field in the first tab in the right-pane, Action).

Nautilus-Actions: Adding Movie Player/Videos to Context Menu

Making sure that the new action is selected in the left-pane, in the right-pane go to the second tab – Command – where you define what that menu option will do. For the Path: enter totem (or the full path /usr/bin/totem), for Parameters: enter %b (for first basename), and finally for Working directory: enter %d (for first base directory). While there are a bunch of other tabs in the tool, that is all you should need to do.

Nautilus-Actions: Adding Movie Player/Videos to Context Menu Step 2

If you want to add an icon for that menu option, you will see Icon: in the Action tab, where you can browse for an icon to use.

Nautilus-Actions Icon Chooser

Once you’re finished, click the Save button, and exit the tool. You will find your new action in the Nautilus-Actions actions sub-menu in your context menus.

Nautilus-Actions: Adding Movie Player/Videos to Context Menu (DONE!)

(OPTIONAL: If you also want this action to appear in context menus for locations – in other words, not just the selected folder, but when you right-click an empty area of the folder you’re currently in – check the box next to Display item in location context menu in the Action tab).

☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻

Did this information make your day? Did it rescue you from hours of headache? Then please consider making a donation via PayPal, to buy me a donut, beer, or some fish’n’chips for my time and effort! Many thanks!

Buy Ubuntu Genius a Beer to say Thanks!

Advertisements

Read Full Post »

If you’ve upgraded to Ubuntu 13.04, you may have noticed that its file manager, Nautilus, has lost some of its functionality. One of the glaring omissions in the 3.6x versions (the current is 3.6.3) is the ability to open selected folders in their own windows.

Nautilus 3.6 Options for Selected Folders

Nautilus 3.6 Options for Selected Folders

Currently, the only options available when you right-click selected folders are to create a new folder containing whatever is selected, or to open them in new tabs. The Open option simply mimics the next option, which is to open them in new tabs. The only way at all to open another (single) folder in a new window is if you right-click the breadcrumb in the toolbar.

Right-clicking Pictures lets me choose to Open in New Window

Right-clicking Pictures while in a sub-folder lets me choose to “Open in New Window”

However, there is a way around this: Nautilus Actions. To install it, run the following command in the terminal:

sudo apt-get install nautilus-actions

Once installed, you can use the Nautilus-Actions Configuration Tool to define your own actions (in Unity’s Dash menu, just start typing the name; in Gnome Classic, it will be in Applications > System Tools).

Nautilus-Actions: Open in New Window

In the Nautilus-Actions Configuration Tool, click the Define a new action button and name that action to what you want to appear in the menu (eg: Open in New Window; whatever name you choose will also appear in the Context label: field in the first tab in the right-pane, Action).

Nautilus-Actions: Defining the Action

Making sure that the new action is selected in the left-pane, in the right-pane go to the second tab – Command – where you define what that menu option will do. For the Path: enter nautilus (or the full path /usr/bin/nautilus), for Parameters: enter %b (for first basename), and finally for Working directory: enter %d (for first base directory). While there are a bunch of other tabs in the tool, that is all you should need to do.

If you want to add an icon for that menu option, you will see Icon: in the Action tab, where you can browse for an icon to use.

Nautilus-Actions Icon Chooser

Once you’re finished, click the Save button, and exit the tool. You will find your new action in the Nautilus-Actions actions sub-menu in your context menus.

Nautilus-Actions: Open in New Window

☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻

Did this information make your day? Did it rescue you from hours of headache? Then please consider making a donation via PayPal, to buy me a donut, beer, or some fish’n’chips for my time and effort! Many thanks!

Buy Ubuntu Genius a Beer to say Thanks!

Read Full Post »

If you’ve installed a program for working with specific file types, you might find that Ubuntu‘s file manager Nautilus has no idea about it when you right-click a file and go to Open With, where a list of alternative programs to the default are presented. While in most cases that new app will be found when you choose Other Application… from the context menu, sometimes this isn’t the case.

Back in Gnome 2.x, if the program wasn’t listed, you could choose to add a custom application, which let you specify the command manually. However, this is no longer the case, but there should be another way to rectify this (see also the command-line interface method at the bottom).

In this example, we’ll look at getting Nautilus to recognise PDF Editor (pdfedit) as a viable program when right-clicking PDF documents, since the file manager doesn’t know it exists, and one can no longer just specify pdfedit as a custom command (at least via the GUI).

While you could be forgiven for thinking you’d need to hack a list of applications (for example, ~/.local/share/applications/mimeapps.list), the answer in fact lies in editing the .desktop file of the newly-installed program, and simply inserting three characters into it. Basically, this will allow Nautilus to add it to its context menu (actually, it specifies that the application can be passed a filename, which is what is missing).

All you need is the actual command that runs the program (e.g. pdfedit for PDF Editor), and you should be able to guess the .desktop file’s name (e.g. pdfedit.desktop), and open it for editing with the following command (replacing pdfedit with the appropriate name in your case):

gksudo gedit /usr/share/applications/pdfedit.desktop

(Note that the .desktop files should be in /usr/share/applications, but if not will be in ~/.local/share/applications, so change the path accordingly if you need to. Also, if you cannot correctly guess the .desktop file’s name, you can get the correct name by going to the folder and browsing for it).

[Desktop Entry]
Name=PDF Editor
Comment=PDF Editor
Exec=pdfedit
Icon=/usr/share/pdfedit/icon/pdfedit_logo.png
Type=Application
StartupNotify=false
Terminal=false
Categories=TextTools;Viewer;Graphics;Qt;

Find the Exec= line and you will see the command listed after it. Simply go to the end of the line, hit the spacebar, and add %f, so the line looks like:

Exec=pdfedit %f

(Once again, substitute your command’s name for pdfedit).

Simply save the file when exiting, and you shouldn’t even need to restart Nautilus, let alone log out or totally reboot. You should immediately see the desired program in the list of apps presented in Other Application…, and once you open a file with it, the app should be easily accessible in the list of secondary programs found in Open With.

If you want to make that program the new default for opening the particular filetype, you can now right-click one, choose Properties, go to the Open With tab, click on the app under Recommended Applications, and click the Set as default button.

CLI Method to Change Application & Set Default:

You can easily open a file with another application using the mimeopen command in the terminal. However, if the program isn’t already in the list of recommended applications, you’ll need to make it the default for that filetype first. Simply open a terminal in the folder where the file is and run a command like the following (substituting Recipes.pdf with the appropriate filename and filetype):

mimeopen -d Recipes.pdf

Please choose a default application for files of type application/pdf

1) GIMP Image Editor (gimp)
2) Adobe Reader 9 (AdobeReader)
3) Document Viewer (evince)
4) Other…

use application #4
use command: pdfedit

Simply choose the number that corresponds to Other… (in this case it’s 4), then type the command of the program after use command: (you probably won’t need to specify the path, but if it doesn’t work without it, it should be something like /usr/bin/pdfedit).

After that, you can switch default applications quite easily with the above command, or use the --ask option to just open the file in the desired app without changing the default (note there is no option to choose Other…, which is why you have to use the -d switch first):

mimeopen --ask Recipes.pdf

Please choose an application

1) pdfedit (pdfedit-usercreated-2)
2) GIMP Image Editor (gimp)
3) Adobe Reader 9 (AdobeReader)
4) Document Viewer (evince)

use application #

☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻

That’s it – hopefully with either of the methods you’re not cursing Nautilus any more, and have more control of your filetypes than your file manager currently provides.

☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻

Did this information make your day? Did it rescue you from hours of headache? Then please consider making a donation via PayPal, to buy me a donut, beer, or some fish’n’chips for my time and effort! Many thanks!

Buy Ubuntu Genius a Beer to say Thanks!

Read Full Post »

If you’ve attached an external hard drive for backing up your files, or created a new partition for storage, only to find you don’t have the permissions to use it, you’d be understandably frustrated. But it’s actually quite easy to remedy by simply running a command in the terminal in the form of:

sudo chown -R username:username /partition/mount-point

Note that the above isn’t the actual command you’ll be using, as you’ll need to replace each instance of username with your actual username, and also determine your mount-point, which is not the device name (eg: /dev/sdb1).

To find the mount-point, run mount in the terminal, and locate the line that corresponds to the drive or partition in question. If you have never named (or set the label for) it, it will probably look something like:

/dev/sdb1 on /media/bf9a2c45-491a-4778-9d76-47832fe38820

If you have set the label with something descriptive, it should like similar to:

/dev/sdb1 on /media/1Tb Pocket Drive

As you can see, your mount-point will look something like /media/bf9a2c45-491a-4778-9d76-47832fe38820 or /media/1Tb Pocket Drive, so all you need to do now is run a command like one of the following, replacing the relevant info with what is appropriate to you:

sudo chown -R billgates:billgates /media/bf9a2c45-491a-4778-9d76-47832fe38820

sudo chown -R billgates:billgates '/media/1Tb Pocket Drive'

Note that if your custom label contains spaces (e.g. 1Tb Pocket Drive) , you will need to enclose the entire mount-point path in single quotes, but won’t need them if it’s a single word or multiple words joined by hyphens or underscores.

That’s it – you should now be able to do whatever you want with the drive or partition in question, as you’re now the owner.

☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻

Did this information make your day? Did it rescue you from hours of headache? Then please consider making a donation via PayPal, to buy me a donut, beer, or some fish’n’chips for my time and effort! Many thanks!

Buy Ubuntu Genius a Beer to say Thanks!

ption]

Read Full Post »

If you’ve attached an external hard drive to your system, then decided to use your partitioner to format it to EXT4 for greater efficiency (or just to match your Ubuntu system), you may have been shocked to find that your empty drive seemed to be missing a few gigabytes when mounted afterwards. And this has nothing to do with the good old binary (base-8) vs decimal (base-10) situation which would see your “750Gb” drive be more like 700Gb (in Windows and earlier versions of Ubuntu – now Mac OS X and Ubuntu have followed hardware manufacturers and use decimal, so that’s more like 738Gb).

This is because Ubuntu (and other Linux distributions) reserve typically around 5% of the space for the root user and system services, so should you run out of hard drive space, the administrator can still log in, and system services continue to run.

However, this is only really needed for your Ubuntu partition, so if you have an external EXT4 drive, or have an EXT4 partition on your internal drive (other than the one your system is on), you are needlessly wasting space (40Gb of the drive in the example). But you can free up that disk space quite easily, without having to re-partition the drive or anything. All it takes is a couple of commands pasted into the terminal.

In the following example, an external hard-drive will have the reserve set to 0 (zero), since this is what most people will need this for. First, we have to determine the device name, as using its mounted name – /media/700Gb Ext4 – won’t suffice. To do so, enter the following into the terminal:

mount|grep ^'/dev'

Look for the line containing your device:

/dev/sdc1 on /media/700Gb Ext4 type ext4 (rw,nosuid,nodev,uhelper=udisks)

… and you can see what it is named (/dev/sdc1 in this case). To free up reserved space, enter the following (replacing /dev/sdc1 with whatever the appropriate device name is, if need be – just make sure you don’t do it to your main drive!):

sudo tune2fs -m 0 /dev/sdc1

You should then be presented with the following message:

Setting reserved blocks percentage to 0% (0 blocks)

To confirm all has gone well, you can right-click an empty area of the folder window for the device and choose Properties, then compare the free space from before and after, or run the following command (once again replacing the device name with the correct one in your case):

sudo tune2fs -l /dev/sdc1 | grep 'Reserved block count'

You should be greeted with the following:

Reserved block count: 0

That’s it – you now have all of your drive to use.

ΘΘΘΘΘΘΘΘΘΘΘΘΘΘΘΘΘΘΘΘΘΘΘΘΘΘΘΘΘ

Note: if you receive the following error message:

tune2fs: Bad magic number in super-block while trying to open /dev/sdb1
Couldn’t find valid filesystem superblock.

… then the filesystem likely isn’t EXT4 – chances are the drive is actually formatted as NTFS or FAT for use on Windows systems (which would be the case if you’ve bought an external drive, and never did anything other than copy files to it). You would have needed to partition/format the drive to EXT4, so if you didn’t, then you actually don’t need this guide.

☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻

Did this information make your day? Did it rescue you from hours of headache? Then please consider making a donation via PayPal, to buy me a donut, beer, or some fish’n’chips for my time and effort! Many thanks!

Buy Ubuntu Genius a Beer to say Thanks!

Read Full Post »

If you’ve upgraded your Ubuntu system to 11.10, or have a fresh install, you might find that when you right-click a USB drive and choose “Safely Remove Drive” in the left pane in Nautilus, the system hangs. This appears to affect some users of the Linux kernel 3.0.0-12, which at this early stage would be what most users have, so if this applies to you, it should be easy enough to fix.

Go to http://people.canonical.com/~ogasawara/lp844957/ and into the folder for your architecture (i386 or amd64). Install the 3 .debs located therein (I did so with GDebi, but should be the same in Ubuntu Software Centre, just slower), and reboot. You should now be able to successfully remove the drive without issue the next time you connect it.

NOTE: What you’re actually doing here is replacing the 3 main kernel packages, but for me and a bunch of others affected, there were no issues, with kernel 3.0.0-13 replacing the old one in GRUB, booting into Ubuntu just fine, and resolving the freezing issue when trying to remove USB drives.

Do not use this if your kernel is a later version (i.e. higher than 3.0.0-13). It probably wouldn’t kill your system, but reverting to an earlier kernel is extreme measures, so try find a more current and applicable solution (this fix appeared within days, so it does pay to spend a few minutes looking around the web, especially the Ubuntu Forums).

☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻

Did this information make your day? Did it rescue you from hours of headache? Then please consider making a donation via PayPal, to buy me a donut, beer, or some fish’n’chips for my time and effort! Many thanks!

Buy Ubuntu Genius a Beer to say Thanks!

Read Full Post »

Ever since Ubuntu 10.04 “Lucid Lynx”, there has been a white border around thumbnails of pictures and videos when you look in a folder. But you can actually change that to whatever you want, and here I’ll show you how to turn the distracting white border into a nice drop-shadow, free of any other border.

Open a terminal and enter the following:

wget http://a.imageshack.us/img135/8666/thumbnailframe.png

That will download the image file to your home folder; the following command will then move it to the folder where Nautilus (your file manager) keeps its image files, renaming it appropriately as it does so:

sudo mv thumbnailframe.png /usr/share/pixmaps/nautilus/thumbnail_frame.png

Now, you need to totally restart Nautilus:

sudo nautilus -q

If you decide that you want to restore the original white border, you can basically run the same sequence again, but this time downloading the familiar thumbnail background:

wget http://a.imageshack.us/img651/5790/thumbnailframey.png

sudo mv thumbnailframey.png /usr/share/pixmaps/nautilus/thumbnail_frame.png

nautilus -q

***************

Additional notes:

Obviously, you can play around with your own thumbnail borders using the dimensions of the drop-shadow image (quite simply a square).

Also, if you would prefer to copy rather than move the image files to the Nautilus folder, thereby always having copies in your home folder, replace mv (move) in the command with cp (copy).

***************

Just in case the images are no longer available, you can find them below. Simply right-click them and (1) in the case of the larger drop-shadow image, choose to save the target of the image (or open it in a new tab and save the image that appears), and (2) in the small default image below it, choose to save the image. If you saved them to your home folder, the second command in each sequence will still apply; if you saved them to another folder, like ~/Downloads, open a terminal in that folder and the commands will work fine.

Right-click & save the target (not this smaller image)

Right-click & save this image

***************

☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻

Did this information make your day? Did it rescue you from hours of headache? Then please consider making a donation via PayPal, to buy me a donut, beer, or some fish’n’chips for my time and effort! Many thanks!

Buy Ubuntu Genius a Beer to say Thanks!

Read Full Post »

Older Posts »