diff --git a/lib/GUI.pm b/lib/GUI.pm index beb8552..1273bd6 100644 --- a/lib/GUI.pm +++ b/lib/GUI.pm @@ -111,7 +111,7 @@ sub new { # initialize main window $self->{'mw'} = Gtk2::Window->new("toplevel"); $self->{'mw'}->set_title("TinyCA2 Management $self->{'version'}"); - $self->{'mw'}->set_icon_from_file("./icons/tinyca.png"); + $self->{'mw'}->set_icon_from_file($self->{'init'}->{'progdir'}."/icons/tinyca.png"); $self->{'mw'}->set_resizable(1); $section = $self->{'init'}->{'cfg'}->{window}; diff --git a/tinyca.cnf.example b/tinyca.cnf.example index f396d96..38a4193 100644 --- a/tinyca.cnf.example +++ b/tinyca.cnf.example @@ -1,3 +1,6 @@ +[global] +debug = false + [paths] basedir = /var/lib/tinyca exportdir = /tmp diff --git a/tinyca2 b/tinyca2 index 692303b..c7c2087 100755 --- a/tinyca2 +++ b/tinyca2 @@ -29,6 +29,7 @@ use MIME::Base64; use POSIX; use Locale::gettext; +use File::Basename; use OpenSSL; use CA; @@ -45,15 +46,17 @@ use REQ; use KEY; use TCONFIG; +my $init = {}; +$init->{'progdir'} = dirname($0); + setlocale(LC_MESSAGES, ""); -bindtextdomain("tinyca2", "./locale/"); +bindtextdomain("tinyca2", $init->{'progdir'}."/locale/"); textdomain("tinyca2"); # https://bugs.gentoo.org/show_bug.cgi?id=78576 $ENV{XLIB_SKIP_ARGB_VISUALS}= '1'; my $cfg = HELPERS::read_global_cfg(); -my $init = {}; # location of openssl $init->{'opensslbin'} = $cfg->{paths}{opensslbin} // "/usr/bin/openssl"; @@ -77,7 +80,7 @@ if(not -x $init->{'tarbin'}) { } # directory with the templates -$init->{'templatedir'} = $cfg->{paths}{templatedir} // "./templates"; +$init->{'templatedir'} = $cfg->{paths}{templatedir} // $init->{'progdir'}."/templates"; if(not -d $init->{'templatedir'}) { print gettext("Can't find templatedir.\n");