Subject: FVWM: Changing desktop color.

From: "Mike A. Harris" <[email-masked]>
Date: Thu, 05 Dec 1996 09:46:39 -0500

First off, I'm using fvwm95 with Linux 2.0.26 and X11R6.  What I'm
wanting to accomplish is this:

When I make a ppp connect to my service provider, I'd like some sort of
notification on screen in X that PPP is active.  The reason is, that
sometimes I get doing other things and forget that the PPP link is
burning away my online time.  I am looking for some method of on-screen
notification be it an icon, or a thing in the Taskbar, or in
FvwmButtons, or whatnot.  I figured that the easiest, and most visible
way, would be to change the color of the root window in my ip-up script,
and then when I do a 'ppp-off' my ip-down script can take care of
setting things back to normal.

Any suggestions?

Thanks.

--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].

---

From: "Mike A. Harris" <[email-masked]>
Date: Sat, 07 Dec 1996 09:23:53 -0500

> setting things back to normal.

To Everyone:
Thanks very much for the plethora of replys that I received concerning
some sort of on-screen notification of being connected to my ISP while
in X.  The onscreen color change seemed to be the easiest, and I think
the most useful and visible.  I chose the 'xsetroot' method and it works
absolutely fantastic!

Here is what I ended up with:
[Bottom line of /etc/ppp/ip-up
xsetroot -solid orange -d :0

[Bottom line of /etc/ppp/ip-down
xsetroot -solid navyblue -d :0

Now the only problem is that if I quit X while logged on to my provider,
and then start it up again (more accurately: when Netscape 3.01 CRASHES
MY ENTIRE X SESSION and I have to restart it) the window is back to it's
default blue color.

Two problems:
   1) I've changed the default color of the root window in .xinitrc with
      'xsetroot -solid navyblue' however when X starts up the screen
goes       navy blue, and then 4 seconds later when fvwm starts, the
screen          reverts to the original (unknown) color.  I would like
to        
      permanently change the root window's default color in .fvwmrc95
if        possible(or wherever it is stored).  Can anyone help?

   2) What can I put in .xinitrc to test wether or not I'm online and
if        I am then set the window to orange, otherwise set it to
navyblue?
      My scripting abilities are not yet to the point where I can
figure        out stuff like this easily.

Any help would be greatly appreciated.

Mike A. Harris  -  [email-masked], [email-masked]
The Ultimate: Linux 2.0.26, DOSemu, 4DOS 5.50c, DJGPP 2.01, Borland C
3.1

---

From: sbuntin <[email-masked]>
Date: Sun, 8 Dec 1996 21:00:59 -0800 (PST)

> the most useful and visible.  I chose the 'xsetroot' method and it works

Wonderful idea. I just came home, only to find that I'd left my ppp
link up and running for the last two hours.  Guess I'd better change
to an unmetered account. :>

> xsetroot -solid navyblue -d :0

You might want to make this a bit cleaner by testing for a running
X before changing root - One of these days, you might end up with
an xsetroot that likes to barf, instead of dying gracefully.

[ -f /var/run/server.0.pid ] && xsetroot -solid <and so forth>

That works for me - I'm running Xaccel.  I don't know if XFree or
MetroX use the same pidfile.  I think so, but...

> if        possible(or wherever it is stored).  Can anyone help?

Hmm.  I'm guessing here - it sounds like there's something either
in InitFunction or RestartFunction that's changing your root color,
or possibly a Style *root* command? Find it, dump it. :>

Does fvwm95 change your root color on a normal start, or just when 
restarting after an NS crash?

> figure        out stuff like this easily.

Tell me about it. :>

Here's a quick modification of a line I use to get mail if my link
is up -

[ -f /var/run/ppp0.pid ] && xsetroot -solid orange -d :0 

#	Tests for presence of pppd's pidfile - It's worked for
#	me so far.  You might have to change the /var/run location,
#	if your setup is different.

If you put that in after the xsetroot...blue command, you'll be all
set.  Either that, or you can yank the xsetroot...blue and take
care of the whole thing in an if-then.  

if [ -f /var/run/ppp0.pid ] ; then
   xsetroot -solid orange -d :0
else
   xsetroot -solid navyblue -d :0
fi

Now that I've spouted off, I'd better test these things...

--  
Scott Buntin

---

From: [email-masked] (Albrecht Kadlec)
Date: Mon, 9 Dec 96 18:52:17 +0100

>>>>> Mike A Harris writes:

M> Two problems:
M>    1) I've changed the default color of the root window in .xinitrc with
M>       'xsetroot -solid navyblue' however when X starts up the screen
M> goes       navy blue, and then 4 seconds later when fvwm starts, the
M> screen          reverts to the original (unknown) color.  I would like
M> to        
M>       permanently change the root window's default color in .fvwmrc95
M> if        possible(or wherever it is stored).  Can anyone help?

look at the InitFunction in .fvwm2rc
there's an entry there, which changes the root window again.

M>    2) What can I put in .xinitrc to test wether or not I'm online and
M> if        I am then set the window to orange, otherwise set it to
M> navyblue?
M>       My scripting abilities are not yet to the point where I can
M> figure        out stuff like this easily.

M> Any help would be greatly appreciated.
maybe a ping to your server host 
which should return an error if you're offline (no connection)
Just check the exit status of the command.

albrecht
-- 
Another Holiday Inn, another temporary home,
  and an interviewer threatening me with a microphone,
  'Talk to me, won't you tell me your stories.'
So I talked about conscience and I talked about pain,
  and he looked out of the window and it started to rain,
  and I thought maybe I've already gone crazy.
So I reached for the bottle and he reached for the door,
  and I picked up the sleeping pills crushed on the floor.
  Inviting me to casual obscenity.			-- Marillion
--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].

---

From: [email-masked] (Albrecht Kadlec)
Date: Mon, 9 Dec 96 18:52:17 +0100

M> Two problems:

albrecht

---

From: lar3ry gensch <[email-masked]>
Date: Mon, 09 Dec 1996 13:52:41 -0500

> Just check the exit status of the command.

Maybe 'netstat -i' with a suitable 'grep' for your PPP connection would
be more accurate and not incur the delays inherent for 'ping'

-- 
(void) lar3ry();                                      [email-masked]

  "I'm sorry you saw me, Billy.  Now I'll have to kill you." -- Santa