From cb8c85980260f519bd1dd8a540683a82cb1972f2 Mon Sep 17 00:00:00 2001 From: Cameron Norman Date: Fri, 7 Mar 2014 16:47:18 -0800 Subject: [PATCH] Create init.upstart Created an Upstart job. --- init.upstart | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 init.upstart diff --git a/init.upstart b/init.upstart new file mode 100644 index 00000000..dca883bd --- /dev/null +++ b/init.upstart @@ -0,0 +1,21 @@ +# headphones - Automatic music downloader +# +# This is a session/user job. Install this file into /usr/share/upstart/sessions +# if headphones is installed system wide, and into $XDG_CONFIG_HOME/upstart if +# headphones is installed per user. Change the executable path appropiately. + +start on desktop-session-start +stop on desktop-shutdown + +env CONFIG=""$XDG_CONFIG_HOME"/headphones/headphones.ini" +env DATA=""$XDG_DATA_HOME"/headphones" + +pre-start script + [ -d "$XDG_CONFIG_HOME"/headphones ] || mkdir -p "$XDG_CONFIG_HOME"/headphones + [ -d "$DATA" ] || mkdir -p "$DATA" + [ -f "$CONFIG ] || touch "$CONFIG" +end script + +exec headphones.py --daemon --nolaunch --quiet + --config "$CONFIG" + --datadir "$DATA"