in reply to change/detect term screen background color
Here's a script that I use to get info about my terminal colors and capabilites:#!/usr/bin/perl use strict; use warnings; # change bgcolor and text system("echo -e"\e[1;32;40m black"); sleep 5; # revert to original color system("echo -e "\e[0m");
#!/usr/bin/perl use strict; use warnings; use Term::Cap; use Term::ExtendedColor qw(fg get_colors lookup); use Data::Dumper::Concise; my $termcap = Term::Cap->Tgetent({ Term => 'undef' }); print "Capabilities found: ", join(', ', sort(keys %{$termcap})), "\n" +; print Dumper(my $colors = get_colors()); for(0 .. 255) { my $color_str = lookup($_); if(defined($color_str)) { printf("%25s => %s\n", fg($color_str, $color_str), $_); } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: change/detect term screen background color
by Allasso (Monk) on Feb 19, 2011 at 19:51 UTC | |
by Allasso (Monk) on Feb 19, 2011 at 20:02 UTC | |
by Allasso (Monk) on Feb 19, 2011 at 20:20 UTC | |
|
Re^2: change/detect term screen background color
by Anonymous Monk on Feb 20, 2011 at 14:18 UTC |