gatuno-terminal/mate-terminal.wrapper

82 lines
1.6 KiB
Plaintext
Raw Normal View History

2015-04-21 10:02:51 -05:00
#!/usr/bin/perl -w
2013-05-01 09:15:58 -05:00
my $login=0;
2013-05-01 09:15:58 -05:00
while ($opt = shift(@ARGV))
{
if ($opt eq '-display')
{
2015-04-21 07:17:19 -05:00
$ENV{'DISPLAY'} = shift(@ARGV);
}
elsif ($opt eq '-name')
{
2015-04-21 07:17:19 -05:00
$arg = shift(@ARGV);
push(@args, "--window-with-profile=$arg");
}
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"
}
elsif ($opt eq '-T' || $opt eq '-title')
{
2015-04-21 07:17:19 -05:00
push(@args, '-t', shift(@ARGV));
}
elsif ($opt eq '-ls')
{
2015-04-21 07:17:19 -05:00
$login = 1;
}
elsif ($opt eq '+ls')
{
2015-04-21 07:17:19 -05:00
$login = 0;
}
elsif ($opt eq '-geometry')
{
2015-04-21 07:17:19 -05:00
$arg = shift(@ARGV);
push(@args, "--geometry=$arg");
}
elsif ($opt eq '-fn')
{
2015-04-21 07:17:19 -05:00
$arg = shift(@ARGV);
push(@args, "--font=$arg");
}
elsif ($opt eq '-fg')
{
2015-04-21 07:17:19 -05:00
$arg = shift(@ARGV);
push(@args, "--foreground=$arg");
}
elsif ($opt eq '-bg')
{
2015-04-21 07:17:19 -05:00
$arg = shift(@ARGV);
push(@args, "--background=$arg");
}
elsif ($opt eq '-tn')
{
2015-04-21 07:17:19 -05:00
$arg = shift(@ARGV);
push(@args, "--termname=$arg");
}
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);
}
last;
}
elsif ($opt eq '-h' || $opt eq '--help')
{
2015-04-21 07:17:19 -05:00
push(@args, '--help');
}
}
if ($login == 1)
{
@args = ('--login', @args);
}
exec('mate-terminal',@args);