Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Sat 14 Dec 2019, 07:58
All times are UTC - 4
 Forum index » House Training » Users ( For the regulars )
Does ROX pinboard support .desktop file specification?
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [15 Posts]  
Author Message
step

Joined: 04 May 2012
Posts: 1225

PostPosted: Tue 14 Oct 2014, 16:49    Post subject:  Does ROX pinboard support .desktop file specification?
Subject description: specifically %f and %F
 

ROX pinboard is the desktop manager. If user drops a file on the desktop icon of, say, AbiWord, can the pinboard pass the name of the dropped file to AbiWord? I'm using AbiWord as an example, but what I'm really after is how to write a .desktop file that enables dropping filenapaths for ROX pinboard. Is it possible?

I check freedesktop.org's .desktop file spec. It says that %f and %F in line Exec= are placeholders for filenames dropped onto a desktop icon, and that the desktop manager, or program launcher, is responsible for expanding the placeholders. For instance, Exec=leafpad %f should start leafpad passing the filepath of the dropped file. But in on my puppies (Blue pup/Quirky Tahr and Fatdog64) it doesn't work like that; %f and %F are left unexpanded in the argument list.

_________________
Fatdog64-810|+Packages|Kodi|gtkmenuplus
Back to top
View user's profile Send private message 
puppyluvr


Joined: 06 Jan 2008
Posts: 3504
Location: Chickasha Oklahoma

PostPosted: Tue 14 Oct 2014, 18:45    Post subject:  

Very Happy Hello,
Try adding this :
"$@" after the execute command.
Example:
exec leafpad "$@"
This usually works to make the icon "drop and run" enabled.

_________________
Close the Windows, and open your eyes, to a whole new world
I am Lead Dog of the
Puppy Linux Users Group on Facebook
Join us!

Puppy since 2.15CE...
Back to top
View user's profile Send private message Visit poster's website 
MochiMoppel


Joined: 26 Jan 2011
Posts: 1946
Location: Japan

PostPosted: Tue 14 Oct 2014, 23:15    Post subject: Re: Does ROX pinboard support .desktop file specification?
Subject description: specifically %f and %F
 

step wrote:
If user drops a file on the desktop icon of, say, AbiWord, can the pinboard pass the name of the dropped file to AbiWord?
Not just the name, it will pass the full path.
Quote:
what I'm really after is how to write a .desktop file that enables dropping filenapaths for ROX pinboard. Is it possible?
Nothing is impossible, but what makes you think that you need to write a .desktop file? Any files(s) dropped on a desktop icon are passed as arguments to the linked application.

Quote:
I check freedesktop.org's .desktop file spec. It says that %f and %F in line Exec= are placeholders for filenames dropped onto a desktop icon
Where did you read the desktop icon stuff? Nothing written here
Quote:
that the desktop manager, or program launcher, is responsible for expanding the placeholders.
Almost correct...
Quote:
For instance, Exec=leafpad %f should start leafpad passing the filepath of the dropped file. But in on my puppies (Blue pup/Quirky Tahr and Fatdog64) it doesn't work like that
Works here with Slacko 5.6. Field codes %f and %F work, but others do not (%c or %k). It makes a difference if the link in your desktop icon points directly to your application or if it points to the application's .desktop file. In both cases the files are passed as arguments, but in the latter case the arguments are passed indirectly to the application. Also keep in mind that .desktop files are the source for the Puppy menu. Placeholders in a command that you run from a menu make no sense as you can't drop anything on a menu entry, so none of the numerous .desktop files in Puppy uses them.
Back to top
View user's profile Send private message 
step

Joined: 04 May 2012
Posts: 1225

PostPosted: Wed 15 Oct 2014, 13:30    Post subject: Re: Does ROX pinboard support .desktop file specification?
Subject description: specifically %f and %F
 

MochiMoppel wrote:

Quote:
I check freedesktop.org's .desktop file spec. It says that %f and %F in line Exec= are placeholders for filenames dropped onto a desktop icon
Where did you read the desktop icon stuff? Nothing written here
You're right. It doesn't say anything about desktop icon. It says "The system reading the desktop entry...". I made the link between "The system" -> "ROX pinboard" -> "desktop icon".
Quote:
Quote:
For instance, Exec=leafpad %f should start leafpad passing the filepath of the dropped file. ...
Works here with Slacko 5.6. Field codes %f and %F work, but others do not (%c or %k).

Right, the example above works here too. I gave a bad example, sorry. Reset.
The specific setup I'm testing is a desktop icon obtained from dragging /usr/share/applications/app.desktop to the desktop, where /usr/share/applications/app.desktop contains Exec=app %F xyz. I use htop to check what gets started. If I drop two files, say /tmp/a and /tmp/b, on app's desktop icon htop shows (tested on Fatdog64):
Code:

/usr/bin/app %F xyz /tmp/a /tmp/b

So you see that %F isn't expanded. However, the list of files is appended to the command line, so some sort of expansion does take place, but it isn't positional. If on the other hand I change the Exec line to Exec=app %F, and drop the same files htop shows:
Code:

/usr/bin/app /tmp/a /tmp/b

which is correct. What does slacko do in both cases?
Quote:

It makes a difference if the link in your desktop icon points directly to your application or if it points to the application's .desktop file. In both cases the files are passed as arguments, but in the latter case the arguments are passed indirectly to the application. Also keep in mind that .desktop files are the source for the Puppy menu. Placeholders in a command that you run from a menu make no sense as you can't drop anything on a menu entry, so none of the numerous .desktop files in Puppy uses them.
Ok.
_________________
Fatdog64-810|+Packages|Kodi|gtkmenuplus
Back to top
View user's profile Send private message 
MochiMoppel


Joined: 26 Jan 2011
Posts: 1946
Location: Japan

PostPosted: Wed 15 Oct 2014, 22:26    Post subject: Re: Does ROX pinboard support .desktop file specification?
Subject description: specifically %f and %F
 

step wrote:
What does slacko do in both cases?
Expands correctly in both cases. Though the spec states otherwise (%f: A single file name, even if multiple files are selected), %f can handle multiple files. I see no difference in %f and %F. I also can't confirm the spec's limitation "A command line may contain at most one %f, %u, %F or %U field code": Multiple instances of %f are correctly expanded. To test the expansion you can use gxmessage:Exec=/usr/bin/gxmessage %F xyz

Quote:
However, the list of files is appended to the command line, so some sort of expansion does take place, but it isn't positional
No expansion here. ROX passes the filespecs, .desktop checks it it can find a suitable placeholder in its command and replaces the placeholder with the passed filespecs, if it can't find one, it adds the filespecs at the end of the command.
Back to top
View user's profile Send private message 
step

Joined: 04 May 2012
Posts: 1225

PostPosted: Thu 16 Oct 2014, 02:43    Post subject:  

Thank you for checking what happens on slacko. I will grab a slacko iso and test it with qemu. Which slacko iso or version did you check? Which ROX version? Do you have any sfs, pet, patch or local configuration that could affect the way ROX or desktop handle %F? Thanks.
_________________
Fatdog64-810|+Packages|Kodi|gtkmenuplus
Back to top
View user's profile Send private message 
MochiMoppel


Joined: 26 Jan 2011
Posts: 1946
Location: Japan

PostPosted: Thu 16 Oct 2014, 21:55    Post subject:  

step wrote:
Which slacko iso or version did you check? Which ROX version?.
Slacko 5.6, 5.7, Precise 5.7, Lucid 5.28 ...pick whatever you like. I checked them all (no local configurations, pets or artificial flavors added - straight out the box). All of them support field codes.

Still my question remains: Why do you need this? Why do you insist on using a .desktop file instead of a simple bash script?
Back to top
View user's profile Send private message 
step

Joined: 04 May 2012
Posts: 1225

PostPosted: Sat 18 Oct 2014, 02:13    Post subject:  

Partly because I want to understand. Partly because I want to add proper desktop files to the packages I build.
_________________
Fatdog64-810|+Packages|Kodi|gtkmenuplus
Back to top
View user's profile Send private message 
MochiMoppel


Joined: 26 Jan 2011
Posts: 1946
Location: Japan

PostPosted: Sat 18 Oct 2014, 02:47    Post subject:  

It doesn't really help you if your "proper desktop files" follow the freedesktop.org specifications to a tee when the desktop environment implements the specs less properly. I don't want to discourage you but I can't see what you gain from using them.
Back to top
View user's profile Send private message 
step

Joined: 04 May 2012
Posts: 1225

PostPosted: Sun 19 Oct 2014, 17:55    Post subject:  

Good point.
_________________
Fatdog64-810|+Packages|Kodi|gtkmenuplus
Back to top
View user's profile Send private message 
s243a

Joined: 02 Sep 2014
Posts: 2206

PostPosted: Tue 19 Mar 2019, 15:14    Post subject:  

MochiMoppel wrote:
step wrote:
Which slacko iso or version did you check? Which ROX version?.
Slacko 5.6, 5.7, Precise 5.7, Lucid 5.28 ...pick whatever you like. I checked them all (no local configurations, pets or artificial flavors added - straight out the box). All of them support field codes.

Still my question remains: Why do you need this? Why do you insist on using a .desktop file instead of a simple bash script?


If field codes are supported then why are the deleted in WoofCE?

line number 339 of /woof-code/2createpackages
Code:

    if [ -d packages-${DISTRO_FILE_PREFIX}/${GENERICNAME}${xxPETTYPE}/usr/share/applications/ ] ; then
      sed -i 's| %u|| ; s| %U|| ; s| %f|| ; s| %F||' packages-${DISTRO_FILE_PREFIX}/${GENERICNAME}${xxPETTYPE}/usr/share/applications/*.desktop
fi



Line number #611 of /usr/local/petget/installpkg.sh
Code:

for ONEDOT in `grep 'share/applications/.*\.desktop$' /root/.packages/${DLPKG_NAME}.files | tr '\n' ' '` #121119 exclude other strange .desktop files.
do
 #https://specifications.freedesktop.org/desktop-entry-spec/latest/ar01s07.html
sed -i 's| %u|| ; s| %U|| ; s| %f|| ; s| %F||' $ONEDOT


I ask because I'm trying to build a TazPup64 and the field codes seem to prevent some apps (e.g. pcmanfm) from opening within the jwm menu. .
Back to top
View user's profile Send private message Visit poster's website 
jamesbond

Joined: 26 Feb 2007
Posts: 3388
Location: The Blue Marble

PostPosted: Tue 19 Mar 2019, 21:23    Post subject:  

ROX-Filer supports some (but not all) of the field codes.
JWM supports none.

Most of the fields are there to support "drag and drop" or to support "launching a program when its associated data file is clicked" (e.g. launching libreoffice when .odt files are clicked).

ROX-Filer was way ahead of its time. Support for xdg stuff (in fact some of what it proposed "became" xdg stuff), desktop files, etc. This is back in way back 2005. But the thing is, things moved on and the specification that ROX-Filer once promoted kept adding more stuff, while ROX-Filer itself (at least the core part) has ceased development in around 2010 I think. Hence its partial support for the field codes; it doesn't support the newer ones.

_________________
Fatdog64 forum links: Latest version | Contributed packages | ISO builder
Back to top
View user's profile Send private message 
tallboy


Joined: 21 Sep 2010
Posts: 1572
Location: Drøbak, Norway

PostPosted: Wed 20 Mar 2019, 10:43    Post subject:  

Why do you need to use anything from the .desktop entry? I make a script in /root/my-applications/bin/ with the necessary tweaks, and drag it to the desktop.
Code:
#!/bin/bash
rm -r /root/.cache/moonchild*
wmctrl -s 3
exec /usr/bin/palemoon "$@" &
sleep 3
wmctrl -r "Pale Moon" -e 0,270,84,1200,910

or hTop that run in a terminal window:
Code:
#!/bin/sh
rxvt +sb -fn 9x15 -geometry 120x46+70+80 -bg black -fg white -title htop -e htop &


EDIT: I just discovered that this is not exactly a new thread...

_________________
True freedom is a live Puppy on a multisession CD/DVD.
Back to top
View user's profile Send private message 
Dry Falls

Joined: 16 Dec 2014
Posts: 596
Location: Upper Columbia

PostPosted: Wed 20 Mar 2019, 12:56    Post subject:  

Quote:
I ask because I'm trying to build a TazPup64 and the field codes seem to prevent some apps (e.g. pcmanfm) from opening within the jwm menu. .

I make a duplicate .desktop file (pcmanfm-JWM.desktop) with 'OnlyShowIn=JWM' entry added: 'exec=pcmanfm' (no field). Works for jwm menu.
Back to top
View user's profile Send private message 
s243a

Joined: 02 Sep 2014
Posts: 2206

PostPosted: Wed 20 Mar 2019, 14:39    Post subject:  

Dry Falls wrote:
Quote:
I ask because I'm trying to build a TazPup64 and the field codes seem to prevent some apps (e.g. pcmanfm) from opening within the jwm menu. .

I make a duplicate .desktop file (pcmanfm-JWM.desktop) with 'OnlyShowIn=JWM' entry added: 'exec=pcmanfm' (no field). Works for jwm menu.


Thankyou for the tip. That sounds like a very good idea Smile
Back to top
View user's profile Send private message Visit poster's website 
Display posts from previous:   Sort by:   
Page 1 of 1 [15 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » Users ( For the regulars )
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0798s ][ Queries: 11 (0.0196s) ][ GZIP on ]