Feeds:
Posts
Comments

Posts Tagged ‘application’

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 »

When you uninstall a program in Ubuntu, sometimes bits and pieces like configuration files are left behind. Occasionally this is a good thing, like when you remove a program due to some issues you’re having with it and then reinstall it again, since your old settings are usually restored.

But more often than not, when a program is uninstalled it is because the user doesn’t want it, so any remaining configuration files are just wasting space. And often in the case of trying to reinstall a program to get it to work properly, a configuration setting is what is causing the issue, so a complete removal is needed.

There are 2 ways to go about this: via the user-friendly GUI of Synaptic (or your preferred package manager), or the much faster way of command-line in a terminal.

Either way, you’ll of course need to know the name of the program, and if possible the actual package name. While often the package name is the same as the program’s displayed name, but in lowercase, this isn’t always the case, so if unsure check out these ways of finding out.

If you want to use Synaptic, open it and enter the name of the program or package in the Quick search bar. When it and related packages appear, right-click the main package and choose “Mark for Complete Removal“.

It is usually fairly easy to tell which is the main base package; if the name isn’t a give-away, the information after it should clear things up. For example, AbiWord is actually abiword, so is instantly recognisable from the other packages that install with it.

When you “Mark for Complete Removal“, you will be informed if other packages also need to be removed, meaning you don’t have to do this manually.

When you accept the proposed changes, you will see that the program and additional packages will be removed. If there are other related packages that haven’t been automatically selected, you can do so manually before proceeding.

When ready, simply click the Apply button in the Synaptic toolbar. You will receive a final request for confirmation, after which the program will be removed, along with the extra packages and any configuration files.

As in the case of the AbiWord example, not everything is always automatically selected for removal, so it pays to look through the search results and see if anything needs to be removed manually (abiword-common is actually larger than the other packages combined at nearly 9Mb). Doing this before proceeding with the last step will save you coming back later.

If you prefer the quicker command-line method, open a terminal and enter:

sudo apt-get purge packagename (replacing “packagename” with the actual name of the package in question).

If you’re familiar with apt-get remove and wondering what is the difference, especially since additional packages are also marked for removal, the answer is that configuration files are often left behind if you simply “remove” the app. To get that command to work, the --purge option needs to be added (eg: sudo apt-get remove --purge packagename). You will still see much mention online that this is the way to do it, but since then the purge command has been added to apt-get, so this is no longer needed (though for backwards compatibility, remove --purge will continue to work).

Either way you choose to do it, you should be able to get rid of all the junk that programs can leave behind when simply removed. Just keep in mind that if you ever saved any settings or user profiles etc, occasionally these can still be left behind, but they will be in config folders within your home folder (you might need to enable displaying of hidden files and folders). If you ever get a message that a certain folder could not be removed, or a certain file, just go in there later and remove it.

°ºÒθÓº°¤°ºÒθÓº°¤°ºÒθÓº°

Leave some unwanted packages behind? It’s actually pretty easy to get rid of the vast majority of packages that weren’t automatically selected for removal. When you install via the terminal, you will notice that a list of orphaned packages is presented along with the simple command to remove them all in one go.

As you can see in the example, after uninstalling AbiWord the abiword-common package was left behind (not to mention a few libraries), but you can easily remove it and others taking up space with the following command:

sudo apt-get autoremove

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

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 »

Sometimes the easiest solution is right in front of our eyes, and we fail to see it (probably because it’s too obvious). While looking through the forums it’s become evident to me that some people are needlessly driving themselves nuts browsing through categories in Synaptic Package Manager, desperately trying to find that program to install or remove, when they could be using the Quick search bar in plain view in the toolbar.

While the program’s displayed name and actual package or command name can vary, in most cases, typing in either will get you results.

If you know the actual package name, type that in, otherwise just type in the displayed name you’re familiar with. Results will immediately appear underneath.

You can even use this just to find out the package name, which could be handy for recreating a launcher you deleted. As an example, if you accidentally deleted the “Compiz Fusion Icon” launcher from your System Tools menu, you could type that into the Quick search bar and find that fusion-icon is the actual command, so use that info to make a new launcher.

Of course, if you’re looking for new software for specific tasks, and don’t know any program names, you need another approach. While I actually recommend Googling to find what’s out there, so you can read reviews and see screenshots, it’s actually very easy to use Synaptic to do it all for you. While there are different categories you can browse on the left, that can be somewhat overwhelming. So simply enter the type of software you are looking for, and you should get some results to browse through.

You can then view all the info that the developer has given by clicking on a program and reading what’s in the Description tab at the bottom.

