[Digikam-devel] [Bug 88932] add service menus functionality

Arnd Baecker arnd.baecker at web.de
Mon Apr 30 15:18:19 BST 2007


------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=88932         




------- Additional Comments From arnd.baecker web de  2007-04-30 16:18 -------
What I use to get additional actions for a right click is

  cd MyDesktopFiles
  # create folder if not already available:
  mkdir ~/.kde/share/applnk/.hidden
  cp *.desktop ~/.kde/share/applnk/.hidden

A desktop file may then look like (without the #)
#########################################
[Desktop Entry]
Comment=
Comment[en_US]=
Exec=$HOME/MyScripts/digikam_test.py  %U
GenericName=Test
GenericName[en_US]=Test
InitialPreference=7
MimeType=image/jpeg
Name=Test
Name[en_US]=Test
Path=
StartupNotify=true
Terminal=false
TerminalOptions=
Type=Application
X-DCOP-ServiceType=none
X-KDE-SubstituteUID=false
X-KDE-Username=
######################################

The script may then for example look like
# --- cut here 
#! /usr/bin/env python

import os
import sys

img_name = sys.argv[1]
# Remark further selected images would be in sys.argv[2], sys.argv[3], ...

# Get the name of the folder:
img_folder = os.path.split(img_name)[0]

print "img_name=", img_name
print "img_folder=", img_folder

print "now do whatever you want with the image (or images)"
# --- cut here

So it is not too complicated, but, as mentioned in #6, 
writing something like "create_album.py %U"
is simpler than the above.

Question: is it possible to assign keyboard short-cuts 
corresponding to such .desktop files?



More information about the Digikam-devel mailing list