Default applications [SOLVED]

Archived topics about LMDE 1 and LMDE 2
Locked
alakin

Default applications [SOLVED]

Post by alakin »

I installed WINE a short while ago bacause there was a specialst app that I wanted to take a look at. Since then, if I double click on a file in thunar it automatically tries to use a Windows app to load the file e.g. text files default to Notepad rather than Gedit. I can right click and select the appropriate app but needless to say I usually remember to do that a split second after double clicking on a jpeg only to find Internet Explorer loading :shock: Is there a simple way to change the behaviour (other than removing WINE)?

Thanks.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
xenopeek
Level 25
Level 25
Posts: 29597
Joined: Wed Jul 06, 2011 3:58 am

Re: Default applications

Post by xenopeek »

I tried Wine once, this happened... Purged it immediately :twisted: Anyway, you can easily fix this :wink:

Open a terminal and type (or replace gedit with your editor of choice):

Code: Select all

gedit ~/.local/share/applications/defaults.list
Very likely you will see here some file types being associated with Wine. You can delete those lines and save this file. If you have any doubts about it, please post your file contents on http://pastebin.com and share the link here.

If you can't find it in that file, please share the output of the following two command:

Code: Select all

locate defaults.list | xargs ls -l
locate defaults.list | xargs ls -lc
Image
alakin

Re: Default applications

Post by alakin »

Thanks Vincent. I have found the file easily enough but there are no signs of any Windows apps?

Code: Select all

[Default Applications]
audio/mpeg=totem.desktop
video/x-theora+ogg=totem.desktop
application/pdf=evince.desktop
x-content/audio-player=rhythmbox.desktop
The most common files that I am likely to click on are jpgs and text files and they are not covered. I am not really sure why the desktop is behaving this way :?
My wife's login works fine, but she hasn't used WINE :!:
User avatar
xenopeek
Level 25
Level 25
Posts: 29597
Joined: Wed Jul 06, 2011 3:58 am

Re: Default applications

Post by xenopeek »

Eh, you missed the last part of my post :D Please share the output of the following two commands:

Code: Select all

locate defaults.list | xargs ls -l
locate defaults.list | xargs ls -lc
This will let me confirm which file to fix. As your wife also has an account, it will probably be fixed by copying the .config/applications/defaults.list file from her home folder to your .config/applications folder.
Image
alakin

Re: Default applications

Post by alakin »

OK. I have just had a poke around and running the commands that you gave simply lists all of the files that I have in my home folder. The locate command does not return anything by itself. I have also checked the .config/applications/default.list from my wife's login and it is identical to the output that I have provided for my file.

Ah - I have just realised that I have posted this in the XFCE section - I am running XFCE BUT on LMDE if that makes a difference?
User avatar
xenopeek
Level 25
Level 25
Posts: 29597
Joined: Wed Jul 06, 2011 3:58 am

Re: Default applications

Post by xenopeek »

Moved here by moderator

I'm on LMDE XFCE as well. Are you sure you ran the correct command and checked the right file? Please do share the output of this command. Don't try typing it, please click select all, then copy it and paste it to the terminal to run:

Code: Select all

locate defaults.list | xargs ls -l
This should output similar to:

Code: Select all

mint@mint ~ $ locate defaults.list | xargs ls -l
-rw-r--r-- 1 root root 12966 Sep 18  2010 /etc/gnome/defaults.list
-rw-r--r-- 1 root root  8786 Sep  9 12:14 /etc/skel/.config/applications/defaults.list
-rw-r--r-- 1 root root   154 Mar 13  2011 /etc/skel/.local/share/applications/defaults.list
-rw-r--r-- 1 mint mint  8786 Sep  9 13:59 /home/mint/.config/applications/defaults.list
-rw-r--r-- 1 mint mint   154 Sep  9 13:59 /home/mint/.local/share/applications/defaults.list
lrwxrwxrwx 1 root root    24 Nov 23  2010 /usr/share/gnome/applications/defaults.list -> /etc/gnome/defaults.list
Image
craigevil

