Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Openbox Pipe Menu: GNU/Screen controller
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo Chat
View previous topic :: View next topic  
Author Message
nightm4re
Guru
Guru


Joined: 20 Jun 2004
Posts: 519
Location: Providence, RI, USA

PostPosted: Tue Oct 26, 2004 8:04 pm    Post subject: Openbox Pipe Menu: GNU/Screen controller Reply with quote

Just finished up my latest menu. Had a lot of fun with this, it's pretty useful to me.

this script allows you to control your screen sessions running on your machine. It shows all the active screens, their state, actions you can do with those screens, and a list of what processes are running in the screen as well.

the actions available are to attach if detached, and if already attached, multiplex or detatch/reattach.

this script also has a way for new screens to be created, either unnamed, or named. the named requires zenity unfortunatly, i couldnt figure out any other way to do it, so change it to a similar prog if you need to. this section is pretty powerful, check out the comments in the script file for examples/description.

configuration: all you should have to do is change the command in the config section to the terminal of your choice. its urxvt right now, but should support just changing it to aterm or xterm as well.


PREVIEW

SCRIPT (version 1.0)

bug reports etc, post em!
_________________
Nitrogen - GtkMM based background setter/restorer, please test!
Minuslab | d.minuslab.net
Back to top
View user's profile Send private message
Deranger
Veteran
Veteran


Joined: 26 Aug 2004
Posts: 1215

PostPosted: Tue Oct 26, 2004 8:20 pm    Post subject: Reply with quote

Works very well. Now it's much easier to manage irssi screens and stuff ;)

However, I'm going to use it without zenity, because:
Code:

<insert tons of random gnome stuff here>

Total size of downloads: 12,536 kB

;)

Thanks for creating this!
Back to top
View user's profile Send private message
twstd3bc
Apprentice
Apprentice


Joined: 07 Feb 2003
Posts: 289
Location: Los Angeles, USA

PostPosted: Thu Oct 28, 2004 1:20 am    Post subject: Re: Openbox Pipe Menu: GNU/Screen controller Reply with quote

Very nice! Now this is the type of creativity I'm been waiting for with these OB scripts!
Back to top
View user's profile Send private message
GaMMa
l33t
l33t


Joined: 23 Aug 2002
Posts: 684
Location: USA

PostPosted: Thu Oct 28, 2004 2:20 am    Post subject: Reply with quote

Hey never posted a comment, I'm going to try it out now.. looks pwn.. you and crashofsytams2002 made me start using it. l337.. i am h4x0r f33r me.

On another note I'm working on a script to order pizza from Papa Johns via pipemenu.

Papa Johns Pipe Menu beta shot
_________________
Ubuntu Linux Dapper Drake running Gnome-2.14.1
[Website | Screenshot | Portage Guide]
Back to top
View user's profile Send private message
Deranger
Veteran
Veteran


Joined: 26 Aug 2004
Posts: 1215

PostPosted: Fri Oct 29, 2004 12:48 pm    Post subject: Reply with quote

Hahhah that's hilarious, GaMMa :lol:

This is fourth reply in this thread. No one else uses Openbox & GNU Screen? ;)
Back to top
View user's profile Send private message
zeroK
Apprentice
Apprentice


Joined: 14 Sep 2003
Posts: 159
Location: Austria.Klagenfurt

PostPosted: Fri Oct 29, 2004 2:36 pm    Post subject: Reply with quote

Very nice idea :-)
Back to top
View user's profile Send private message
syscrash
Guru
Guru


Joined: 14 Apr 2003
Posts: 541

PostPosted: Fri Oct 29, 2004 7:10 pm    Post subject: Reply with quote

Sweet. Nice work :D
_________________
Play ET? Come by #gentoo.et on freenode!
http://syscrash.ca
Back to top
View user's profile Send private message
allucid
Veteran
Veteran


Joined: 02 Nov 2002
Posts: 1314
Location: atlanta

PostPosted: Fri Oct 29, 2004 8:04 pm    Post subject: Reply with quote

works great, thanks.
Back to top
View user's profile Send private message
Chaosite
Guru
Guru


Joined: 13 Dec 2003
Posts: 540
Location: Right over here.

PostPosted: Fri Oct 29, 2004 9:00 pm    Post subject: Reply with quote

GaMMa wrote:
Hey never posted a comment, I'm going to try it out now.. looks pwn.. you and crashofsytams2002 made me start using it. l337.. i am h4x0r f33r me.

On another note I'm working on a script to order pizza from Papa Johns via pipemenu.

Papa Johns Pipe Menu beta shot


Whoa man... What about the toppings, man? The toppings are everything! If you can't order toppings, its pretty worthless!

Also, great script! Extremely useful, keep it up!
Back to top
View user's profile Send private message
Fanatic
Apprentice
Apprentice


Joined: 02 May 2004
Posts: 173
Location: Stocktown

PostPosted: Fri Dec 10, 2004 4:00 pm    Post subject: Reply with quote

Oktane wrote:
Works very well. Now it's much easier to manage irssi screens and stuff ;)

However, I'm going to use it without zenity, because:
Code:

<insert tons of random gnome stuff here>

Total size of downloads: 12,536 kB

;)

Thanks for creating this!


What other non-gnome/kde program can you use instead?
Back to top
View user's profile Send private message
Chaosite
Guru
Guru


Joined: 13 Dec 2003
Posts: 540
Location: Right over here.

PostPosted: Fri Dec 10, 2004 4:19 pm    Post subject: Reply with quote

Well... Xdialog is fugly, but it does the job too.

I prefer zenity, personally.

And you could always use dialog to do it, y'know ^^
Back to top
View user's profile Send private message
landon
Apprentice
Apprentice


Joined: 09 Mar 2004
Posts: 159

PostPosted: Sat Dec 18, 2004 12:47 pm    Post subject: Reply with quote

silly question, but how am i supposed to use this?

edit: nvm, read the docs.
Back to top
View user's profile Send private message
seank
l33t
l33t


Joined: 08 Jul 2004
Posts: 686

PostPosted: Sat Dec 18, 2004 8:48 pm    Post subject: Reply with quote

GaMMa wrote:
Hey never posted a comment, I'm going to try it out now.. looks pwn.. you and crashofsytams2002 made me start using it. l337.. i am h4x0r f33r me.

On another note I'm working on a script to order pizza from Papa Johns via pipemenu.

Papa Johns Pipe Menu beta shot
haha, that's great.
Back to top
View user's profile Send private message
InfinityX
Guru
Guru


Joined: 31 Jan 2004
Posts: 385

PostPosted: Sat Feb 12, 2005 12:18 am    Post subject: Reply with quote

Just to let you guys know a new update of pstree stops the script from working as ASCII characters are no longer used by default, adding '-A' to the line:

Code:
@ps = split /---/, `pstree $pid -l -p`;


fixes it :)
Back to top
View user's profile Send private message
nightm4re
Guru
Guru


Joined: 20 Jun 2004
Posts: 519
Location: Providence, RI, USA

PostPosted: Sat Feb 12, 2005 12:27 am    Post subject: Reply with quote

cool, thanks. I never liked using pstree anyway, i'm gonna try to figure out a new way of doing it.

that, and i'll actually update the first part to perl/gtk2 so it can lose its dependancy on zenity. you know, when i get around to it :D
_________________
Nitrogen - GtkMM based background setter/restorer, please test!
Minuslab | d.minuslab.net
Back to top
View user's profile Send private message
InfinityX
Guru
Guru


Joined: 31 Jan 2004
Posts: 385

PostPosted: Sat Feb 12, 2005 1:30 pm    Post subject: Reply with quote

