Deluge.app - launching deluge-web and deludged

Support for Deluge on Apple Mac OS
nemith

Deluge.app - launching deluge-web and deludged

Postby nemith » Tue Jul 31, 2012 1:01 am

With deluge installed via ports I created a LaunchAgent to start deluge-web and deluged automatically at boot. Flexget was able to interact with deluge no mater if i had started the app or not. Actually I never used the GTK frontend and accessed it all via the web (it is a mac mini hooked to my TV).

I was poking around the Deluge.app/ directory and the script entry points for deludged and deluge-web cannot be found.

Is there a way to launch deluged and deluge-web from the prebuild Deluge.app?

Cas
Top Bloke
Top Bloke
Posts: 3474
Joined: Mon Dec 07, 2009 6:04 am
OS or Distro: Ubuntu 16.04
Location: Scotland

Re: Deluge.app - launching deluge-web and deludged

Postby Cas » Fri Aug 03, 2012 9:14 pm

You should be able to manually create those entry scripts for deluge-web and deluged in the app directory but without actually owning a Mac or VM installed I cannot test it.

Pierobon

Re: Deluge.app - launching deluge-web and deludged

Postby Pierobon » Sat Oct 27, 2012 7:26 pm

Hey, if you create those scripts, I will test them writing a plist file to auto-load everything on boot using mac-os launchd.

Cas
Top Bloke
Top Bloke
Posts: 3474
Joined: Mon Dec 07, 2009 6:04 am
OS or Distro: Ubuntu 16.04
Location: Scotland

Re: Deluge.app - launching deluge-web and deludged

Postby Cas » Mon Dec 31, 2012 1:51 pm

Here are the untested modified scripts for deluged which should be put in Deluge.app/Contents/MacOS

Deluged:

Code: Select all

#!/bin/sh

EXEC="exec"

name="`basename $0`"
if [[ "$0" == `pwd`* ]] || [[ "$0" == "//"* ]]; then
    full_path="$0"
else
    full_path="`pwd`/$0"
fi
tmp=`dirname "$full_path"`
tmp=`dirname "$tmp"`
bundle=`dirname "$tmp"`
bundle_contents="$bundle"/Contents
bundle_macos="$bundle_contents"/MacOS
bundle_res="$bundle_contents"/Resources
bundle_lib="$bundle_res"/lib
bundle_bin="$bundle_res"/bin
bundle_data="$bundle_res"/share
bundle_etc="$bundle_res"/etc

export DYLD_LIBRARY_PATH="$bundle_lib"
export XDG_CONFIG_DIRS="$bundle_etc"/xdg
export XDG_DATA_DIRS="$bundle_data"

#Set $PYTHON to point inside the bundle
export PYTHON="$bundle_macos/Deluge-python"
export PYTHONHOME="$bundle_res"
#Add the bundle's python modules
PYTHONPATH="$bundle_lib:$PYTHONPATH"
PYTHONPATH="$bundle_lib/python/lib-dynload/:$PYTHONPATH"
PYTHONPATH="$bundle_lib/python/:$PYTHONPATH"
export PYTHONPATH

# We need a UTF-8 locale.
lang=`defaults read .GlobalPreferences AppleLocale 2>/dev/null`
if test "$?" != "0"; then
    lang=`defaults read .GlobalPreferences AppleCollationOrder 2>/dev/null | sed 's/_.*//'`
fi
LANG=""
if test "$lang" != ""; then
    LANG="`grep \"\`echo $lang\`_\" /usr/share/locale/locale.alias | \
           tail -n1 | sed 's/\./ /' | awk '{print $2}'`"
fi
if test "$LANG" == ""; then
    export LANG="C"
else
    export LANG="$LANG.utf8"
fi

if test -f "$bundle_lib/charset.alias"; then
    export CHARSETALIASDIR="$bundle_lib"
fi

# Extra arguments can be added in environment.sh.
EXTRA_ARGS=
if test -f "$bundle_res/environment.sh"; then
    source "$bundle_res/environment.sh"
fi

# Strip out the argument added by the OS.
if [ "x`echo "x$1" | sed -e "s/^x-psn_.*//"`" == "x" ]; then
    shift 1
fi

#Note that we're calling $PYTHON here to override other versions
$EXEC "$PYTHON" "$bundle_contents/MacOS/Deluged-bin" #-l ~/.config/deluge/deluged.log -L debug


Deluged-bin:

Code: Select all

#!/usr/bin/python
# EASY-INSTALL-ENTRY-SCRIPT: 'deluge==1.3.5','console_scripts','deluged'
__requires__ = 'deluge==1.3.5'
import sys
from pkg_resources import load_entry_point

if __name__ == '__main__':
    sys.exit(
        load_entry_point('deluge==1.3.5', 'console_scripts', 'deluged')()
    )


Return to “Mac OS”

Who is online

Users browsing this forum: No registered users and 2 guests