commit 02306f0867766f1c6bce8d06d0779c9efd87e8a2 Author: Sukhbir Singh sukhbir@torproject.org Date: Tue Jul 14 00:22:20 2015 -0400
Add start-tor-messenger.desktop and execdesktop scripts --- projects/tor-messenger/execdesktop | 14 +++++++++ projects/tor-messenger/start-tor-messenger.desktop | 33 ++++++++++++++++++++ 2 files changed, 47 insertions(+)
diff --git a/projects/tor-messenger/execdesktop b/projects/tor-messenger/execdesktop new file mode 100644 index 0000000..0d11d75 --- /dev/null +++ b/projects/tor-messenger/execdesktop @@ -0,0 +1,14 @@ +#!/bin/bash + +TM_START_PROG="$(grep '^X-TorMessenger-ExecShell' $1 | tail -1 | sed 's/^X-TorMessenger-ExecShell=//' | sed 's/%.//')" + +shift + +if [ "$#" -ge 1 ] +then + echo "Launching '${TM_START_PROG} $@'..." +else + echo "Launching '${TM_START_PROG}'..." +fi + +eval "${TM_START_PROG} $@" diff --git a/projects/tor-messenger/start-tor-messenger.desktop b/projects/tor-messenger/start-tor-messenger.desktop new file mode 100644 index 0000000..c0f6fdb --- /dev/null +++ b/projects/tor-messenger/start-tor-messenger.desktop @@ -0,0 +1,33 @@ +#!/usr/bin/env ./Messenger/execdesktop +# +# This file is a self-modifying .desktop file that can be run from the shell. +# It preserves arguments and environment for the start-tor-messenger script. +# +# Run './start-tor-messenger.desktop --help' to display the full set of options. +# +# When invoked from the shell, this file must always be in a Tor Messenger root +# directory. When run from the file manager or desktop GUI, it is relocatable. +# +# After first invocation, it will update itself with the absolute path to the +# current TBB location, to support relocation of this .desktop file for GUI +# invocation. You can also add Tor Messenger to your desktop's application menu by +# running './start-tor-messenger.desktop --register-app' +# +# If you use --register-app, and then relocate your TBB directory, Tor Messenger +# will no longer launch from your desktop's app launcher/dock. However, if you +# re-run --register-app from inside that new directory, the script will correct +# the absolute paths and re-register itself. +# +# This file will also still function if the path changes when TBB is used as a +# portable app, so long as it is run directly from that new directory, either +# via the shell or via the file manager. + +[Desktop Entry] +Type=Application +Name=Tor Messenger Setup +GenericName=Instant Messenger +Comment=Tor Messenger is +1 for privacy and -1 for mass surveillance +Categories=Network;Chat;Security; +Exec=sh -c '"$(dirname "$*")"/Messenger/start-tor-messenger --detach || ([ ! -x "$(dirname "$*")"/Messenger/start-tor-messenger ] && "$(dirname "$*")"/start-tor-messenger --detach)' dummy %k +X-TorMessenger-ExecShell=./Messenger/start-tor-messenger --detach +Icon=instant-messenger
tor-commits@lists.torproject.org