You are not logged in.

#1 2014-05-12 23:50:12

vgf89
Member
Registered: 2014-05-12
Posts: 2

[SOLVED] Can't escape % character in .desktop file

I'm trying to get my mpv.desktop file to run using the  --autofit-larger=%99x%99  command but I can't seem to figure out how to escape the % characters correctly.

My Exec line currently looks like this:

Exec=mpv --really-quiet --force-window --autofit-larger=%%99x%%99 %F

For whatever reason, that doesn't seem to work (mpv won't start). This should be correct given the desktop entry specification here: http://standards.freedesktop.org/deskto … -variables

I've tried a few other stupid things, including using different escape characters and mixing and matching escape character, but no dice.

Running this works absolutely fine in a terminal, but those damn % characters in the --autofit-larger=99%x99% are troublesome for the .desktop file.

mpv --really-quiet --force-window --autofit-larger=99%x99% [video]

As for the reason I'm doing this, I'm getting around a window-management bug where mpv stays fullscreen if I load a video that's the same or larger than the resolution of my screen. I'd prefer for this desktop entry to work regardless of the resolution as well (setting --autofit-larger=1919x1079  gives the result I want but only on a 1920x1080 resolution).

Any ideas?

EDIT: I'm using Gnome 3. That could be relevant.
EDIT2 [SOLVED]: Nevermind, seems the error was in my line. I accidentally put the % symbols before, not after, the 99's (see the first code block above). Here's my fixed Exec line in case anyone else makes the same stupid mistake.

Exec=mpv --really-quiet --force-window --autofit-larger=99%%x99%% %F

Last edited by vgf89 (2014-05-13 02:50:08)

Offline

#2 2014-05-13 00:52:02

lucke
Member
From: Poland
Registered: 2004-11-30
Posts: 4,019

Re: [SOLVED] Can't escape % character in .desktop file

It works okay for me (in KDE), without any escaping.

Offline

Board footer

Powered by FluxBB