#!/usr/bin/perl -w #author: Chris Sincock #This software is provided as-is and is not guaranteed to be free of defects. Use it only at your own risk. # # simply unmaps a window specified by X id # - the x id may be decimal or hex (prefixed by 0x) # or may be specified as -choose in which case the # user can pick a window with the mouse. #use lib $ENV{HOME}."/pgpanel2/perl"; use X11::Protocol; my $xid=@ARGV ? $ARGV[0] : "-choose"; if($xid eq "-choose") { $xid=`xgetwid`; chomp $xid; print STDERR "Chose window:$xid\n"; } if($xid =~ /^0x(.*)/i) { $xid=hex($1); } print STDERR "xid=$xid\n"; my $x=X11::Protocol->new($ENV{DISPLAY}); $x->event_handler('queue'); $x->UnmapWindow($xid);