The officially official Devuan Forum!

You are not logged in.

#1 2024-07-15 16:25:00

bai4Iej2need
Member
From: Ortenau
Registered: 2021-04-25
Posts: 117  

[SOLVED] mate desktop pdf opens in terminal with vim

daedalus
From Desktop:
About Mate
mate 1.26.0
about Atril
Atril is a simple multi-page document viewer.   1.26.0

When I download or extract a pdf from a mail, it shows up in "latest documents". Then I click on It , and a terminal with vi opens it.

%PDF-1.7^M and so on.

System /Personal/ Preferred Applications /Büro (office) states atril for Documents . whatever documents means .

~/.config/mimeapps.list Line 21 :
application/pdf=atril.desktop
cd /usr/share/mime/application 
#  grep "pdf" *                   
pdf.xml:<mime-type xmlns="http://www.freedesktop.org/standards/shared-mime-info" type="application/pdf">
pdf.xml:  <glob pattern="*.pdf"/>
pdf.xml:  <alias type="application/x-pdf"/>
pdf.xml:  <alias type="image/pdf"/>
pdf.xml:  <alias type="application/nappdf"/>
x-bzpdf.xml:<mime-type xmlns="http://www.freedesktop.org/standards/shared-mime-info" type="application/x-bzpdf">
x-bzpdf.xml:  <glob pattern="*.pdf.bz2"/>
x-gzpdf.xml:<mime-type xmlns="http://www.freedesktop.org/standards/shared-mime-info" type="application/x-gzpdf">
x-gzpdf.xml:  <glob pattern="*.pdf.gz"/>
x-lzpdf.xml:<mime-type xmlns="http://www.freedesktop.org/standards/shared-mime-info" type="application/x-lzpdf">
x-lzpdf.xml:  <glob pattern="*.pdf.lz"/>
x-wwf.xml:  <sub-class-of type="application/pdf"/>
x-xzpdf.xml:<mime-type xmlns="http://www.freedesktop.org/standards/shared-mime-info" type="application/x-xzpdf">
x-xzpdf.xml:  <glob pattern="*.pdf.xz"/>

What points the application wrongly to vi ?

top:

30511 md        20   0  553320  53296  34844 S   0,0   0,1   1:00.55              `- mate-panel                                                                                                                    
30514 md        20   0  553320  53296  34844 S   0,0   0,1   0:06.22                  `- mate-panel                                                                                                                
30515 md        20   0  553320  53296  34844 S   0,0   0,1   0:00.14                  `- mate-panel                                                                                                                
30516 md        20   0  553320  53296  34844 S   0,0   0,1   0:00.00                  `- mate-panel                                                                                                                
 9803 md        20   0  562952  59816  41856 S   3,3   0,1   0:11.46                  `- mate-terminal                                                                                                             
 9806 md        20   0  562952  59816  41856 S   0,0   0,1   0:00.00                      `- mate-terminal                                                                                                         
 9808 md        20   0  562952  59816  41856 S   0,0   0,1   0:00.00                      `- mate-terminal                                                                                                         
 9809 md        20   0  562952  59816  41856 S   0,0   0,1   0:00.00                      `- mate-terminal                                                                                                         
10188 md        20   0   14064   7808   4828 S   0,0   0,0   0:00.17                      `- zsh                                                                                                                   
10590 md        20   0    8468   4876   2760 R   0,3   0,0   0:01.03                          `- top                                                                                                               
10585 md        20   0   36664  17880  10032 S   0,0   0,0   0:00.02                      `- vim /tmp/240703_Importstrategie-2.pdf                                                                                 
10587 md        20   0   36664  17880  10032 S   0,0   0,0   0:00.00                          `- vim /tmp/240703_Importstrategie-2.pdf  

Last edited by bai4Iej2need (2024-07-15 16:33:19)


The devil, you know, is better than the angel, you don't know. by a British Citizen, I don't know too good.
One generation abandons the enterprises of another like stranded vessels. By Henry David Thoreau, WALDEN, Economy. Line 236 (Gutenberg text Version)
broken by design :
https://bugs.debian.org/cgi-bin/bugrepo … bug=958390

Offline

#2 2024-07-15 23:19:34

igorzwx
Member
Registered: 2024-05-06
Posts: 105  

Re: [SOLVED] mate desktop pdf opens in terminal with vim

MATE 1.26.0

$ atril --version
MATE Document Viewer 1.26.0

Atril opens PDFs without problems.

Check your pdf with mediainfo

mediainfo *.pdf
$ file *.pdf
Graphics_with_Maxima.pdf: PDF document, version 1.4, 6 pages

Try to open the pdf file with Firefox.

