#!/usr/bin/perl use strict; use warnings; =pod =head1 NAME lay-back-terminal - lay a terminal, at back of the window stack =head1 SYNOPSIS lay-back-terminal [OPTIONS] [-- ARGUMENTS-FOR-TERMINAL] lay-back-terminal --help | --man =head1 OPTIONS perldoc Zelea::Lay =cut use lib '/home/mike/code/textbender/x/repo'; { use textbender::a::b::Function qw( join_clean system_or_print ); use Zelea::Lay qw( %option screen_x ); use Zelea::WindowManagement qw( net_client_list_matching ); Zelea::Lay::shift_options(); Zelea::Lay::pre_ensure(); # - - - my $x = screen_x() + 60; system_or_print join_clean( ' ', "gnome-terminal --geometry=90x37+$x+0", @ARGV ) and die; sleep 1; # avoid polls while matching # my $user_name = getpwuid( $> ); # which may differ from $ENV{USER}, which may still be 'mike' in my root terminals # my @window = net_client_list_matching "^$user_name +[0-9]+" or die; ### simplified by prefixing title with 'terminal' # "^$user_name +[0-9]+ +$ENV{HOSTNAME}\$" ### $ENV{HOSTNAME} undefined in latest system build, even though defined in environment my @window = net_client_list_matching '\\bterminal$' or die; my $window = $window[$#window]; system_or_print "wmctrl-zelea -i -r $window -b add,_OB_WM_STATE_UNDECORATED,maximized_vert" . " && wmctrl-zelea -i -r $window -b add,maximized_horz,below" and die; # system_or_print "wmctrl-zelea -i -r $window -b add,fullscreen,below" and die; ### but 'fullscreen' defeats 'below' # - - - Zelea::Lay::post_ensure(); } __END__ =pod =head1 AUTHOR Michael Allan =cut