ubuntu karmic default application

1

I'm new here and new to Ubuntu too.

I want to set default application for sql and text files for opening with gedit.

I've already try 'Open with' with no success. I've also checked '/etc/gnome/defaults.list' and found this line 'text/x-sql=gedit.desktop'and I'm new but it seems fine. Don't know why I get this when I try to open mentioned files:

alt text

Marco Aviles

Posted 2009-11-28T06:02:03.980

Reputation: 125

Answers

1

Open Nautilus (the default ubuntu file browser) then go to edit->preferences and to the behaviour tab. Then check the option:

view executables text files...

mrucci

Posted 2009-11-28T06:02:03.980

Reputation: 8 398

3

Right click on the files that you want to change the default application for (your sql and text files) and click Properties:

alt text

Navigate to the Open With tab and you can change the default application with the radio button:

alt text

John T

Posted 2009-11-28T06:02:03.980

Reputation: 149 037

1don't want to be impolite but I posted "I've already try 'Open with' with no success" – Marco Aviles – 2009-11-28T15:46:22.243

The open with from the context menu is not the same as the one in properties, which one have you tried? – John T – 2009-11-28T22:46:09.340

2

You're getting that because the file is marked as executable. The file manager is just saying "hey! do you want me to run this as a program, or open it as a text file?"

Does it open in GEdit properly if you click "Display"? If so, your file associations are set correctly. You can then get rid of this extra dialog with one of the following:

  • Follow mrucci's answer to tell Nautilus to just display executable text files instead of offering to run them. OR...

  • Remove the executable permission from the file if it doesn't need it. Run chmod -x myfile.sql on the file to remove the executable bit. Then Nautilus won't offer to run it.

The second option is not doable with chmod on FAT32 or NTFS filesystems. You'd have to mount the drives with certain mount options (eg -o noexec) to get the same effect.

Edit: There is a third option. Instead of double-clicking to auto-open the files, get into the habit of right-clicking and choosing the "Edit" option. This is what I do on Windows with .bat files, and in Thunar on Xubuntu with shellscripts (.sh) -- I don't know offhand but I'd expect the default file manager in Ubuntu can do this too. It's a good habit to get into -- even if I tweak my computer to behave "properly", someone else's system won't behave the same.

quack quixote

Posted 2009-11-28T06:02:03.980

Reputation: 37 382

0

Nautilus -> Edit -> Preferences

enter image description here

Jeffrey Vandenborne

Posted 2009-11-28T06:02:03.980

Reputation: 438