You can add important words to help limit your results. For example, “video convert” will weed out the players, libraries, plugins and codecs that would also be presented if you merely typed in “video“.

You can then look at the Description to see if the programs are what you need.

Using these simple methods, you should be able to find all the software you’ll ever need. Note that to increase your chances of finding everything that’s available, Synaptic‘s list of repositories (ie: places to find software) needs to be a fair bit more extensive than you get in a vanilla install of Ubuntu. So check out these topics on how to add more repos:

Add the Universe and Multiverse Repositories

Add More Repos & Play Encrypted DVDs with Medibuntu

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

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 »

It doesn’t matter whether you’re using Windows, Mac OS, or a Linux distro like Ubuntu, the names programs display in the titlebar and the names of the actual files that run them can be quite different. A familiar example for many would be Microsoft Office Word (or Word for Windows in the old days) – or winword.exe, to be precise.

In Ubuntu, you can guess the package names of many programs simply by making all characters lower-case, and perhaps removing a space between words, or even abbreviating it. For example, KAlarm is actually kalarm, tovid GUI is tovidgui, and Downloader for X is d4x.

But you can’t guess them all, so you’ll need to look at the properties of launchers to the programs you want to know more about. Since you can’t really right-click launchers in the Applications menu for this purpose, by far the easiest method is to temporarily add them to your panel (or desktop), then just delete them when no longer needed. You can actually get the properties of launchers while editing the Applications menu, but this method is simpler and quicker.

For any program you need to know the package name of, right-click it in the Applications menu and choose either Add this launcher to panel or Add this launcher to desktop. When you right-click the new launcher on your panel or desktop, choose Properties, and the Command field will reveal the program’s actual name.

Just remember to ignore any options on the end of a command, since a program name must be one word without spaces (this can of course include many words strung together with hyphens or underscores). So while Amarok‘s launcher says amarok %U, the %U is an option, and amarok is the command. Even if you can see nothing familiar, you can bet whatever the command starts with, and is before the first space, is the command. For example, Downloader for X is actually no longer d4x, and since the command string is now nt -a %U, one has to assume nt is now the name of the command that runs this program.

The exceptions to this rule are when the path or address of the command is specified, or when another command precedes it. A good example is gksu /usr/sbin/firestarter for Firestarter, as not only is the path specified before the command, firestarter, but in order to run it with superuser privileges, the whole lot starts with gksu (basically, sudo for GUI programs). In a situation like this, one would look to the end, not the beginning.

If you need to find out the version numbers of installed packages, read this.

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

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 »

When you right-click a file, there is a wealth of options available in the context menu that appears. At the bottom, you’ll notice Properties, and clicking it will let you change all sorts of things, and give you lots of info about the file (depending on the file-type).

In the first tab, Basic, you’ll see you can rename the file, and if you click on the icon on the left, you can change it to whatever you want. Note that this will change the icon only for the file specified, not all others of the same extension. If you want to change the icon for a whole file-type, read about creating your own mimetypes in Ubuntu.

If you’re ever having permissions trouble with a file, go to the Permissions tab and make sure you have full Read and write access. Also, if files of a specific extension are not opening in anything (and a default program has been specified), or if scripts aren’t being executed, or certain text files not opening, then you may need to tickAllow executing file as program.

The last thing you can do is change the default application for the whole file-type under Open With, and all you need to do is select another from the list. You can +Add more, and if the app you want isn’t in the list that is presented to you, you can create your own custom command instead. In this example of .txt documents, if the desired program, Leafpad, isn’t in the Open With list, and isn’t presented after clicking +Add, you could type leafpad as the custom command.

So there you have a few ways to get greater control over your files. As you can see, changing the default program a file-type opens in is a quick and easy task, and you can customise your most important files to have their own unique icons.

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

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 »

The 4.x incarnation of KDE is still pretty much in its infancy, so there are still bugs to be ironed out, especially when it comes to running them in Ubuntu‘s default desktop environment, Gnome. I’ve noticed bits and pieces of programs don’t always display properly, like when I click on an alarm task in KAlarm to edit it. Basically, the box pops up, but all I can see is the charcoal KDE4 background, and clicking around in it does nothing.

But I found if I maximise it, suddenly everything appears, then I can then restore the dialogue box to its proper size (not that I really need to), and then proceed with the task. So if you get the same thing happening with a KDE4 app in Gnome, try maximising it to see if it makes a difference.

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

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 KAlarm has begun crashing on loading, try entering kalarm & in the terminal and hopefully it will open fine. If it does, exit the program properly (ie: don’t just close the terminal), which you can do by right-clicking its icon in the system tray. Then restart KAlarm via its launcher and, with luck, it should now load without issue.

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

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 »