Re: Default applications

Post by craigevil »

Using the Debian alternatives system : http://www.debian-administration.org/articles/91
Default browser - MozillaZine Knowledge Base : http://kb.mozillazine.org/Default_browser#Debian

galternatives - graphical setup tool for the alternatives system

You can install the package galternatives, makes it a bit easier than issuing commands in a terminal.
alakin

Re: Default applications

Post by alakin »

You are absolutely right - a typo on my part :shock:

Code: Select all

alan@avocet ~ $ audio/mpeg=totem.desktop
bash: audio/mpeg=totem.desktop: No such file or directory
alan@avocet ~ $ video/x-theora+ogg=totem.desktop
bash: video/x-theora+ogg=totem.desktop: No such file or directory
alan@avocet ~ $ application/pdf=evince.desktop
bash: application/pdf=evince.desktop: No such file or directory
alan@avocet ~ $ x-content/audio-player=rhythmbox.desktop
bash: x-content/audio-player=rhythmbox.desktop: No such file or directory
User avatar
xenopeek
Level 25
Level 25
Posts: 29597
Joined: Wed Jul 06, 2011 3:58 am

Re: Default applications

Post by xenopeek »

Well, that output is from something else than the command I gave... Try this command instead (it is one command):

Code: Select all

find / -name defaults.list -ls 2>/dev/null
This will give you a list of files that are called defaults.list. Please share that list.
Image
alakin

Re: Default applications

Post by alakin »

Here we are then:

Code: Select all

alan@avocet ~ $     find / -name defaults.list -ls 2>/dev/null
422113    4 -rw-r--r--   1 root     root          221 Dec 18 12:17 /usr/share/applications/defaults.list
  2840    0 lrwxrwxrwx   1 root     root           24 Dec 17 14:29 /usr/share/gnome/applications/defaults.list -> /etc/gnome/defaults.list
521310    4 -rw-r--r--   1 amanda   amanda        154 Dec 18 12:25 /home/amanda/.local/share/applications/defaults.list
521229   12 -rw-r--r--   1 amanda   amanda       8786 Dec 18 12:25 /home/amanda/.config/applications/defaults.list
130563    4 -rw-r--r--   1 alan     alan          154 Mar 13  2011 /home/alan/.local/share/applications/defaults.list
130317   12 -rw-r--r--   1 alan     alan         8786 Sep  9 13:14 /home/alan/.config/applications/defaults.list
132295   12 -rw-r--r--   1 root     root         8786 Sep  9 13:14 /etc/skel/.config/applications/defaults.list
132359    4 -rw-r--r--   1 root     root          154 Mar 13  2011 /etc/skel/.local/share/applications/defaults.list
131567   16 -rw-r--r--   1 root     root        12925 Sep  8 11:06 /etc/gnome/defaults.list
User avatar
xenopeek
Level 25
Level 25
Posts: 29597
Joined: Wed Jul 06, 2011 3:58 am

Re: Default applications

Post by xenopeek »

Drats, that shows that none of the files have been modified since December 2011. Assuming you installed Wine more recently, these are not the droids, erm, files you are looking for :(

After some more looking, check the following:

Code: Select all

ls ~/.local/share/applications
Probably there are some files there that have "notepad" as part of their name. Remove those. Probably there are also some files there "wine-extension" in their name. Remove those as well.

And I'll leave this here, something perhaps to do before installing any future applications on Wine so as to prevent this from happening anew (though you couldn't have prevented this as Wine installation does the Notepad file association): http://wiki.winehq.org/FAQ#head-c847a3d ... d4c7ae042a
Image
alakin

Re: Default applications

Post by alakin »

Thanks Vincent. I'll take a look at this tonight.
asermax

Re: Default applications

Post by asermax »