Last edited by igorzwx (2024-07-15 23:45:17)

Offline

#3 2024-07-16 08:07:28

bai4Iej2need
Member
From: Ortenau
Registered: 2021-04-25
Posts: 117  

Re: [SOLVED] mate desktop pdf opens in terminal with vim

Thanks for answering.
When opening with atril , the file opens and displays properly. This is not the problem.

file 240703_Importstrategie-2.pdf
240703_Importstrategie-2.pdf: PDF document, version 1.7, 38 pages

The problem is in the calling structure of the mate menu tree, where a flawed command reference is stored somewhere.
See the 'top' listing.
mate-panel invokes vim over a terminal instead of invoking atril.

Where does mate panel store its preferences?


The devil, you know, is better than the angel, you don't know. by a British Citizen, I don't know too good.
One generation abandons the enterprises of another like stranded vessels. By Henry David Thoreau, WALDEN, Economy. Line 236 (Gutenberg text Version)
broken by design :
https://bugs.debian.org/cgi-bin/bugrepo … bug=958390

Offline

#4 2024-07-16 09:00:43

alexkemp
Member
Registered: 2018-05-14
Posts: 357  

Re: [SOLVED] mate desktop pdf opens in terminal with vim

In XFCE it is "Default Applications" & they are discovered/changed via menu:Settings | Default Applications. I would imagine/hope that all DAs have a similar setup.

Offline

#5 2024-07-16 09:16:19

ralph.ronnquist
Administrator
From: Battery Point, Tasmania, AUS
Registered: 2016-11-30
Posts: 1,259  

Re: [SOLVED] mate desktop pdf opens in terminal with vim

The way to find out is to use strace, focussing on the open or openat system calls and reducing it to the files concerned. Something like

$ strace -f -s 200 $program | sed '/open/!d;s|[^"]*"||;s|".*||' | sort -u

where $program is that program that handles the mouse click... your file browser(?).

EDIT: However if the click handling program farms out the decision logic to some dbus activated something, it breaks the call chain and becomes slightly more complext to trace. You might then need to trace dbus to work out where the decision logic is sited, and then set up a way to strace that.

Offline

#6 2024-07-16 11:03:41

igorzwx
Member
Registered: 2024-05-06
Posts: 105  

Re: [SOLVED] mate desktop pdf opens in terminal with vim

program that handles the mouse click...

$ cat /usr/share/applications/atril.desktop | grep Exec
TryExec=atril
Exec=atril %U

Is it "Open in Terminal"?

$ cat /usr/share/applications/atril.desktop | grep Terminal=
Terminal=false
ls ~/.local/share/applications | grep atr

Mozo - Mate Menu Editor
_https://wiki.mate-desktop.org/mate-desktop/applications/mozo/

mozo

EDIT:
Right mouse click on a pdf file > Select "Properties" in a drop-down menu > "Open With"

Last edited by igorzwx (2024-07-16 20:15:50)

Offline

#7 2024-07-16 20:17:57

Ron
Member
Registered: 2018-04-22
Posts: 529  

Re: [SOLVED] mate desktop pdf opens in terminal with vim

Go to Menu and under "All" find "Preferred Applications." In the Office tab, make sure Atril is selected under Document Viewer.

Offline

#8 2024-07-16 20:32:36

igorzwx
Member
Registered: 2024-05-06
Posts: 105  

Re: [SOLVED] mate desktop pdf opens in terminal with vim

Method 1: Right mouse click on a pdf file > Select "Properties" in a drop-down menu > "Open With"

Method 2: "Preferred Applications"

mate-default-applications-properties

If you open a document file with a sort of vim, it may become a default for all documents.
If, for example, you open a wxMaxima worksheet *.wxmx with wxMaxima, then it is a default for all archives.

It seems to be a standard behaviour for all Linux Desktops (freedesktop.org)

Last edited by igorzwx (2024-07-16 22:58:31)

Offline

#9 2024-10-02 17:50:57

bai4Iej2need
Member
From: Ortenau
Registered: 2021-04-25
Posts: 117  

Re: [SOLVED] mate desktop pdf opens in terminal with vim

When now testing the case, I noted,  that the wrong behavior has disappeared.
It was limited to the "recent files" in the application menu of mate.
I did install some mate-menues-extras Items.
Probably it fixed the case. Possibly after a restart or a logout-login sequence.


The devil, you know, is better than the angel, you don't know. by a British Citizen, I don't know too good.
One generation abandons the enterprises of another like stranded vessels. By Henry David Thoreau, WALDEN, Economy. Line 236 (Gutenberg text Version)
broken by design :
https://bugs.debian.org/cgi-bin/bugrepo … bug=958390

Offline

Board footer