Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2010-02

programmatically creating desktop icons under Linux

7 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

brian

This question is specific to a PC running Kubuntu 9.1 64-bit with a KDE 4.1 desktop.

I have a large number of PDFs. Their filenames are not meaningful, but I do have a list of filename versus contents.

I'd like to be able to read that list and create a bunch of desktop icons using the contents as the name of each icon, and where clicking on the icons invokes okular to read the PDF. I haven't been able to find anything about creating such an icon programmatically from Free Pascal.

Can anyone point me in the right direction?

Thanks,

Brian.

Matthias Klumpp
to brian
brian wrote 13 lines
This question is specific to a PC running Kubuntu 9.1 64-bit with a KDE 4.1 desktop. I have a large number of PDFs. Their filenames are not meaningful, but I do have a list of filename versus contents. I'd like to be able to read that list and create a bunch of desktop icons using the contents as the name of each icon, and where clicking on the icons invokes okular to read the PDF. I haven't been able to find anything about creating such an icon programmatically from Free Pascal. Can anyone point me in the right direction?

Just create a link to those files with the desired filename in $HOME/Desktop
This works with GNOME too. If you want to create those links as Plasma-Widgets, you have to chnage the Plasma config files.

Matthias

Graeme Geldenhuys
to brian: This question is specific to a PC running Kubuntu 9.1 64-bit with a KDE 4.1 desktop. I…
brian wrote
Can anyone point me in the right direction?

Creating symbolic links (ls -s <src> <target>) should suffice. But if you want to do it the "official" way by creating desktop shortcuts via the *.desktop files, then read the follow spec document.

http://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html

For information on extending that idea and created menu entries in the Application menu, then following the next spec document.

http://www.freedesktop.org/wiki/Specifications/menu-spec?action=show&redirect=Standards%2Fmenu-spec

You can also install the xdg-utils (normally include with modern distros), which has helper scripts you can use to more easily setup mime-types, associated applications, menu and desktop icons.

http://portland.freedesktop.org/wiki/XdgUtils

With my current project, fpgInstall, which is a single file GUI setup/installer application build with fpGUI Toolkit, I am building in support to programmatically creating of desktop icons and menu entries. Unfortunately the project is not complete - thus I am not releasing the source code yet.

Regards, - Graeme - _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://opensoft.homeip.net/fpgui/
David W Noon
to Graeme Geldenhuys

On Sun, 7 Feb 2010 23:43:52 +0200, Graeme Geldenhuys wrote about Re: [fpc-pascal] programmatically creating desktop icons under Linux:

Show quoted text 6 lines
On 7 February 2010 23:42, Graeme Geldenhuys wrote: > > Creating symbolic links (ls -s <src> <target>) should suffice. Typo, it should read: ln -s <src> <target>

Actually, there is a symlink() API that can be called without creating a separate address space for an external command.

Regards, Dave [RLU #314465] ======================================================================= (David W Noon) =======================================================================
Marco van de Voort
to David W Noon

In our previous episode, David W Noon said:

Show quoted text 7 lines
> > > > Creating symbolic links (ls -s <src> <target>) should suffice. > > Typo, it should read: ln -s <src> <target> Actually, there is a symlink() API that can be called without creating a separate address space for an external command.

baseunix.fpsymlink()

brian
to David W Noon: On Sun, 7 Feb 2010 23:43:52 +0200, Graeme Geldenhuys wrote about Re: [fpc-pascal]…

Thanks for the info, everyone. Looks like I have a bit of reading to do...

Brian.

David W Noon wrote 10 lines
On Sun, 7 Feb 2010 23:43:52 +0200, Graeme Geldenhuys wrote about Re: [fpc-pascal] programmatically creating desktop icons under Linux: > On 7 February 2010 23:42, Graeme Geldenhuys > wrote: >> Creating symbolic links (ls -s <src> <target>) should suffice. > Typo, it should read: ln -s <src> <target> Actually, there is a symlink() API that can be called without creating a separate address space for an external command.