summaryrefslogtreecommitdiffstats
path: root/src/utilities/hotplug/digikam-camera
blob: 10b2fe3f62b11f7369139e7474d14fef450b30b7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/sh

action="$1"; shift;

case "$action" in
detect)
	cmdoption=--detect-camera
	dcopcall=detectCamera
	;;
storage)
	cmdoption=--download-from
	dcopcall=downloadFrom
    args="$@"
	;;
*)
	echo "${0##*/}: wrong action.  Usage"
	echo "	${0##*/}  detect 	# for gphoto2 supported cameras"
	echo "	${0##*/}  storage <url>	# for usbdisk or directries with images"
	exit 1
	;;
esac

for app in `dcop`; do
	case "$app" in
	    digikam-*)
		echo "recycling running $app: $dcopcall $@"
        if test -z "$args"; then
		    exec dcop "$app" camera  "$dcopcall"
        else
            exec dcop "$app" camera  "$dcopcall" "$args"
        fi
	    ;;
	esac
done;
echo "starting digikam with $cmdoption $args"
if test -z "$args"; then
    exec digikam  "$cmdoption"
else
    exec digikam  "$cmdoption" "$args"
fi