summaryrefslogtreecommitdiffstats
path: root/drakxconf
blob: e5c0b7bc8797fb0630c5457ed90a88efbe9d3619 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/usr/bin/perl

use lib qw(/usr/lib/libDrakX);
use strict;

# i18n: IMPORTANT: to get correct namespace (drakconf instead of libDrakX)
BEGIN { unshift @::textdomains, 'drakconf' }

use standalone;     #- warning, standalone must be loaded very first, for 'explanations'
use interactive;
use common;

local $_ = join '', @ARGV;

delete $ENV{DISPLAY};

/-h/ and die "usage: drakxconf\n";
/-version/ and die 'version: $Id: drakxconf 254567 2009-03-23 09:22:59Z tv $\n';

my $in = 'interactive'->vnew;

my @l = map {
    my $path;
    foreach my $i (split (":", $ENV{PATH})) { 
        my $j = "$i/$_->{cmd}";
        $path = $j if -x $j;
    }
    { des => $_->{des}, cmd => $path };
} (
   { des => N("Display"), cmd => 'XFdrake' },
   { des => N("Keyboard"), cmd => 'keyboarddrake' },
   { des => N("Mouse"), cmd => 'mousedrake' },
   { des => N("Network & Internet"), cmd => 'drakconnect' },
   { des => N("Users and groups"), cmd => 'adduserdrake' },
   { des => N("Services"), cmd => 'drakxservices' },
   { des => N("Firewall"), cmd => 'drakfirewall' },
   { des => N("Firewall6"), cmd => 'drakfirewall6' },
   { des => N("Boot loader"), cmd => 'drakboot' },
   { des => N("Auto Install"), cmd => 'drakautoinst' },
   { des => N("Internet connection sharing"), cmd => 'drakgw' },
   { des => N("3D Desktop effects"), cmd => 'drak3d' },
   { des => N("Partitions"), cmd => 'diskdrake' }
   );

my $choice = $in->ask_from_listf(N("Control Center"), N("Choose the tool you want to use"), sub { $_[0]{des} }, \@l)
    or $in->exit(1);
$in->end;

-x $choice->{cmd} or die "$choice->{cmd} is not executable!\n";
exec $choice->{cmd}, @ARGV or $in->exit(1);