Subject: FVWM: page navigation

From: Julian Leyh <[email-masked]>
Date: Fri, 23 Jul 2004 18:27:02 +0200

hello...

i'm new to fvwm, but i really like it :D

i've set up a 3x3 desktop and would like to be able to scroll through
the pages using the arrow keys with the windows key as modifier .

i'll number them like this (for easier reference):

+-----+-----+-----+
|  1  |  2  |  3  |
+-----+-----+-----+
|  4  |  5  |  6  |
+-----+-----+-----+
|  7  |  8  |  9  |
+-----+-----+-----+

the keys are configured like this:

Key Left  A 4 GotoPage -1p 0p
Key Right A 4 GotoPage 1p 0p
Key Up    A 4 GotoPage 0p -1p
Key Down  A 4 GotoPage 0p 1p

this way i get following sequences:
1-2-3, 4-5-6, 7-8-9 for Left/Right, and
1-4-7, 2-5-8, 3-6-9 for Up/Down..
That's very nice :) but i'd like to have it a little different.
if i'm in screen 3 and go right, i'd like to be sent to 4.. if i'm in 6,
send me to 7.. the same for the up/down movement. from page 7 to 2, from
page 8 to 3. the next step would be to send me from page 9 to 1 if i go
right/down.. does anybody have info about how i could realize this?

Additionally it would be nice to have the focussed window from the
previous page lose the focus and one of the windows (probably the next
one to the mouse) in the new page be focussed (if there is none, no
window gets focus, but the old one should lose it anyway). this should
be always when i change the page.. using the obove keys, the FvwmPager
or some other function.
is there a simple way to make fvwm do this?

Next question is about the Translucency patch..
Is Translucency only for menus? i tried FvwmPager, but it doesn't seem
to be possible... FvwmPager has StaysOnTop, so it'd be nice to see
what's in the window under it.. but i think, for that i'll need real
translucency provided by the X server. am i right?

sorry for these many questions and maybe i missed something from the
manpage so please give some hints where i could've found information on
the topics.

cu
JRL

-- 
visit my OpenBSD ports page: http://vgai.de/ports
--
If you don't remember something, it never existed...
If you aren't remembered, you never existed...
--
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: Thomas Adam <[email-masked]>
Date: Fri, 23 Jul 2004 17:57:56 +0100

On Fri, 23 Jul 2004 18:27:02 +0200

> is there a simple way to make fvwm do this?

http://www.fvwmwiki.org/cgi/moin.cgi/Tips_2fRememberFocus

and in the future, please try and have one question per thread. 

-- Thomas Adam

--
"Programming in Ruby is like being hugged." -- Greg McIntyre, Ruby
programmer.

---

From: Harshwardhan Nagaonkar <[email-masked]>
Date: Fri, 23 Jul 2004 11:51:50 -0600

> hello...
<snip/>
> translucency provided by the X server. am i right?

I have a solution that works for me (TM) for the pager being always on 
top. I have the Pager "swallowed" by FvwmButtons with some dockapps. 
Then I define the FvwmButtons to have a title bar. Then I use the "Style 
NoButtons" directives to nuke all buttons _except_ the "WindowShade" 
button.  This way my page is on the right hand side of the screen and I 
  can shade it anytime I want when I need to see the app underneath and 
unshade otherwise.

As a note, I previously had it window-shading automatically by focus 
(i.e. if I left the pager, it would lose focus and shade immediately and 
vice versa). But this became annoying and less useful when I wanted the 
pager to be ontop of certain apps at times. Hence the manual shade approach.
==========Example================
Style FvwmButtons	Sticky, StaysOnTop, Title, !Borders
Style FvwmButtons	NoButton 1, NoButton 3, NoButton 2
Style FvwmButtons	NoButton 4, NoButton 6, NoButton 8

#   for the title bar buttons:
Mouse 0 1       A       Menu MenuFvwmWindowOps2 Close
Mouse 0 4       A       Maximize 95 100
Mouse 2 4       A       Maximize 0 100
Mouse 3 4       A       Maximize grow 0
Mouse 0 2       A       Close
Mouse 0 3       A       Stick
Mouse 0 6       A       Iconify
Mouse 0 8       A       Layer 0 6 Toggle
Mouse 0 5       A       WindowShade
===================================

Oh, and I'm sorry if the message doesn't thread, I use gmane for 
read-only newsgroups.

HTH,
--
Harsh

---

From: Harshwardhan Nagaonkar <[email-masked]>
Date: Fri, 23 Jul 2004 12:00:29 -0600

<snip/>
> translucency provided by the X server. am i right?

Sorry if this message doesn't thread, I use gmane for reading this 
newsgroup.

One solution that I used for seeing FvwmPager when I want to is 
windowshading. Previously I had it so that the Pager would shade when it 
lost focus, but it would do that when I didn't want it to sometimes. So, 
  I now use "manual" shading for my FvwmButtons (which swallows 
FvwmPager). Like so:
========================
Style FvwmButtons         NoButton 1, NoButton 3, NoButton 2
Style FvwmButtons         NoButton 4, NoButton 6, NoButton 8
Style FvwmButtons Sticky, StaysOnTop, Title, !Borders

=========================

So, hence now it stays on the right side of my screen and I shade it 
whenever I want to and it stays out of the way of my work and when I 
want it to be there no matter what, I unshade it. Just an alternative 
solution to the translucency (which I don't think is in X yet...).

e.g.
+-----+-----+-----+
|                 |
+             +---+
|     Desk0   |Pgr|
+             +---+
|                 |
+-----+-----+-----+

HTH,
-- 
Harshwardhan Nagaonkar
Electrical Engineering Sysop
Brigham Young University - 84602
--
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: Fri, 23 Jul 2004 19:27:08 +0100

> right/down.. does anybody have info about how i could realize this?

do you know about Scroll?

for example,

	Key Left  A 4 Scroll -100000 0
	Key Right A 4 Scroll 100000 0
	Key Up    A 4 Scroll 0 -100000
	Key Down  A 4 Scroll 0 100000

If you want more control over the wrapping, you could write a function
to control it, you can modify this one if you like:

DestroyFunc PageScroll
AddToFunc PageScroll I PipeRead 'case $0 in \
      up) test $[page.ny] -eq $$(($[desk.pagesy]-1)) -a $[page.nx] -lt $$(($[desk.pagesx]-1)) \
         && echo GotoPage +1p 0 \
         || echo GotoPage 0p +1p;; \
      down) test $[page.ny] -eq 0 -a $[page.nx] -gt 0 \
         && echo GotoPage -1p $$(($[desk.pagesy]-1)) \
         || echo GotoPage 0p -1p;; \
   esac'

> translucency provided by the X server. am i right?

Right, it's only possible with menus because they're modal in nature.

-- 
-------------------------------------
[email-masked] | finger me for my gpg key.
-------------------------------------------------------
--
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: Julian Leyh <[email-masked]>
Date: Sat, 24 Jul 2004 03:19:39 +0200

Thanks for the replies :)

I now have configured it the way i like it..

Here my solution for the archives and for everybody who is interested.

> if i'm in screen 3 and go right, i'd like to be sent to 4.. if i'm in
> 6, send me to 7.. the same for the up/down movement. from page 7 to 2,
> from page 8 to 3. the next step would be to send me from page 9 to 1
> if i go right/down.. does anybody have info about how i could realize
> this?

I took Tavis' function (thanks alot) and modified it a bit, so that it
works for up/down and left/right and i added the wrapping from
page 9 to 1:

DestroyFunc PageScroll
AddToFunc PageScroll I PipeRead 'case $0 in \
	up) test $[page.ny] -eq 0 -a $[page.nx] -gt 0 \
	    && echo GotoPage -1p -1 \
	    || (test $[page.ny] -eq 0 \
		&& echo GotoPage -1 -1 \
		|| echo GotoPage 0p -1p);; \
	down) test $[page.ny] -eq $$(($[desk.pagesy]-1)) -a \
	      $[page.nx] -lt $(($[desk.pagesx]-1)) \
	    && echo GotoPage +1p 0 \
	    || (test $[page.ny] -eq $$(($[desk.pagesy]-1)) \
		&& echo GotoPage 0 0 \
		|| echo GotoPage 0p +1p);; \
	left) test $[page.nx] -eq 0 -a $[page.ny] -gt 0 \
	    && echo GotoPage -1 -1p \
	    || (test $[page.nx] -eq 0 \
		&& echo GotoPage -1 -1 \
		|| echo GotoPage -1p 0p);; \
	right) test $[page.nx] -eq $$(($[desk.pagesx]-1)) -a \
	      $[page.ny] -lt $$(($[desk.pagesy]-1)) \
	    && echo GotoPage 0 +1p \
	    || (test $[page.nx] -eq $$(($[desk.pagesx]-1)) \
		&& echo GotoPage 0 0 \
		|| echo GotoPage +1p 0p);; \
    esac'

Key Left  A 4  PageScroll left
Key Right A 4  PageScroll right
Key Up    A 4  PageScroll up
Key Down  A 4  PageScroll down

> is there a simple way to make fvwm do this?

followed Thomas' link
(http://www.fvwmwiki.org/cgi/moin.cgi/Tips_2fRememberFocus) and it works
fine.. not perfect, but i'll have to have a closer look on this later.

> translucency provided by the X server. am i right?

not really possible with my X server, but Harsh's idea looks nice..
maybe something with autohide would be nice ;) will come back to this
later

cu
JRL