Guide: Making Group Launchers On Xfce Desktop


Pleng

Well-Known Member
Joined
Dec 28, 2006
Messages
3,030
It is of course possible to have PNDs showing on your desktop by putting them in the appropriate folder on your desktop. But what if you want, say, an icon for a group such as Emulators, upon opening which a list of emulators will be displayed to choose from? Well here's a nasty hacky solution to doing so.

Current Limitations:
  • No use of the PND system to add links to groups automatically. Everything has to be handled manually.
  • No tracking of apps via the PND system. Links will be displayed regardless of their presence.
  • No custom icons. Each group is represented by a generic folder icon, and each applications by a standard document icon.
Any ideas for improving this are more than welcome!

Ok so firstly we need to create the groups, then we need to create the app launchers and finally we need to put the groups onto the desktop.

Firstly, to create the groups you need to make a folder called 'launchers' on the root of one of your SD cards. If you don't want the folder to clutter up the root of your card, you can name it .launchers - that way it will appear hidden. You can use Thunnar to create this folder. Inside your new launchers folder create one folder for each group you want to create (I have one called Emulators, one called Games, and one called Multimedia).

Next we need to make some scripts to actually run the apps. Right click in the empty space inside your folder and click Create Document --> Empty file. Give this file a name that describes the application it's going to launch. For example in my Emulators folder I have a launcher for Picodrive which I have named 'Megadrive'

Right click on the newly created document and select 'open with mousepad' type the following:

Code:
  #!/bin/bash
  pnd_run /media/[YOURSDCARDNAME]/[PATH_TO_PNDFILE]/[NAME_OF_PNDFILE.pnd
  exit 0

for example my Megadrive file contains the line:
pnd_run /media/APPS/pandora/menu/PicoDrive_180_beta1.pnd

You need to do this for all apps you want in the group. Once I'd made the first file I found it easier to simply change the name of the PND in mousepad then click 'save as' to create the next file, as opposed to starting from scratch.

You probably don't have to do the following steps on a Fat32 card, but I did anyway, just to be sure. Once you have all your launcher scripts prepared, quit mousepad and again in a blank area in your launcher folder right click and select 'Open Terminal Here'

type the following line into the terminal:

sudo chmod o+x *

Exit the terminal. Now repeat the process with all groups you have made.

Ok we're nearly good to go. We just need to make the groups appear on the desktop.

Open a command prompt and type the following command:

cd ~/Desktop
then for each group you want to add to the desktop:

sudo ln -s /media/[YOURSDCARD]/launchers/[YOURGROUPNAME] [NAMETOAPPEARONDESKTOP]

Don't forget to change launchers to .launchers if you decided to have the folder hidden. As an example one of my commands looked like this:

sudo ln -s /media/APPS/.launchers/Emulators Emulators

You should now have an icon on your desktop which when clicked opens Thunar and allows you to run the apps. As I said, it's hacky and leaves plenty of room for improvement, but it does the trick.

View attachment 453

View attachment 454
 
it would be possible to use .desktop files to create custom icons for the groups. Unfortunately, .desktop icons get deleted when XFCE is restared or SD cards are moved about, due to the .PND system.
 
I made a script which does the following:

Copies all the desktop and menu entries to a temp folder, then launches a thunar instance in said folder. I mapped it to a keyboard key, so I can easily bring up a list of apps.

It's kind of a super simple launcher, bt because it's in Thunar you can jump to the program by typing in the first few letters.

Anyone interested in this?
 
Ok, just played around a litle bit. One question though: how can I delete the folder from the desktop?
:)
 
I would have thought a right click would give you the option to delete would it not? If not, then you should be able to open up a terminal and type cd $HOME/.desktop and rm *

I presume that path is correct; haven't actually checked it out to be honest...
 
Back
Top