1 |
#!/usr/bin/perl |
2 |
# DrakConsole -- Display Manager chooser |
3 |
# Copyright (C) 2003 MandrakeSoft (tvignaud@mandrakesoft.com) |
4 |
# |
5 |
# This program is free software; you can redistribute it and/or modify |
6 |
# it under the terms of the GNU General Public License as published by |
7 |
# the Free Software Foundation; either version 2, or (at your option) |
8 |
# any later version. |
9 |
# |
10 |
# This program is distributed in the hope that it will be useful, |
11 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 |
# GNU General Public License for more details. |
14 |
# |
15 |
# You should have received a copy of the GNU General Public License |
16 |
# along with this program; if not, write to the Free Software |
17 |
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
18 |
|
19 |
use strict; |
20 |
use lib qw(/usr/lib/libDrakX); |
21 |
|
22 |
use common; |
23 |
use standalone; #- warning, standalone must be loaded very first, for 'explanations' |
24 |
use ugtk2 qw(:create :wrappers); |
25 |
use Gnome2::Vte; |
26 |
|
27 |
my $w = ugtk2->new(N("DrakConsole")); |
28 |
|
29 |
$w->{rwindow}->add(gtkpack_(Gtk2::VBox->new(0, 0), |
30 |
1, my $vte = gtksignal_connect(Gnome2::Vte::Terminal->new, 'child-exited' => sub { ugtk2->exit }), |
31 |
0, gtkpack__(create_hbox('end'), gtksignal_connect(Gtk2::Button->new(N("Close")), |
32 |
clicked => sub { ugtk2->exit }) |
33 |
) |
34 |
), |
35 |
); |
36 |
$w->{rwindow}->show_all; |
37 |
|
38 |
$vte->grab_focus(); |
39 |
#$ENV{PS1} = qq(Type "exit"\n); |
40 |
$vte->fork_command($ENV{SHELL}, [ $ENV{SHELL} ], [ map { "$_=$ENV{$_}" } keys %ENV ], $ENV{PWD}, 0, 0, 0); |
41 |
|
42 |
$w->main; |