Page 2 of 2

Posted: Sat 17 Nov 2012, 14:51
by pemasu
Is this finding relevant to the packages categories work:
http://www.murga-linux.com/puppy/viewto ... 179#665179

Inspecting desktop files

Posted: Sun 18 Nov 2012, 18:17
by seaside
While there are some perl and python programs to convert a deb file to a tar.gz file, I was surprised to find that just using linux tools was actually faster.

I found that the tar file starts at exactly 60 bytes offset from the header "data.tar.gz". (At least in the 6 deb files I tested). So here's an extractor for *.desktop files.

Code: Select all

#!/bin/sh
# extract *.desktop file from .deb file $1
# seaside November 18 2012

p=`grep --binary-files=text -m1 -b -o 'data.tar.gz' "$1"`
startp=$((${p%:*} + 60)) # add 60 to 'data.tar.gz'
dd if="$1" bs="$startp" skip=1 | tar -xz --strip 4 --wildcards --no-anchored '*.desktop' 
Some further processing, checking right from the download could also be possible.

Actually, I might as well make a right-click deb2tar program out of this.

EDIT: deb2tgz. pet here
http://murga-linux.com/puppy/viewtopic. ... 691#665691

Cheers,
s

Package categories help wanted

Posted: Tue 20 Nov 2012, 20:03
by L18L
All data and scripts are in one directory.

fill_categories.tgz came a little later than the pictures

Code: Select all

./reset # (only if starting or restart)
./fill_categories_GUI
The inserted package names are merged with the existing package names and sorted.

---------------------------------
edit
Note please
fill_categories_GUI line 154 wrote: comm="`grep Comment= ../bk/a/$packagename.desktop | cut -d '=' -f2`"
this has to changed to link to the directory containing the .desktop files. These data have been uploaded here.
------
edit
above link here corrected (start=12, not 13)

Posted: Tue 20 Nov 2012, 21:16
by L18L
pemasu wrote:Is this finding relevant to the packages categories work:
http://www.murga-linux.com/puppy/viewto ... 179#665179
Yes, I think so.

Posted: Tue 20 Nov 2012, 21:17
by pemasu
It has been fixed with latest woof commits.

http://www.murga-linux.com/puppy/viewto ... 483#665483

Re: Package categories help wanted

Posted: Wed 21 Nov 2012, 08:54
by L18L
L18L wrote:edit
Note please
fill_categories_GUI line 154 wrote: comm="`grep Comment= ../bk/a/$packagename.desktop | cut -d '=' -f2`"
this has to changed to link to the directory containing the .desktop files. These data have been uploaded here.
Sorry, my fault, wrong link to .desktop files.

All needed .desktop files are in applications.tar.gz down loadable from

http://murga-linux.com/puppy/viewtopic. ... 6&start=12 (not ....13)

Getting these .desktop files was the bandwidth consuming part.

Posted: Wed 21 Nov 2012, 21:01
by technosaurus
I went through the desktop files looking for any gotchas and to see if it would be feasible to just include the icons but noticed that:
(41) apps use svg icons (not supported by jwm) ... need a wrapper to convert to png and modify desktop file on install
(15) specify no icon

Posted: Fri 23 Nov 2012, 02:54
by sunburnt
Oddly I can`t find any standard saying the icons are to have no extension.
But it`s obviously the case as none ( or few ) icons in desktop files do.
I`ve gotten an error once with a desktop file that had an icon extension.
# So it`s a good idea for Puppy to follow the no icon extension standard.

I think it was intended for the user app. to parse for the icon type it wants.
Example for JWM:

Code: Select all

icon=`cat (app).desktop |grep 'Icon='`
Icon=`ls $ThemeIconPath/${icon#*=} |egrep '(png|xpm)'`
Here are links to the FreeDesktop standards for Catagories, Icons, etc.

http://standards.freedesktop.org/menu-s ... c-1.0.html

Has code near bottom of page for parsing icons:
http://standards.freedesktop.org/icon-t ... atest.html

http://standards.freedesktop.org/icon-n ... atest.html

http://standards.freedesktop.org/deskto ... 01s06.html

http://standards.freedesktop.org/deskto ... 01s05.html

Posted: Fri 23 Nov 2012, 10:10
by amigo
"standard saying the icons are to have no extension" It's in the specs for desktop files. For icons which are correctly installed under /usr/share/icons, no path nor file extension should be given. This is assuming that your WM knows how to correctly find the icon -respecting any theme you have chosen, etc.

However, if using some non-standard location for the icon, then you should give the full path and filename.