#!/usr/bin/wish # tkexec - simple application launcher # Usage: tkexec [-o] [command|description:command|.]... # ("." for new line) . configure -background #1d1d1d option add *Button.foreground white startupFile option add *Button.background #1d1d1d startupFile option add *Grid.background #1d1d1d startupFile option add *Button.activebackground #2d2d2d startupFile option add *Button.font "Fixed 8" set i 0 set line "" lappend ::argv . foreach arg $::argv { incr i if { [string equal $arg -o ] } { wm overrideredirect . 1 } elseif { [string equal $arg .] } { grid {*}$line foreach b $line { grid configure $b -sticky nesw } ;# fill set line "" } else { append arg ":$arg" lassign [split $arg :] name command button .b$i -padx 2 -pady 0 -borderwidth 0 \ -relief flat -highlightthickness 0 \ -text $name -command "exec sh -c \"$command\" &" lappend line .b$i } }