diff options
author | jao <jao@gnu.org> | 2019-10-05 23:33:36 +0100 |
---|---|---|
committer | jao <jao@gnu.org> | 2019-10-05 23:33:36 +0100 |
commit | f1973d263ebc7059989091f2026622ff2766dc66 (patch) | |
tree | f0c8992c26c2c1bd2f9305b1f981d072b410a144 /icons/gen-load-icons.sh | |
parent | 05d143ee56ca6785b12ccde43a8d278ebbc93bdf (diff) | |
download | xmobar-config-f1973d263ebc7059989091f2026622ff2766dc66.tar.gz xmobar-config-f1973d263ebc7059989091f2026622ff2766dc66.tar.bz2 |
load icons
Diffstat (limited to 'icons/gen-load-icons.sh')
-rwxr-xr-x | icons/gen-load-icons.sh | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/icons/gen-load-icons.sh b/icons/gen-load-icons.sh new file mode 100755 index 0000000..2ff765e --- /dev/null +++ b/icons/gen-load-icons.sh @@ -0,0 +1,36 @@ +#! /usr/bin/env perl + +use warnings; +use strict; + +use local::lib; +use Image::Xpm; +use POSIX; + +my $iwidth = 8; +my $iheight = 16; +my $pixels_per = $iheight / 8; +my $color_bg = "white"; +my $color_fg = "darkseagreen"; + +for ( my $file_num = 0; $file_num <= 8; $file_num++ ) { + my $i = Image::Xpm->new(-file => "load_$file_num.xpm", + -width => $iwidth, + -height => $iheight, + -background => $color_bg); + + my $h = $file_num * $pixels_per; + + for ( my $x = 0; $x < $iwidth; $x++ ) { + for ( my $y = 0; $y < $iheight; $y++ ) { + $i->xy($x, $y, $color_bg); + } + } + for ( my $x = 0; $x < $iwidth; $x++ ) { + for ( my $y = $iheight; $y >= ($iheight - $h); $y-- ) { + $i->xy($x, $y, $color_fg); + } + } + + $i->save; +} |