2015-04-21 10:02:51 -05:00
|
|
|
#!/usr/bin/perl -w
|
2013-05-01 09:15:58 -05:00
|
|
|
|
2015-04-21 01:53:34 -05:00
|
|
|
my $login=0;
|
2013-05-01 09:15:58 -05:00
|
|
|
|
2015-04-21 01:53:34 -05:00
|
|
|
while ($opt = shift(@ARGV))
|
|
|
|
{
|
|
|
|
if ($opt eq '-display')
|
|
|
|
{
|
2015-04-21 07:17:19 -05:00
|
|
|
$ENV{'DISPLAY'} = shift(@ARGV);
|
2015-04-21 01:53:34 -05:00
|
|
|
}
|
|
|
|
elsif ($opt eq '-name')
|
|
|
|
{
|
2015-04-21 07:17:19 -05:00
|
|
|
$arg = shift(@ARGV);
|
|
|
|
push(@args, "--window-with-profile=$arg");
|
2015-04-21 01:53:34 -05:00
|
|
|
}
|
|
|
|
elsif ($opt eq '-n')
|
|
|
|
{
|
2015-04-21 07:17:19 -05:00
|
|
|
# Accept but ignore
|
|
|
|
print STDERR "$0: to set an icon, please use -name <profile> and set a profile icon\n"
|
2015-04-21 01:53:34 -05:00
|
|
|
}
|
|
|
|
elsif ($opt eq '-T' || $opt eq '-title')
|
|
|
|
{
|
2015-04-21 07:17:19 -05:00
|
|
|
push(@args, '-t', shift(@ARGV));
|
2015-04-21 01:53:34 -05:00
|
|
|
}
|
|
|
|
elsif ($opt eq '-ls')
|
|
|
|
{
|
2015-04-21 07:17:19 -05:00
|
|
|
$login = 1;
|
2015-04-21 01:53:34 -05:00
|
|
|
}
|
|
|
|
elsif ($opt eq '+ls')
|
|
|
|
{
|
2015-04-21 07:17:19 -05:00
|
|
|
$login = 0;
|
2015-04-21 01:53:34 -05:00
|
|
|
}
|
|
|
|
elsif ($opt eq '-geometry')
|
|
|
|
{
|
2015-04-21 07:17:19 -05:00
|
|
|
$arg = shift(@ARGV);
|
|
|
|
push(@args, "--geometry=$arg");
|
2015-04-21 01:53:34 -05:00
|
|
|
}
|
|
|
|
elsif ($opt eq '-fn')
|
|
|
|
{
|
2015-04-21 07:17:19 -05:00
|
|
|
$arg = shift(@ARGV);
|
|
|
|
push(@args, "--font=$arg");
|
2015-04-21 01:53:34 -05:00
|
|
|
}
|
|
|
|
elsif ($opt eq '-fg')
|
|
|
|
{
|
2015-04-21 07:17:19 -05:00
|
|
|
$arg = shift(@ARGV);
|
|
|
|
push(@args, "--foreground=$arg");
|
2015-04-21 01:53:34 -05:00
|
|
|
}
|
|
|
|
elsif ($opt eq '-bg')
|
|
|
|
{
|
2015-04-21 07:17:19 -05:00
|
|
|
$arg = shift(@ARGV);
|
|
|
|
push(@args, "--background=$arg");
|
2015-04-21 01:53:34 -05:00
|
|
|
}
|
|
|
|
elsif ($opt eq '-tn')
|
|
|
|
{
|
2015-04-21 07:17:19 -05:00
|
|
|
$arg = shift(@ARGV);
|
|
|
|
push(@args, "--termname=$arg");
|
2015-04-21 01:53:34 -05:00
|
|
|
}
|
|
|
|
elsif ($opt eq '-e')
|
|
|
|
{
|
2015-04-21 07:17:19 -05:00
|
|
|
$arg = shift(@ARGV);
|
|
|
|
if (@ARGV)
|
|
|
|
{
|
|
|
|
push(@args, '-x', $arg, @ARGV);
|
|
|
|
last;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
push(@args, '-e', $arg);
|
|
|
|
}
|
2015-04-21 01:53:34 -05:00
|
|
|
last;
|
|
|
|
}
|
|
|
|
elsif ($opt eq '-h' || $opt eq '--help')
|
|
|
|
{
|
2015-04-21 07:17:19 -05:00
|
|
|
push(@args, '--help');
|
2015-04-21 01:53:34 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
if ($login == 1)
|
|
|
|
{
|
|
|
|
@args = ('--login', @args);
|
|
|
|
}
|
|
|
|
exec('mate-terminal',@args);
|