Thunar File associations

Get help with XFCE specific problems
Post Reply
User avatar
Rava
Contributor
Contributor
Posts: 1559
Joined: 11 Jan 2011, 02:46
Distribution: Porteus 3.1.0 x86-64 XFCe
Location: Germany

Thunar File associations

Post#1 by Rava » 03 Feb 2018, 12:34

How does one set up file associations to programs in XFCe?

With a plain text file I get in the main right mouseclick (or context menu key) menu these entries:

Code: Select all

Open with "Mousepad"
Open with "Geany"
But with a video playlist file (could be an audio playlist or video playlist, the file suffix won't tell) I only get:

Code: Select all

Open with "Audacious"
And when indeed this is a playlist for videos... then audacious is not really the program I want, but mpv.

But to load the playlist into mpv, I have to go to the submenu "Open with" and there I then find

Code: Select all

Open with "mpv Media Player"
Open with "Mousepad"
Open with "Enqueue in Audacious"
Open with "Geany"
How can I set up my system that Open with "mpv Media Player" is also listed on the main right mouseclick (or context menu key) menu, so that I have two associations there, like a text file is associated with both geany and mousepad?

Cheers
Cheers!
Yours Rava

donald
Full of knowledge
Full of knowledge
Posts: 1355
Joined: 17 Jun 2013, 13:17
Distribution: Porteus 3.2.2 XFCE 32bit
Location: Germany

Thunar File associations

Post#2 by donald » 03 Feb 2018, 23:23

Hmm ... as soon as I have selected a program from the "Open with other application" list, it will automatically appear in the context menu next time.

However, if you want a playlist of video files automatically opened by mpv, add [playlist] at the first line e.g.:

Code: Select all

[playlist]
File1=file:///mnt/sda3/temp/Das is mir soooo egal-640.mp4
File2=file:///mnt/sda3/temp/RodrigoYGabriela_2015-480p.mp4
File3=file:///mnt/sda3/temp/Crystallize - Lindsey Stirling
The file (playlist) doesn't need to have a suffix like *.pls

btw
which version of porteus are you talking about?
...it is different in older versions.

User avatar
Rava
Contributor
Contributor
Posts: 1559
Joined: 11 Jan 2011, 02:46
Distribution: Porteus 3.1.0 x86-64 XFCe
Location: Germany

Thunar File associations

Post#3 by Rava » 04 Feb 2018, 07:13

4.0 rc1 rc2 rc3. ..
Cheers!
Yours Rava

beny
Full of knowledge
Full of knowledge
Posts: 742
Joined: 02 Jan 2011, 11:33
Location: italy

Thunar File associations

Post#4 by beny » 04 Feb 2018, 12:15

hi, you can do this via thunar personal action choose mpv from the usr/bin and when you go into an audio directory mpv play all,or a playlist try it,btw the trouble is to stop it.

donald
Full of knowledge
Full of knowledge
Posts: 1355
Joined: 17 Jun 2013, 13:17
Distribution: Porteus 3.2.2 XFCE 32bit
Location: Germany

Thunar File associations

Post#5 by donald » 04 Feb 2018, 15:37

@Rava
As being said, right-click the file > open with other application > select one >
open > and you get the context menu entry...

tested in rc3 + 003-xfce-x86_64-2017-12-16
Image

User avatar
Rava
Contributor
Contributor
Posts: 1559
Joined: 11 Jan 2011, 02:46
Distribution: Porteus 3.1.0 x86-64 XFCe
Location: Germany

Thunar File associations

Post#6 by Rava » 04 Feb 2018, 16:57

Thanks beny & donald

The Trick with adding [playlist] doesn't work. Thats the default first line for .pls playlists but I use .m3u for video playlists. I wrote a script that only adds video files from a folder into a playlist file named just like the folder. Doing so with .m3u is the easiest cause it not needs converting many Charakters like whitespace 》%20 or such.

I tried the other approach but it fails for xfce V2018.01.14

I have the other programs but audacious in a submenu, even when I tell Thunar that mpv should be the default... It sure loads the m3u into mpv... but on the main context menu there still is only audacious listed being associated with m3u...

Maybe a Bug in that xfce Version?
Cheers!
Yours Rava

donald
Full of knowledge
Full of knowledge
Posts: 1355
Joined: 17 Jun 2013, 13:17
Distribution: Porteus 3.2.2 XFCE 32bit
Location: Germany

Thunar File associations

Post#7 by donald » 04 Feb 2018, 17:49

Rava wrote:
04 Feb 2018, 16:57
Maybe a Bug in that xfce Version?
This could well be -- because:
The latest version i have is 003-xfce-x86_64-2018-01-02.xzm.
It doesn't even boot into Desktop, i'm stuck at the login screen.
with ctrl+alt+F* i can login but not start x:

Code: Select all

xfsm_manager_load_session: Something wrong with
/root/.cache/sessions/xfce4-session-porteus:1, Does it exist? Permission issue?
Message:  couldn't access control socket:
/tmp/xdg-runtime-root/keyring/control: no such file or directory
/etc/xdg/xfce4/xinitrc: line 113: 1224 illegal instruction  xfce-session
xinit connection to x server lost
Therefore i reverted back to 003-xfce-x86_64-2017-12-16 + rc3

User avatar
Rava
Contributor
Contributor
Posts: 1559
Joined: 11 Jan 2011, 02:46
Distribution: Porteus 3.1.0 x86-64 XFCe
Location: Germany

Thunar File associations

Post#8 by Rava » 04 Feb 2018, 19:21

I was partly wrong with what I said about m3u playlist.
You have to exit the folder in Thunar and reenter the folder. I thought "reload" would do the trick but no...
Anyhow then you see mpv as default app for m3u in the main context menu window... but audacious is removed. I want both audacious and mpv for m3u files to appear on the main menu.

V2018.01.14 and V2017. 12.16 act the very same. I have several programs to choose for .pls but only ever one for .m3u.
Cheers!
Yours Rava

donald
Full of knowledge
Full of knowledge
Posts: 1355
Joined: 17 Jun 2013, 13:17
Distribution: Porteus 3.2.2 XFCE 32bit
Location: Germany

Thunar File associations

Post#9 by donald » 05 Feb 2018, 00:45

Tried once more
( rc3 + 003-xfce-x86_64-2017-12-16 in AF mode)

(defaults)
right-click a video file (webM/mp4) = open with mpv
right-click a audio file (mp3/wav) = open with audacious

Let's create a *.m3u playlist which contents only video files.

Because i am lazy i use the playlist window of audacious.
It doesn't matter if audacious is able to actually play these files (don't try),
one can still put files in this window and export the playlist as:
m3u , pls , xml shareable playlist (xspf) , asxv3 playlist or audpl (audacious playlist)
Let's choose m3u.

Now right-click that file = only audacious and leafpad.

right-click again > open with other application, select mpv media player,click open =
videos are playing.-- I now have the mpv context menu entry like shown above when
right-clicking a m3u file, no matter if they contain audio or video files.

The same work the other way round:
If i have a *.pls file mpv is the default > right-click,other app,audacious >
both are in context menu.

I have no idea why it shouldn't work at your end. :unknown:

fulalas
DEV Team
DEV Team
Posts: 1103
Joined: 26 Oct 2016, 15:34
Distribution: Porteus
Location: Brazil

Thunar File associations

Post#10 by fulalas » 05 Feb 2018, 01:17

This context menu thing is set through mime types, and it's a pain in the ass to correctly set. The idea is to put the mime types (essentially file extensions) you want inside /usr/share/applications/[app].desktop at the mime type section. To set the default program for each mime type, you should look at /usr/local/share/applications/default.list -- the first application on the list of each mime type corresponds to the default application that will open when you double click a given file extension.

If my explanation isn't clear, please let me know. ;)

User avatar
Rava
Contributor
Contributor
Posts: 1559
Joined: 11 Jan 2011, 02:46
Distribution: Porteus 3.1.0 x86-64 XFCe
Location: Germany

Thunar File associations

Post#11 by Rava » 05 Feb 2018, 06:25

fulalas wrote:
05 Feb 2018, 01:17
This context menu thing is set through mime types, and it's a pain in the ass to correctly set. The idea is to put the mime types (essentially file extensions) you want inside /usr/share/applications/[app].desktop at the mime type section. To set the default program for each mime type, you should look at /usr/local/share/applications/default.list -- the first application on the list of each mime type corresponds to the default application that will open when you double click a given file extension.

If my explanation isn't clear, please let me know. ;)
Thanks for the heads up. .. I try to look into this info.

