Display command stealing focus


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Display command stealing focus
# 1  
Old 06-07-2012
Display command stealing focus

Please Help a Newbie,

I'm using the display command to post a picture of several configurations for a machine operator to choose from. The Issue I have is when I display the image the displayed image steals focus from my bash window. The operator then has to re-select the window to answer the prompt. The other issue I have is terminating the display. I had to kill the pid. Is there a more elegant way to do this?

Thanks
BitBoy

Code:
Code:
#!/bin/bash
 display -geometry 640x480+300+30 /export/freenas/images/S3/S3.JPG &
echo "Please enter the Mode you wish to Opererate (1-2)"
read ans
pid=`ps -e|grep display|cut -f1 -d" "`
kill -9 $pid
echo $an

Moderator's Comments:
Mod Comment please use code tags

Last edited by jim mcnamara; 06-07-2012 at 06:03 PM.. Reason: code tags
# 2  
Old 06-08-2012
Instead of using cut and grep, using shells $!
Code:
#!/bin/bash
display -geometry 640x480+300+30 /export/freenas/images/S3/S3.JPG & PID=$!
echo "Please enter the Mode you wish to Opererate (1-2)"
read ans
kill $PID
echo $an

Regarding focus, it's probably that window manager you are using is set to steal focus on new windows or something like that.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

7 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Monitor keypresses without focus?

Hi all, I'm new to Linux, been at it a couple weeks. I have written a script that basically acts as a watchdog to ping a server on a set interval, make sure chromium-browser is running, and a couple other things (it displays data via web browser). I'd like to make it stop the script when I hit... (4 Replies)
Discussion started by: strategery
4 Replies

2. What is on Your Mind?

Learning System Administration: What to focus on?

In the fall I am taking courses in System Admin and Networking Admin, along with Cisco classes. Sometime next year I hope to get Red Hat and CCNA certifications, then try to get some experience and a job. I am wondering what I can focus on in the meantime (and in my spare time) that will... (1 Reply)
Discussion started by: ScottLew
1 Replies

3. UNIX for Dummies Questions & Answers

Starting a program without it stealing focus

Hi all I have a java program I'm starting in Mac os from the terminal using the command java -Djava.library.path=/Users/me/Desktop/Cfiles/DynamicCTGLayout/build/Release -jar However, when I do this, my current program I'm using becomes "deselected" and the java program's GUI becomes... (2 Replies)
Discussion started by: WhiteTiger
2 Replies

4. UNIX for Dummies Questions & Answers

tcpdump - stealing storage

Hello, I hope someone can explain something to me just so I can understand why this took place: We have Avaya telephony servers that are running RHEL 5 on them. A week ago, callers were dialing into the server and could not hear a ".wav" file that was supposed to be played in an AVP IVR. ... (1 Reply)
Discussion started by: truecall
1 Replies

5. Shell Programming and Scripting

how to send a key to a windows without focus

Hi, i found xte and xdotool for sending some keys to windowed applications but they need to have the focus on it. Can someone say me if i can do the same but wihtout focusing the window i want to type something ? edit: xreplay (0 Replies)
Discussion started by: linked
0 Replies

6. SuSE

inconsistent ls command display at the command prompt & running as a cron job

Sir, I using the following commands in a file (part of a bigger script): #!/bin/bash cd /opt/oracle/bin ls -lt | tail -1 | awk '{print $6}' >> /tmp/ramb.out If I run this from the command prompt the result is: 2007-05-16 if I run it as a cron job then... (5 Replies)
Discussion started by: rajranibl
5 Replies

7. UNIX for Dummies Questions & Answers

Gnome focus

Hello all, Is there a way to make sawfish window manager focus on a gui when you click it but not make it raise to the top? I know that motif and CDE (soalris) allow you to focus with out raising the windows. THANKS (2 Replies)
Discussion started by: larry
2 Replies
Login or Register to Ask a Question