File: kupfer-exec.in

package info (click to toggle)
kupfer 329-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,352 kB
  • sloc: python: 37,681; makefile: 88; sh: 78; xml: 3
file content (38 lines) | stat: -rwxr-xr-x 846 bytes parent folder | download | duplicates (5)
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
#!/bin/sh

# This is a helper program to execute saved command files,
# by sending them to a running instance of Kupfer.

export TEXTDOMAIN='@PACKAGE@'
export TEXTDOMAINDIR='@LOCALEDIR@'

PYTHON='@PYTHON@'

if test ! -f "$1"
then
	echo "A file argument required"
	exit 1
fi

SERVICE="io.github.kupferlauncher"
OBJ="/io/github/kupferlauncher"
IFACE="io.github.kupferlauncher.Listener"

while test $# != 0
do
	FILE=$(readlink -f "$1")
	dbus-send --print-reply --dest=$SERVICE $OBJ \
		$IFACE.ExecuteFileOnDisplay string:"$FILE" \
		string:"$DISPLAY" string:"$DESKTOP_STARTUP_ID" \
		> /dev/null 2>&1
	KUPFER_RUNNING=$?

	if test $KUPFER_RUNNING != 0
	then
		# NOTE: If you change this string, you have to change
		# it inside kupfer/version.py as well.
		zenity --info --text "$(gettext 'Could not find running Kupfer')" &
		exit 1
	fi
	shift
done