Something like this happened to me too, eveything would open with nautilus instead of using the file's default application.
The problem was that someway some mimeype bindings got messed up and pointed to nautilus; i think this is probably what's happening to you.
Given that your wife account is working just fine, it probably is your personal mimetype conf file which is behaving badly. You should check the conf file in ~/.local/share/applications/mimeapps.list. You could try with

Code: Select all

cat ~/.local/share/applications/mimeapps.list | grep wine
or open the file with your preferred text editor an check for odd records that could be causing the problem.

Cheers.-
alakin

Re: Default applications

Post by alakin »

I have made some progress with this, though I do find it a bit strange. I have found the offending files in .local/share/applications

Code: Select all

-rw-r--r--  1 alan alan  154 Mar 13  2011 defaults.list
-rw-r--r--  1 alan alan  123 Feb  4 16:29 mimeapps.list
-rw-r--r--  1 alan alan  627 Jan  7 23:17 mimeinfo.cache
drwxr-xr-x  3 alan alan 4096 Jan  7 23:17 wine
-rw-r--r--  1 alan alan  192 Jan  7 23:17 wine-extension-chm.desktop
-rw-r--r--  1 alan alan  209 Jan  7 23:17 wine-extension-gif.desktop
-rw-r--r--  1 alan alan  218 Jan  7 23:17 wine-extension-hlp.desktop
-rw-r--r--  1 alan alan  202 Jan  7 23:17 wine-extension-htm.desktop
-rw-r--r--  1 alan alan  216 Jan  7 23:17 wine-extension-ini.desktop
-rw-r--r--  1 alan alan  212 Jan  7 23:17 wine-extension-jfif.desktop
-rw-r--r--  1 alan alan  211 Feb 20 19:43 wine-extension-jpe.desktop
-rw-r--r--  1 alan alan  209 Jan  7 23:17 wine-extension-msp.desktop
-rw-r--r--  1 alan alan  209 Jan  7 23:17 wine-extension-png.desktop
-rw-r--r--  1 alan alan  199 Jan  7 23:17 wine-extension-rtf.desktop
-rw-r--r--  1 alan alan  194 Jan  7 23:17 wine-extension-txt.desktop
-rw-r--r--  1 alan alan  205 Jan  7 23:17 wine-extension-url.desktop
-rw-r--r--  1 alan alan  205 Jan  7 23:17 wine-extension-wri.desktop
-rw-r--r--  1 alan alan  207 Jan  7 23:17 wine-extension-xml.desktop
If I edit this file

Code: Select all

[Desktop Entry]
Type=Application
Name=Wine Internet Explorer
MimeType=image/jpeg;
Exec=env WINEPREFIX="/home/alan/.wine" wine start /ProgIDOpen jpegfile %f
NoDisplay=true
StartupNotify=true
Icon=FB4C_iexplore.0
by removing the Exec line and then double click on a jpeg file I get an error telling me that the Exec line is missing.
The file looks like it is only supposed to apply to applications in the .wine file structure but for some reason it has spread up the file tree to infect all files in my home directory? I now know how to disable the windows apps from launching but haven't worked out how to insert a linux default?
User avatar
xenopeek
Level 25
Level 25
Posts: 29597
Joined: Wed Jul 06, 2011 3:58 am

Re: Default applications

Post by xenopeek »

Alan, let's make this easy :wink: Compare your .local/share/applications folder with your wife's .local/share/applications folder. As she doesn't have the problem. Probably if you overwrite your mimeapps.list with hers, and you delete the wine-extension*.desktop files, this issue will go away.

If you want to compare easily, you can run this command:

Code: Select all

diff -qr /home/alan/.local/share/applications /home/amanda/.local/share/applications
This will tell you when files differ, or when you have a file that she doesn't have and vice versa.
Image
alakin

Re: Default applications

Post by alakin »

Excellent, that's done the job :D

Thanks for you help Vincent.
Locked

Return to “LMDE Archive”