#!/usr/bin/wish # tkpixel [-geometry WxH+X+Y] [DEFAULT] - display color given on stdin # always on top bind . [list ontop:state %W %s] proc ontop:state {W state} { if { ![string equal $state VisibilityUnobscured] } { raise $W } } wm withdraw . wm overrideredirect . 1 label .l -height 1 -width 1 pack .l proc docmd {cmd} { switch $cmd { "" { exit } quit { exit } off { wm withdraw . } on { wm deiconify . } default { wm deiconify . if { [catch { .l configure -background $cmd } errmsg] } { puts $errmsg } } } } foreach arg $::argv { docmd $arg } fileevent stdin readable { gets stdin cmd docmd $cmd }