nightmare wrote:
cool, thanks. I never liked using pstree anyway, i'm gonna try to figure out a new way of doing it.

that, and i'll actually update the first part to perl/gtk2 so it can lose its dependancy on zenity. you know, when i get around to it :D


Way ahead of ya:

Code:
#!/usr/bin/perl
# widget tree is as follows
#  Window
#       +-vbox
#           |
#           +-label
#           |
#           +-entry

use warnings;
use strict;
use Gtk2;

set_locale Gtk2;
init Gtk2;

# constants for easy changing of default settings
use constant TRUE  => 1;
use constant FALSE => 0;

# create the gui
my $window = Gtk2::Window->new;
$window->signal_connect(destroy => sub { Gtk2->main_quit; });
$window->set_decorated(FALSE);
#$window->set_policy(); if anyone could tell me the Gtk2 equivalent of this I'd be very grateful
$window->set_border_width(5);

# the main vbox
my $vbox = Gtk2::VBox->new(FALSE, 8);
$window->add($vbox);

# A label
my $label = Gtk2::Label->new('name:program');
$label->set_alignment(0, 0);
$vbox->add($label);

# Our entry box
my $entry = Gtk2::Entry->new();
$entry->signal_connect("activate", \&enter_pressed, $entry);
$vbox->add($entry);

# starting up, fingers crossed...
$window->show_all;
Gtk2->main;


# *** subroutines start here ***
sub close {
      Gtk2->main_quit;
      return TRUE;
}

sub enter_pressed {
            my ($widget, $entry) = @_;
            my $entry_text = $entry->get_text();

            if ($entry_text ne "") {
                        print "$entry_text";
                        exit();
            }
}


Screenshot

I learned the basics of Gtk2-Perl a while ago but then completely forgot to actually make the app :oops:
Back to top
View user's profile Send private message
nightm4re
Guru
Guru


Joined: 20 Jun 2004
Posts: 519
Location: Providence, RI, USA

PostPosted: Sat Feb 12, 2005 2:02 pm    Post subject: Reply with quote

cool, not bad.. except that the biggest reason for using perl/gtk2 is so you don't have to do that cryptic name:program thing :D

still, vboxes and stuff always confuse me. i guess i'll get going on this, i have a few more features in mind i'd like to put in there. thanks for working on this.
_________________
Nitrogen - GtkMM based background setter/restorer, please test!
Minuslab | d.minuslab.net
Back to top
View user's profile Send private message
InfinityX
Guru
Guru


Joined: 31 Jan 2004
Posts: 385

PostPosted: Sat Feb 12, 2005 4:55 pm    Post subject: Reply with quote

Just been tinkering around with the script again. Ever since I started using your script I wanted a command history similar to that of gmrun (fantastic app), finally figured out how to do it. With this version you can press up and down to see previous commands, new commands are added to the history file automatically:

Code:
#!/usr/bin/perl
# widget tree is as follows
#  Window
#       +-vbox
#           |
#           +-label
#           |
#           +-entry

use warnings;
use strict;
use Gtk2;
use Gtk2::Gdk::Keysyms;

set_locale Gtk2;
init Gtk2;

# constants
use constant TRUE  => 1;
use constant FALSE => 0;

# command history variables
my @history;
my $command_id = 0;
my $history_file = "/home/mat/.screenstart_history";

# get our command history
if (open COMMANDHISTORY, "< $history_file") {
            chomp(@history = reverse <COMMANDHISTORY>);
            close COMMANDHISTORY;

            # increment the commands up and leave the first blank
            for (reverse 1..@history) { $history[$_] = $history[$_-1]; }
            $history[0] = "";
}

# create the gui
my $window = Gtk2::Window->new;
$window->signal_connect(destroy => sub { Gtk2->main_quit; });
$window->set_decorated(FALSE);
#$window->set_policy(); if anyone could tell me the Gtk2 equivalent of this I'd be very grateful
$window->set_border_width(5);