I already have set up some mime types when adding viewnior as my default image viewer instead of gpicview. .. and I also load the mtpaint module by default.

Maybe all these changes are somehow messing up the handling of m3u Files?
Not that image files and m3u files are related. .. but in this issue all are still just mime types...
Cheers!
Yours Rava

User avatar
Rava
Contributor
Contributor
Posts: 1559
Joined: 11 Jan 2011, 02:46
Distribution: Porteus 3.1.0 x86-64 XFCe
Location: Germany

Thunar File associations

Post#12 by Rava » 05 Feb 2018, 14:55

In /usr/local/share/applications/default.list the entries for .pls and .m3u are the same (.pls is x-scpls and .m3u is x-mpegurl)

Code: Select all

audio/x-mpegurl=audacious.desktop;audacious-enqueue.desktop;mpv.desktop;
audio/x-scpls=audacious.desktop;audacious-enqueue.desktop;mpv.desktop;
So... might the difference lie in whats inside /usr/share/applications/[app].desktop ?

Let's check the entries for audacious and mpv...

audacious.desktop has these:

Code: Select all

MimeType=application/ogg;application/x-cue;application/x-ogg;application/xspf+xml;audio/midi;audio/mp3;audio/mp4;audio/mpeg;audio/mpegurl;audio/ogg;audio/prs.sid;audio/x-flac;audio/x-it;audio/x-mod;audio/x-mp3;audio/x-mpeg;audio/x-mpegurl;audio/x-ms-asx;audio/x-ms-wma;audio/x-musepack;audio/x-s3m;audio/x-scpls;audio/x-stm;audio/x-vorbis+ogg;audio/x-wav;audio/x-xm;inode/directory;x-content/audio-cdda;
and mpv.desktop these:

Code: Select all

MimeType=application/ogg;application/x-ogg;application/sdp;application/smil;application/x-smil;application/streamingmedia;application/x-streamingmedia;application/vnd.rn-realmedia;application/vnd.rn-realmedia-vbr;audio/aac;audio/x-aac;audio/m4a;audio/x-m4a;audio/mp1;audio/x-mp1;audio/mp2;audio/x-mp2;audio/mp3;audio/x-mp3;audio/mpeg;audio/x-mpeg;audio/mpegurl;audio/x-mpegurl;audio/mpg;audio/x-mpg;audio/rn-mpeg;audio/ogg;audio/scpls;audio/x-scpls;audio/vnd.rn-realaudio;audio/wav;audio/x-pn-windows-pcm;audio/x-realaudio;audio/x-pn-realaudio;audio/x-ms-wma;audio/x-pls;audio/x-wav;video/mpeg;video/x-mpeg;video/x-mpeg2;video/mp4;video/msvideo;video/x-msvideo;video/ogg;video/quicktime;video/vnd.rn-realvideo;video/x-ms-afs;video/x-ms-asf;video/x-ms-wmv;video/x-ms-wmx;video/x-ms-wvxvideo;video/x-avi;video/x-fli;video/x-flv;video/x-theora;video/x-matroska;video/webm;audio/x-flac;audio/x-vorbis+ogg;video/x-ogm+ogg;audio/x-shorten;audio/xmpv.desktop.orig-ape;audio/x-wavpack;audio/x-tta;audio/AMR;audio/ac3;video/mp2t;audio/flac;audio/mp4;
So... both have audio/x-mpegurl aka .m3u and also audio/x-scpls aka pls...

I don't really get it, why is it so messed up then?

I realized that I did change the mpv.desktop so it's OSD would be affected:

Code: Select all

guest@porteus:/usr/share/applications$ diff mpv.desktop*
30c30
< Exec=mpv --player-operation-mode=pseudo-gui --video-sync=display-resample --no-osd-bar --audio-file-auto=fuzzy -- %U
---
> Exec=mpv --player-operation-mode=pseudo-gui -- %U
... so to be sure, I reverted to the backuped original (renamed mpv.desktop.orig back to mpv.desktop) and had to close all guest running Thunar in XFCe to be able to see changes...

But the file associations are still the same messy way as previously, changing the Exec should not have affected the mime types anyway... and it did not...

The mpv OSD indeed did change back to its old (ugly) behaviour, but that was all that happened...
Cheers!
Yours Rava

Post Reply