I have Unity's launcher hidden as I prefer to use cairo dock.
This is why I am trying to find a way to make the things installed from the Ubuntu Software Center to automatically set a shortcut in my desktop.
I have Unity's launcher hidden as I prefer to use cairo dock.
This is why I am trying to find a way to make the things installed from the Ubuntu Software Center to automatically set a shortcut in my desktop.
Run the script below in the background and it will automatically create a starter on your desktop on (only) newly installed software.
It also:
NoDisplay=true
)gedit
), save it somewhere as make_starter.py
.If you first want to test it: run it from a terminal window by the command:
python3 /path/to/make_starter.py
Install an application like you are used to. An icon should appear on your desktop after installation has finished
If all works fine, add it to your startup applications: Dash > Startup Applications > Add. Add the command:
python3 /path/to/make_starter.py
Note
Localized versions of Ubuntu may have a different name for "Desktop" ("Bureaublad" in Dutch). If so, replace in the line:
desktopname = "Desktop"
"Desktop" by the loacalized name.
#!/usr/bin/env python3
import subprocess
import os
import time
import shutil
desktopname = "Desktop"
dr = "/usr/share/applications"
while True:
current = os.listdir(dr)
time.sleep(10)
last = os.listdir(dr)
for item in last:
if not item in current and item.endswith(".desktop"):
file = dr+"/"+item
with open(file) as src:
text = src.read()
if not "NoDisplay=true" in text:
target = os.environ["HOME"]+"/"+desktopname+"/"+item
shutil.copyfile(file, target)
command = "chmod +x "+target
subprocess.Popen(["/bin/bash", "-c", command])
Perl
script by accident :)
This will be incredibly messy, since there might be well over a hundred application icons. The icons (actually, desktop launcher files) are usually in /usr/share/applications
. So you could run the following command in a terminal:
find /usr/share/applications -type f -name '*.desktop' -exec cp --target-directory ~/Desktop/ {} +
but this would create a copy of every single launcher on your desktop. (possibly a few hundred, depending on your environment)
You could browse /usr/share/applications
in the file manager, and manually copy them for relevant applications to the desktop. There's no automatic way to make the Software Centre do this, as far as I can tell.
dpkg
and diff
the new selections list and the previous selections list after each installation. Then, shortcuts can be created using a script which copies the relevant .desktop
files to the desktop.
Jan 6, 2015 at 5:09
ls /usr/share/applications/*.desktop | wc
gives: 168 168 7851