From http://www.jwz.org/xscreensaver/xscreensaver-5.35.tar.gz
[xscreensaver] / driver / xscreensaver-command.c
index f35a30d933228c477e9a9d0b8f2e17c64048ce57..6adf1fdd5e852ca6a9b9987842b88593b34ac987 100644 (file)
@@ -134,7 +134,7 @@ usage: %s -<option>\n\
                 some way.\n\
 \n\
   See the man page for more details.\n\
-  For updates, check http://www.jwz.org/xscreensaver/\n\
+  For updates, check https://www.jwz.org/xscreensaver/\n\
 \n";
 
 /* Note: The "-throttle" command is deprecated -- it predates the XDPMS
@@ -324,8 +324,12 @@ main (int argc, char **argv)
   if (*cmd == XA_ACTIVATE || *cmd == XA_LOCK ||
       *cmd == XA_NEXT || *cmd == XA_PREV || *cmd == XA_SELECT)
     /* People never guess that KeyRelease deactivates the screen saver too,
-       so if we're issuing an activation command, wait a second. */
-    sleep (1);
+       so if we're issuing an activation command, wait a second.
+       No need to do this if stdin is not a tty, meaning we're not being
+       run from the command line.
+     */
+    if (isatty(0))
+      sleep (1);
 
   i = xscreensaver_command (dpy, *cmd, arg, True, NULL);
   if (i < 0) exit (i);