Xmessage utility 2005-12-01 - By Garrick Staples
Back On Thu, Dec 01, 2005 at 09:44:18AM -0400, Shaw, Marco alleged: > What I'm looking for is a simple way to provide a user with > a UI where they can pick their laptop. I have that part easily > figured out. > > But what I'd like to happen is that if the user presses the > button #1 ("Dave's laptop") below, for example, I'd like > the stdout to print the variable "IP1" > > I thought I read the man page correctly, and something like > this would work, but it doesn't: > > # xmessage -print -buttons "Dave's laptop:IP1" test > > Can I get IP1 to print to stdout when the button is pressed?
You want the exit values as the Mr. Haxby mentioned.
But just for fun, here's an example. It is a script I wrote so that my girlfriend could easily deal with our Epson printer. It is certainly not a nice, well-formed application, but it does the job after 5 minutes of scripting :)
#!/bin/bash
output=levels
xmsg='xmessage -file - -buttons status,levels,nozzle-check,clean-head,done -print -center -default done -timeout 60'
while :;do
case $output in status) cmd=s;; levels) cmd=i;; nozzle-check) cmd=n;; clean-head) cmd=c;; *) exit ;; esac
output=$(escputil -q${cmd}ur /dev/lp0 2>&1 | $xmsg)
done
-- Garrick Staples, Linux/HPCC Administrator University of Southern California
-- Taroon-list mailing list Taroon-list@(protected) https://www.redhat.com/mailman/listinfo/taroon-list
|
|