Subject: FVWM: Finding the number of desktops

From: Ukpong Ukpong <[email-masked]>
Date: Mon, 22 Mar 2004 04:09:29 +0000 (GMT)

Is there any way of finding out how many desktops  there are....

--
Visit the official FVWM web page at <URL: http://www.fvwm.org/>.
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: Tavis Ormandy <[email-masked]>
Date: Mon, 22 Mar 2004 09:05:57 +0000

> Is there any way of finding out how many desktops  there are....

No, but there is a good reason for this...

"The number of active desktops is determined dynamically. Only desktops
which contain windows or are currently being displayed are active. Desktop
numbers must be between 2147483647 and -2147483648 (is that enough?)."

-- 
-------------------------------------
[email-masked] | finger me for my gpg key.
-------------------------------------------------------

---

From: Ukpong Ukpong <[email-masked]>
Date: Mon, 22 Mar 2004 11:55:30 +0000 (GMT)

Yes tried that but need to find out the number of active desktops at 
runtime...isn't this set some where !!!!!
> 
> you can get the desktopsize by expanding $[desk.pagesx] and $[desk.pagesy],
> but thats number of pages, not desktops :)
> 
>

---

From: Mikhael Goikhman <[email-masked]>
Date: Mon, 22 Mar 2004 15:41:26 +0000

> Is there any way of finding out how many desktops  there are....

There is currently no limit on desk numbers in FVWM, i.e. there are
infinite number of desks, negatively and positively numbered. To be
compliant with EWMH use positive numbers only and zero. This works:

  Next (XTerm) MoveToDesk 0 10000  # move a window to the desk number 10000
  Next (XTerm) MoveToDesk          # move a window to the current desk

If you mean the desk size, i.e. the number of pages in each desk, then
the latest 2.4.x and 2.5.x version (but not the ones from one year ago)
have special variables for this, for example:

  Exec xmessage 'DeskTopSize is $[desk.pagesx]x$[desk.pagesy]'

Regards,
Mikhael.

---

From: Thomas Adam <[email-masked]>
Date: Mon, 22 Mar 2004 09:15:11 +0000 (GMT)

--- Tavis Ormandy <[email-masked]> wrote: > 
> numbers must be between 2147483647 and -2147483648 (is that enough?)."

You could do something like (untested):

ruby -ne'/desktopsize (\d+)x(\d+)/; puts( ($1.to_i * $2.to_i) )'
~~/fvwm/.fvwmrc

-- Thomas Adam

=====
"The Linux Weekend Mechanic" -- http://linuxgazette.net
"TAG Editor"                 -- http://linuxgazette.net

"<shrug> We'll just save up your sins, Thomas, and punish 
you for all of them at once when you get better. The 
experience will probably kill you. :)"

 -- Benjamin A. Okopnik (Linux Gazette Technical Editor)

___________________________________________________________
Yahoo! Messenger - Communicate instantly..."Ping" 
your friends today! Download Messenger Now 
http://uk.messenger.yahoo.com/download/index.html

---

From: Tavis Ormandy <[email-masked]>
Date: Mon, 22 Mar 2004 09:34:35 +0000

--On Monday, March 22, 2004 09:15:11 +0000 Thomas Adam
<[email-masked]> wrote:

> ~/fvwm/.fvwmrc

---

From: Dominik Vogt <[email-masked]>
Date: Mon, 29 Mar 2004 11:22:55 +0200

> runtime...isn't this set some where !!!!!

Currently not.  I will add a $[w.desk] variable as soon as I can
access CVS again.  With that, you can write a script that
calculates the first and last used desk numbers.

> > but thats number of pages, not desktops :)

Ciao

Dominik ^_^  ^_^

---

From: Dominik Vogt <[email-masked]>
Date: Mon, 29 Mar 2004 11:46:13 +0200

> runtime...isn't this set some where !!!!!

Currently not, but I have a patch on my disk that adds the
variable $[w.desk] to get a window's desk.  With that, you can
make a script that calculates the min and max used desk:

  destroyfunc get_used_desks
  addtofunc get_used_desks
  + i setenv DESK_MIN $d
  + i echo setenv DESK_MIN $d
  + i setenv DESK_MAX $d
  + i echo setenv DESK_MAX $d
  + i all (circulatehit) piperead '\
  if [ $[w.desk] -lt $[DESK_MIN] ]; then \
      echo "setenv DESK_MIN $[w.desk]"; \
    fi; \
    if [ $[w.desk] -gt $[DESK_MAX] ]; then \
      echo "setenv DESK_MAX $[w.desk]"; \
    fi \
  '

After running that script, you can get the min and max used desk
numbers with

  $[DESK_MIN]

and

  $[DESK_MAX]

(the script has to be rerun each time these variables are to be
used).

Unfortunately, I can not access CVS right now to check in the
patch.

Ciao

Dominik ^_^  ^_^