Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try to determine the default video play using xdg-mime #12

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

adamreichold
Copy link
Owner

@adamreichold adamreichold commented Jan 6, 2019

Use xdg-mime to query default application for MIME type video/mp4 and then try to grep binary path from desktop file's Exec entry.

@probonopd
Copy link
Contributor

probonopd commented Jan 6, 2019

f19aeca still shows vlc for me, even if I rm -rf .local/share/QMediathekView/ before launching.

me@host:~$ vlc

Command 'vlc' not found, but can be installed with:

sudo apt install vlc-bin

@adamreichold
Copy link
Owner Author

f19aeca still shows vlc for me, even if I rm -rf .local/share/QMediathekView/ before launching.

Can you tell me what

sh -c "grep '^Exec=' /usr/share/applications/`xdg-mime query default video/mp4` | cut -d'=' -f2 | cut -d' ' -f1"

yields on your system?

@adamreichold adamreichold force-pushed the use-default-video-player branch from f19aeca to 9942273 Compare January 6, 2019 11:51
@adamreichold
Copy link
Owner Author

f19aeca still shows vlc for me, even if I rm -rf .local/share/QMediathekView/ before launching.

Ah, do not that the configuration probably lives in ~/.config/QMediathekView. But you can just try the "Restore defaults" button in the settings dialog as well.

@adamreichold
Copy link
Owner Author

@probonopd I know this is not strictly related, but is there an easy way to trigger an update of the meta-data (screenshot, AppStream meta-data) on AppImageHub?

@probonopd
Copy link
Contributor

probonopd commented Jan 6, 2019

is there an easy way to trigger an update of the meta-data (screenshot, AppStream meta-data) on AppImageHub?

Define "easy"... editing https://github.com/AppImage/appimage.github.io/blob/master/data/QMediathekView will trigger a new run of the test. (I should probably code something so that application authors can press a button to trigger new runs.)

All of the actual data gets into the database in a fully automatic way, you can see the history here: https://github.com/AppImage/appimage.github.io/commits/master/apps/QMediathekView.md

@adamreichold
Copy link
Owner Author

editing https://github.com/AppImage/appimage.github.io/blob/master/data/QMediathekView will trigger a new run of the test.

I thought of that, but I am not sure what to edit there? Adding a newline just to trigger this?

@probonopd
Copy link
Contributor

I thought of that, but I am not sure what to edit there? Adding a newline just to trigger this?

Currently yes, I know it's not ideal yet.

@adamreichold
Copy link
Owner Author

So does it work using the "Restore defaults" button? What does that grep line yield?

@probonopd
Copy link
Contributor

In f19aeca the button is too small to read the text, clicking it does not seem to do anything. Also no output in the terminal.

@adamreichold
Copy link
Owner Author

Also no output in the terminal.

That is expected, but what does running

sh -c "grep '^Exec=' /usr/share/applications/`xdg-mime query default video/mp4` | cut -d'=' -f2 | cut -d' ' -f1"

in a terminal yield for you?

@probonopd
Copy link
Contributor

I have to admit that this is interesting, to say the least...

me@host:~$ sh -c "grep '^Exec=' /usr/share/applications/`xdg-mime query default video/mp4` | cut -d'=' -f2 | cut -d' ' -f1"
grep: /usr/share/applications/parole.desktop: No such file or directory

me@host:~$ find /usr/ | grep parole | grep desktop
/usr/share/parole/parole-plugins-0/mpris2.desktop
/usr/share/parole/parole-plugins-0/notify.desktop
/usr/share/parole/parole-plugins-0/system-tray.desktop

Maybe there is a better way to find out the default video player...

@adamreichold
Copy link
Owner Author

Maybe there is a better way to find out the default video player...

But how does that work, i.e. xdg-mime yields parole.desktop but that file does not exist on your machine even though Parole is installed? Does it use some other launcher file? In any case, I am happy for suggestions on to do this...

@probonopd
Copy link
Contributor

Have to admit that I am puzzled here, too

@adamreichold adamreichold force-pushed the use-default-video-player branch 2 times, most recently from b12b099 to 6cd2586 Compare January 6, 2019 17:24
@adamreichold
Copy link
Owner Author

Have to admit that I am puzzled here, too

Ok, so I guess you do have Parole installed? And when you apply xdg-open to an MP4 file, it will run Parole? If so the question is just how your DE infers the correct desktop file from the ID given by xdg-mime? Do you know which desktop file Parole is started from?

@probonopd
Copy link
Contributor

There are more locations in which desktop files can reside, e.g., .local/share/applications/. Sorry if I mislead you with the xdg-mime command, I think that's a partial solution at best and we (I) don't know the "proper" solution yet.

@adamreichold adamreichold force-pushed the use-default-video-player branch from 6cd2586 to 42675b2 Compare February 8, 2020 11:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants