[SOLVED] Leafpad opens .png files by default

You have a problem with Salix? Post here and we'll do what we can to help.
User avatar
Atip
Posts: 539
Joined: 5. Jun 2011, 04:27

[SOLVED] Leafpad opens .png files by default

Post by Atip »

Alll my file managers (thunar, dolphin, spacefm, mc) open *.png files with leafpad which naturally does not make sense.

This is when I open the FMs as user. If I open as sudo the *.png files open with gthumb.

How can I change this that as user FMs will open with gthumb or viewnior?
Last edited by Atip on 3. Jan 2017, 03:24, edited 1 time in total.
DidierSpaier
Posts: 539
Joined: 20. Jun 2016, 20:15

Re: Leafpad opens .png files by default

Post by DidierSpaier »

There are tools to do that but I don't remember which right now. Anyway you could type this as regular user:

Code: Select all

sed -i "s/png=.*/png=viewnior/" ~/.local/share/applications/defaults.list
or directly edit the file ~/.local/share/applications to have in it:

Code: Select all

image/png=viewnior.desktop
image/x-png=viewnior.desktop
Of course replace viewnior with gthumb if you prefer.
westms
Posts: 298
Joined: 17. Mar 2013, 18:51

Re: Leafpad opens .png files by default

Post by westms »

Atip wrote:Alll my file managers (thunar, dolphin, spacefm, mc) open *.png files with leafpad which naturally does not make sense.

This is when I open the FMs as user. If I open as sudo the *.png files open with gthumb.

How can I change this that as user FMs will open with gthumb or viewnior?
This can also be done at the graphical interface with graphical dialog, e.g. with thunar, instead of editing files.

To do this, open the context menu of the PNG file to be opened in thunar and choose "Open with another application..." (possibly not literally). In the list that opens, select the application to be assigned. Then check the box "Use for files of this type" (possibly not literally). Then click on "Open" (possibly not literally). That's it.
User avatar
gapan
Salix Wizard
Posts: 6361
Joined: 6. Jun 2009, 17:40

Re: Leafpad opens .png files by default

Post by gapan »

This line:

Code: Select all

image/png=viewnior.desktop
is the default .local/share/applications/defaults.list. See: https://github.com/gapan/user-settings- ... aults.list

So this doesn't happen by default, it's something you did after installation.
Image
Image
User avatar
Atip
Posts: 539
Joined: 5. Jun 2011, 04:27

Re: Leafpad opens .png files by default

Post by Atip »

Thanks all!

There is/was nothing wrong with ~/.local/share/applications/defaults.list.

After setting in thunar and dolphin to open *.png files with viewnior as default
application spacefm and mc followed suite automatically. :D
User avatar
Atip
Posts: 539
Joined: 5. Jun 2011, 04:27

Re: Leafpad opens .png files by default

Post by Atip »

gapan wrote:This line:

Code: Select all

image/png=viewnior.desktop
is the default .local/share/applications/defaults.list. See: https://github.com/gapan/user-settings- ... aults.list

So this doesn't happen by default, it's something you did after installation.
Yes, like upgrading with gslapt libpng after which I could not open dillo and gedit anymore since libpng*s needed for those programs went missing ;) and possibly caused problem of Re: Subject as well. :roll:
User avatar
gapan
Salix Wizard
Posts: 6361
Joined: 6. Jun 2009, 17:40

Re: Leafpad opens .png files by default

Post by gapan »

Atip wrote:Yes, like upgrading with gslapt libpng after which I could not open dillo and gedit anymore since libpng*s needed for those programs went missing ;) and possibly caused problem of Re: Subject as well. :roll:
What on earth are you talking about? If any of that happened, you're not using Salix.
Image
Image
User avatar
Atip
Posts: 539
Joined: 5. Jun 2011, 04:27

Re: [SOLVED] Leafpad opens .png files by default

Post by Atip »

Well, I am just reporting what happened.
And if I am not using Salix then the Northern Philippine Cobra on my avatar shall sink its poison fangs into me. ;)

In order to use dillo again I copied the missing libs libpng14.* over from slackel and for gedit made a symlinc afterwards:

Code: Select all

ln /usr/lib/libpng14.so.14.12.0 /usr/lib/libpng12.so.0

Code: Select all

cat slackware-version 
Slackware 14.2

Code: Select all

cat ./slapt-getrc
# Working directory for local storage/cache.
WORKINGDIR=/var/slapt-get

# Exclude package names and expressions.
# To exclude pre and beta packages, add this to the exclude:
#   [0-9\_\.\-]{1}pre[0-9\-\.\-]{1}
EXCLUDE=^aaa_elflibs,^aaa_base,^devs,^glibc.*,^rootuser-settings,^zzz-settings.*,-x86_64-

# The Slackware repositories, including dependency information
SOURCE=http://ftp.cc.uoc.gr/mirrors/linux/salix/i486/slackware-14.2/:OFFICIAL
SOURCE=http://ftp.cc.uoc.gr/mirrors/linux/salix/i486/slackware-14.2/extra/:OFFICIAL

# The Salix repository
SOURCE=http://ftp.cc.uoc.gr/mirrors/linux/salix/i486/14.2/:PREFERRED
# And the Salix extra repository
SOURCE=http://ftp.cc.uoc.gr/mirrors/linux/salix/i486/extra-14.2/:OFFICIAL

Code: Select all

 uname -a
Linux ispx 4.4.38-smp #2 SMP

Code: Select all

ls /var/log/packages/libpng*
 /var/log/packages/libpng-1.6.27-i586-1_slack14.2
User avatar
gapan
Salix Wizard
Posts: 6361
Joined: 6. Jun 2009, 17:40

Re: [SOLVED] Leafpad opens .png files by default

Post by gapan »

Atip wrote:Well, I am just reporting what happened.
And if I am not using Salix then the Northern Philippine Cobra on my avatar shall sink its poison fangs into me. ;)
You have changed so many things manually, outside of package management in your system, that it's not Salix, or any other distribution that anybody else is using anymore. There is no problem with libpng on Salix. It's only in your system, because of changes you have made.
Atip wrote:In order to use dillo again I copied the missing libs libpng14.* over from slackel and for gedit made a symlinc afterwards:

Code: Select all

ln /usr/lib/libpng14.so.14.12.0 /usr/lib/libpng12.so.0
That's exactly what I mean.
Image
Image
User avatar
ChuangTzu
Donor
Posts: 388
Joined: 19. May 2015, 23:34

Re: [SOLVED] Leafpad opens .png files by default

Post by ChuangTzu »

Maybe its time to create a Don't Break Salix, similar to the Don't break Debian threads/wiki's, of course modified for Salix/Slackware.

We do have these:
https://docs.salixos.org/wiki/Can_I_use ... itories%3F
https://docs.salixos.org/wiki/Can_I_use ... h_Salix%3F

I can start work on this, if you guys think it could help.

Ref: https://wiki.debian.org/DontBreakDebian
Image
Image
Post Reply