This is the mail archive of the mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: change wallpaper periodly by cron?

There is a solution for programs which you don't compile.  That is simply to
reposition the console window off screen.  i.e.

Right click on the title bar of the window and select properties.  Then go
to layout.  Unselect "Let system position window".  Adjust the window so the
position is off screen.  Click "OK".  Finally, select "Save properties for
future windows with the same title" and click "OK".

Now your window still opens, but it doesn't clutter the screen.

If you want to avoid even having the icon, I find the successful approach
for that is to invoke your program via rxvt.  For example, for my Cygwin
icon I use a short cut of with a target of: "d:\bin\rxvt.exe -e
/bin/bash --login".  You can use the -geometry option on your rxvt windows
to hide those.

Indeed a console window still opens, but it is off screen, and closes so
quickly that most of the time I never see the icon on my task bar for it.

For crontab jobs, I found the same type of trick works if you install the
program as a service.  i.e.

    cygrunsrv -I pcphone -a -w -p /usr/local/bin/pcphone -s QUIT -o -t

Next under Windows Services, check the "allowed to interact with desktop

Now whenever I run "/usr/local/bin/pcphone" either interactively, or from a
crontab job, it simply starts calls "cygrunsrv -S pcphone" which in turn

        /usr/local/bin/pcphone -w

Finally, the pcphone script when invoked as a service starts the real
pcphone.exe via a nohup call to rxvt, sleeps for five seconds and then
exits.  So the "CONSOLE" window icon exists on my task bar for no more than
five seconds.  Once the "CONSOLE" window is closed, the "rxvt" window is
also killed, however the children of "rxvt", "pcphone.exe" are not killed.
So "pcphone.exe" is left running as an orphaned process.  The reason for the
five second delay is just to give rxvt enough time to invoke the
"pcphone.exe" program.


----- Original Message ----- 
From: "Ehud Karni" <>
To: <>
Cc: <>
Sent: Thursday, August 21, 2003 9:31 AM
Subject: Re: change wallpaper periodly by cron?

> Hash: SHA1
> On Thu, 21 Aug 2003 04:15:29 +0100, Elfyn McBratney <>
> >
> > Lucifer <> wrote:
> > > On Wed, 20 Aug 2003 10:20:10 +0200
> > > Corinna Vinschen <> wrote:
> > >
> > > CV>
> > > CV> It's a limitation of service processes.  You can only change it by
> > > CV> the "Allow service to interact with desktop" property of the
> > > CV>
> > >
> > > I enabled the "Allow service to interact with desktop" and it works
> > > thank you.  However, a DOS window titled as
> > > popped out.  It's ugly.  Can that be avoided?
> >
> > AFAIK, it cannot. It's the ugly side effect of interactive service(s) on
> > Windows.
> Try to compile your program with -mwindows (without changing your
> "main" function). I use this trick when I want a program without a
> window (or console). If you run it from bash (or sh/csh) you wont
> notice any change, but if you run it under command or cmd, it will
> run without a (console) window.
> Ehud.
> - --
>  Ehud Karni           Tel: +972-3-7966-561  /"\
>  Mivtach - Simon      Fax: +972-3-7966-667  \ /  ASCII Ribbon Campaign
>  Insurance agencies   (USA) voice mail and   X   Against   HTML   Mail
>  FAX:  1-815-5509341  / \
>                  Better  Safe  Than  Sorry
> Comment: use to get my key (and others)
> iD8DBQE/RMnHLFvTvpjqOY0RAvbKAJ9/NisvO2AiJpdQOdUBA4dVymz5SACeJka1
> qt/n45d0M2boTdaGlKIbso8=
> =uhKZ
> --
> Unsubscribe info:
> Problem reports:
> Documentation:
> FAQ:         

Attachment: Cygwin.lnk
Description: Binary data

Attachment: pcphone
Description: Binary data

Unsubscribe info:
Problem reports:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]