gnome-terminal launcher script
Some time ago, I wrote a little Perl script to launch the gnome-terminal application with a specific profile that used as a background a randomly-selected bit of wallpaper. This was so I could start up two different terminals against two different hosts (e.g., "test" and "production"), and then create new tabs within each window which would inherit the background wallpaper, and be visually distinguished and grouped. (Keeps me from issuing bad commands on the production server ...)
After a recent upgrade to my OS (Red Hat 7.3 => White Box), the script still works, but only the first gnome-terminal gets a "new" wallpaper. Subsequent invocations of the script get the same wallpaper as the original. Only if I shut down all the windows and open a new "first" do I get a new background.
I won't reproduce the whole script here, just the salient portions. Basically, the first 80% of the script opens a file with wallpaper paths, picks one, and leaves the name in $pixmap:
...
my @start = @ARGV;
@start = ('--window-with-profile=Random')
unless @start;
push @start, ('--command', $cmd) if $cmd;
push @start, '--geometry=100x42'
unless grep(/^--geo/,@start);
copy $pixmap,($ENV{HOME} . '/.newtermbackground')
or warn $!;
exec 'gnome-terminal',@start;
__END__
It appears to me that new invocations of gnome-terminal do some kind of optimization about the profile. Is there any way to override this?
|