On Sat, Mar 08, 2014 at 05:57:03PM +0200, Antonis Tsolomitis wrote:
> 
> 
> On 06/03/2014 02:26, Isaac wrote:
> > Hello,
> > I've been working on desktop2dt some more, and have a version that 
> > works much better.
> > It can handle icons in subdirectories, installing files (to $DESTDIR/etc/dt
> > or ~/.dt), and terminal applications.
> >
> > There are still some missing features:
> > -line-wrapped entries 
> > -adding entries to the app manager
> > -file types and associations
> >  Unless we use libmagic, this will be a real pain.
> > -multiple locales ( for example, Comment[de]= could make an entry in the
> >  right locale).
> >  
> > Currently, it's hard-coded to output action databases in the C locale.
> >
> >
> > Usage is similar to the last version, except -i installs everything:
> > desktop2dt -i /usr/share/applications/nedit.desktop \
> >  /usr/share/applications/xephem.desktop
> > touch ~/.dt/appmanager/Desktop_Apps/nedit
> > touch ~/.dt/appmanager/Desktop_Apps/xephem
> > chmod +x ~/.dt/appmanager/Desktop_Apps/nedit
> > chmod +x ~/.dt/appmanager/Desktop_Apps/xephem
> >
> >  and then go to Desktop_Tools > Reload Applications
> >
> >  If you can test it, that will be a great help.  I've tried to stick to 
> > POSIX,
> > but I only tested on Squeeze.
> >
> > Thanks,
> > Isaac Dunham
> >
> 
> 
> Hi Isaac,
> 
> I tested your script. It does work and creates the icons and the type
> file. Nice.
> 
> One change I think it needs is to change the %u argument to %Arg_1%
> The latter allows to drag and drop. Dropping a file on the created
> action opens the file
> in the program the action launches.

Should be a matter of changing the "/%F/" on line 70 to "/%[ufUF]/".

> If I may make a suggestion, I thing it would be nice if your script
> reads the Categories= string
> and place the action it creates in its category. Firefox goes to
> Network, Gimp to Graphics etc.
> Of course this assumes that the script creates these categories. I have
> created such categories manually
> in my desktop_approots.tgz file found in
> http://myria.math.aegean.gr/~atsol/newpage-en/software/cde/

Parsing Categories=...
That should be easy enough; if $APPMGR is the directory where dtappmanager
looks, it's something like:
for i in  `sed -ne 's/^Categories=//' -e 's/;/ /p'` $1
  do mkdir "$APPMGR/$i"
  touch "$APPMGR/$i/`basename $1 .desktop`"
  chmod +x "$APPMGR/$i/`basename $1 .desktop`"
  done

Or perhaps that should be 
for i in "`sed -n -e 's/X-[^;]*;//g' -e 's/GTK;//' -e 's/Motif;//'  \
-e 's/Qt;//' -e 's_;_/_g' -e 's/^Categories=//p' $1`"
  do mkdir "$APPMGR/$i"
  touch "$APPMGR/$i/`basename $1 .desktop`"
  chmod +x "$APPMGR/$i/`basename $1 .desktop`"
  done

I'm not sure which is the proper approach.
Either way, it should go after the line that creates the *.dt files.

The main downside is the number of BS categories that some developers and 
packagers have come up with.
For instance:
qtpfsgui.desktop:Categories=Graphics;RasterGraphics;Photography;Viewer;Qt;
reportbug.desktop:Categories=Application;System;
sqlitebrowser.desktop:Categories=Development;Database;Qt;
sylpheed.desktop:Categories=GTK;Network;Email;News;
ted.desktop:Categories=Office;TextEditor;
uninstaller.desktop:Categories=Application;System;
v4l2ucp.desktop:Categories=Settings;HardwareSettings;
wine.desktop:Categories=Emulator;
winecfg.desktop:Categories=Application;System;
wpa_gui.desktop:Categories=Qt;Network;
xephem.desktop:Categories=Application;Education;Science;Astronomy;
xiphos.desktop:Categories=Education
xpaint.desktop:Categories=Graphics;2DGraphics;
xpdf.desktop:Categories=Viewer;Graphics;
xplore.desktop:Categories=Utility;FileTools;FileManager;
gnumeric.desktop:Categories=Office;Spreadsheet;Science;Math;GNOME;GTK;
googleearth.desktop:Categories=Network;
gvim.desktop:Categories=Utility;TextEditor;
iceweasel.desktop:Categories=Network;WebBrowser;
ida.desktop:Categories=Motif;Graphics;Viewer
libreoffice-draw.desktop:Categories=Office;Graphics;
libreoffice-impress.desktop:Categories=Office;
libreoffice-startcenter.desktop:Categories=Office;X-Red-Hat-Base;X-SuSE-Core-Office;X-MandrivaLinux-Office-Other;

Some have useable information, but many serve only to render navigation
difficult and obscure function.
(This is why I stuck the regex to remove X-*; from the path in the second
example.)

> Moreover notice that the Advanced User & Administration Guide suggests
> installation
> outside /etc/dt/ and suggests to create links in there running
> dtappintegrate.
> dtappintegrate did not work for me so I created simple scripts in the
> above file to
> be run and create the links in /etc/dt/
> 
> Antonis.

Ah, thanks. 
The downside is that installing in $PREFIX/dt/ may be a worse idea
when $PREFIX is /usr.

Isaac.

------------------------------------------------------------------------------
Subversion Kills Productivity. Get off Subversion & Make the Move to Perforce.
With Perforce, you get hassle-free workflows. Merge that actually works. 
Faster operations. Version large binaries.  Built-in WAN optimization and the
freedom to use Git, Perforce or both. Make the move to Perforce.
http://pubads.g.doubleclick.net/gampad/clk?id=122218951&iu=/4140/ostg.clktrk
_______________________________________________
cdesktopenv-devel mailing list
cdesktopenv-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cdesktopenv-devel

Reply via email to