Starting with Ubuntu 11.10, this is the fastest way (at least for me) to create a new launcher on your desktop.
That being said, let's make a script called random_app
which will open a random application:
#!/bin/bash
apps_path="/usr/share/applications/"
random_app=$(grep -m 1 "^Exec" "$apps_path$(ls $apps_path | shuf -n 1)" | \
awk -F'[=| ]' '{ print $2 }')
$random_app
Save the script in your ~/bin
directory and make it executable using the following command in terminal:
chmod +x ~/bin/random_app
Now, you can create a launcher on your desktop as it is explained here for the script random_app
: