summaryrefslogtreecommitdiff
path: root/homepanel-control
diff options
context:
space:
mode:
authordakkar <dakkar@thenautilus.net>2015-09-27 12:49:30 +0100
committerdakkar <dakkar@thenautilus.net>2015-09-27 12:49:30 +0100
commit689e7c7ea4b793db7bb13ac3326256963e7ea3c0 (patch)
treeed73bf66ddbfc69e8cf54e53e93ed55dbdfe88ad /homepanel-control
parentfix config loading (diff)
downloadHomePanel-689e7c7ea4b793db7bb13ac3326256963e7ea3c0.tar.gz
HomePanel-689e7c7ea4b793db7bb13ac3326256963e7ea3c0.tar.bz2
HomePanel-689e7c7ea4b793db7bb13ac3326256963e7ea3c0.zip
tweaks to run on the new machine
Diffstat (limited to 'homepanel-control')
-rwxr-xr-xhomepanel-control29
1 files changed, 20 insertions, 9 deletions
diff --git a/homepanel-control b/homepanel-control
index 0f31339..cb44727 100755
--- a/homepanel-control
+++ b/homepanel-control
@@ -3,29 +3,40 @@ use strict;
use warnings;
use Daemon::Control;
use Path::Tiny;
+use Config::Any;
my $basedir = path(__FILE__)->parent->realpath;
+my $config_file = $basedir->child('homepanel.conf');
+my $cfg_set = Config::Any->load_files({
+ files => [$config_file],
+ use_ext => 1,
+});
+my %config = map { %{(values %$_)[0]} } @$cfg_set;
+my $dest_dir = path($config{output_file})->parent->realpath;
+my $icons = $basedir->child('icons');
+
exit Daemon::Control->new(
- init_code => <<'INIT',
-export SHELL=/bin/bash
-export PERLBREW_ROOT=/data/perl5
-export PERLBREW_HOME=/home/dakkar/.perlbrew
-. /data/perl5/etc/bashrc
+ init_code => <<"INIT",
+if [ ! -d $dest_dir/icons ]; then
+ mkdir -p $dest_dir
+ mount -t tmpfs none $dest_dir
+ cp -a $icons $dest_dir/
+fi
+
+PERL5LIB="/home/dakkar/perl5/libs/HomePanel/lib/perl5\${PERL5LIB+:}\${PERL5LIB}"; export PERL5LIB;
INIT
name => "HomePanel",
- lsb_start => '$local_fs $network $named $time',
- lsb_stop => '$local_fs $network $named $time',
lsb_sdesc => 'Home info panel',
lsb_desc => 'Show forecast, tube, bus status.',
path => path(__FILE__)->realpath,
program => $basedir->child('driver-async.pl'),
- program_args => [ $basedir->child('homepanel.conf') ],
+ program_args => [ $config_file ],
user => 'dakkar',
- group => 'www-data',
+ group => 'users',
directory => $basedir,
pid_file => $basedir->child('homepanel.pid'),