# the main vbox
my $vbox = Gtk2::VBox->new(FALSE, 8);
$window->add($vbox);

# A label
my $label = Gtk2::Label->new('name:program');
$label->set_alignment(0, 0);
$vbox->add($label);

# Our entry box
my $entry = Gtk2::Entry->new;
$entry->signal_connect("activate" => \&enter_pressed, $entry);
$entry->signal_connect("key_press_event" => \&key_pressed);
$vbox->add($entry);

# starting up, fingers crossed...
$window->show_all;
Gtk2->main;


# *** subroutines start here ***
sub close {
            Gtk2->main_quit;
            return TRUE;
}

sub enter_pressed {
            my ($widget, $entry) = @_;
            my $entry_text = $entry->get_text();

            # text has been entered
            if ($entry_text ne "") {
                        # print text so nightmare's script can make a screen for us
                        print "$entry_text";
                        # write the text to the history file but make sure we don't get consecutive identical commands
                        if ((open COMMANDHISTORY, ">>$history_file") && ($entry_text ne $history[1])) {
                                    select COMMANDHISTORY;
                                    print "$entry_text\n";
                        }
                        exit();
            }
}

sub key_pressed {
            my ($widget, $entry) = @_;
            
            # up was pressed
            if ($entry->keyval == $Gtk2::Gdk::Keysyms{'Up'}) {
                        $command_id++;
                        # display the next command
                        if (!defined($history[$command_id])) { $command_id--; }
                        $widget->set_text($history[$command_id]);
                        return 0;
            # down was pressed
            } elsif ($entry->keyval == $Gtk2::Gdk::Keysyms{'Down'}) {
                        $command_id--;
                        # display the previous command
                        if ($command_id < 0) { $command_id++; }
                        $widget->set_text($history[$command_id]);
                        return 0;
            }
}


No doubt about it, Perl is my favourite language now :D
Back to top
View user's profile Send private message
nightm4re
Guru
Guru


Joined: 20 Jun 2004
Posts: 519
Location: Providence, RI, USA

PostPosted: Sat Feb 12, 2005 7:11 pm    Post subject: Reply with quote

InfinityX wrote:
Just been tinkering around with the script again. Ever since I started using your script I wanted a command history similar to that of gmrun (fantastic app), finally figured out how to do it. With this version you can press up and down to see previous commands, new commands are added to the history file automatically:


stop taking all my ideas :D

haha, nice work, thanks for updating. if it's cool with you ill put it on my site, as soon as i get ssh access back.
_________________
Nitrogen - GtkMM based background setter/restorer, please test!
Minuslab | d.minuslab.net
Back to top
View user's profile Send private message
InfinityX
Guru
Guru


Joined: 31 Jan 2004
Posts: 385

PostPosted: Sat Feb 12, 2005 8:21 pm    Post subject: Reply with quote

Sure, go ahead. What other features do you have planned... :wink:
Back to top
View user's profile Send private message
nightm4re
Guru
Guru


Joined: 20 Jun 2004
Posts: 519
Location: Providence, RI, USA

PostPosted: Sat Feb 12, 2005 9:14 pm    Post subject: Reply with quote

well, i was gonna do a history thing, split up the dialog, and have a "saved sessions" thing, where its basically a permanent few on the history. Just in case you use it enough where it would knock one off, but I sorta doubt that will happen.

as for other things, who knows, any one else, feel free to suggest something.
_________________
Nitrogen - GtkMM based background setter/restorer, please test!
Minuslab | d.minuslab.net
Back to top
View user's profile Send private message
InfinityX
Guru
Guru


Joined: 31 Jan 2004
Posts: 385

PostPosted: Mon Feb 14, 2005 7:15 pm    Post subject: Reply with quote

Got stuck without Internet access for a few hours today so I decided to improve the script a little further, I think you'll like it :wink:

screenstart.tar.gz
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo Chat All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum