![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Else Loop Exiting Early | GregWold | Shell Programming and Scripting | 8 | 03-20-2008 02:29 PM |
| how to exit a while true loop | Noob e | Shell Programming and Scripting | 5 | 08-26-2007 02:44 PM |
| Exiting eXceed window kills my process | shantaputi | UNIX for Dummies Questions & Answers | 2 | 05-31-2007 11:27 AM |
| Script to launch terminal window? | omerta | SUN Solaris | 5 | 06-30-2005 05:48 PM |
| How do I dial a number from the terminal window? | fundidor | UNIX for Dummies Questions & Answers | 12 | 12-29-2004 04:21 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
I am running an Ubuntu Gutsy laptop with Advanced Compiz fusion options enabled. I am using xdotool to simulate keyboard input in order to rotate through multiple desktops.
I am looking for a way to kill a while true loop when the Enter key (or Control+C if it is easier) is pushed when the terminal window is not the focus window. The following script works like a charm if the terminal is the focus but I'm don't want a terminal window in the rotation. Any ideas? Here is the code. #!/bin/bash while true; do read -t 12 && break ./xdotool key "super+e" read -t 2 && break ./xdotool key "Right" read -t 2 && break ./xdotool key "super+e" read -t 12 && break ./xdotool key "super+e" read -t 2 && break ./xdotool key "Down" read -t 2 && break ./xdotool key "super+e" read -t 12 && break ./xdotool key "super+e" read -t 2 && break ./xdotool key "Left" read -t 2 && break ./xdotool key "super+e" read -t 12 && break ./xdotool key "super+e" read -t 2 && break ./xdotool key "Up" read -t 2 && break ./xdotool key "super+e" done |
![]() |
| Bookmarks |
| Tags |
| linux, ubuntu |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|