Popup pager like in compiz

Modified the pager to autohide and show on window movement or page change.

Specify Styles for pager

Style FvwmPager CirculateHit, NoTitle, !Handles, !Borders, Sticky, StaysOnTop, Iconifiable, PositionPlacement center

Use FvwmAuto to keep track of pager

[code]# Start FvwmAuto
AddToFunc StartFunction

  • I Module FvwmAuto FvwmAutoHide -menter enter_handler[/code]

Specify handler that will iconify pager after 1 sec

[code]DestroyFunc enter_handler
AddToFunc enter_handler

  • I KillPage FvwmPager 1000

DestroyFunc KillPage
AddToFunc KillPage

  • I ThisWindow ($0) Deschedule $[w.id]
  • I All ($0) Kill_pager $1

DestroyFunc Kill_pager
AddToFunc Kill_pager

  • I Schedule $0 $[w.id] Iconify On
  • I Schedule $0 $[w.id] Deschedule $[w.id][/code]

Add the functions to show the pager,and only launch pager once if already iconified.

[code]DestroyFunc ShowPager
AddToFunc ShowPager

  • I All (FvwmPager) Iconify off
  • I TestRc (!Match) Module FvwmPager

DestroyFunc ShowAndGoPager
AddToFunc ShowAndGoPager

  • I ShowPager
  • I GoToPage $0p 0p
  • I Next (!FvwmPager,CurrentPage, Raised, !Focused) Focus

DestroyFunc MoveWLeft
AddToFunc MoveWLeft

  • I MoveToPage -1p 0p
  • I ShowAndGoPager -1p 0p

DestroyFunc MoveWRight
AddToFunc MoveWRight

  • I MoveToPage +1p 0p
  • I ShowAndGoPager +1p 0p

DestroyFunc MoveWUp
AddToFunc MoveWUp

  • I MoveToPage 0p +1p
  • I ShowAndGoPager 0p +1p

DestroyFunc MoveWDown
AddToFunc MoveWDown

  • I MoveToPage 0p -1p
  • I ShowAndGoPager 0p -1p
    [/code]

No backslash here.

More easily put:

DestroyFunc HandlePaging
AddToFunc   HandlePaging
+ I MoveToPage $*
+ I ShowAndGoPager $*

DestroyFunc MoveWLeft
AddToFunc MoveWLeft
+ I HandlePaging -1p 0p

[... etc...]

– Thomas Adam

I thought about combining the two functions after I posted.

Now one question I have is:

+ I Next (!FvwmPager,CurrentPage, Raised, !Focused) Focus

The command was attempting to focus on a window on the current page if not already focused, but it doesn’t seem to work. Any suggestion on the filters I need in place to focus the topmost window in the current page only if a window isn’t already in focus, (i.e from moving it to the current page).

Also, with your resize improvements branch on GH, you implement a new automatic option to Resize. Would there be any way to get that to work along with FuncFvwmRaiseLowerX so that I can get instant resize on single click?

Is that what you really want though? Well, I’d wonder if making the FvwmPager -transient wouldn’t help here as well. But the above isn’t write for doing what you want. Try:

Prev (CurrentPage, !Focused, AcceptsFocus) FlipFocus

If you want to exclude FvwmPager, set WindowListSkip and CirculateSkip on it.

You’d need to be more specific.

– Thomas Adam

With the resize function, I have two mappings with my mouse:

Mouse 3 W 4 ThisWindow (!Iconic, !Shaded) FuncFvwmRaiseLowerX Resize direction automatic Mouse 3 W 4S ThisWindow (!Iconic, !Shaded) Resize direction automatic

The first resizes on click and finishes resize on release (like most of the more recent WM’s), while the second resizes after click and completes the resize after a second click.

The second binding works as expected, by guessing which corner you are closer to and resizing from there, while the first binding still requires me to move to a border to initiate window resize, as I don’t think the “direction” option is carried out due to the FuncFvwmRaiseLowerX.

Its a stupid problem, I know…

Well, it’s not really your fault. Look at this:

AddToFunc FuncFvwmRaiseLowerX
+ I Raise
+ M $0
+ D Lower

With what you’ve got here:

FuncFvwmRaiseLowerX Resize direction automatic

The function above for +M will only ever recognise the first argument you pass to it, in this case “Resize”; ignoring the other options you pass in. You could get around the above like this if you cared:

DestroyFunc MyResizeFunc
AddToFunc   MyResizeFunc
+ I Resize direction automatic

FuncFvwmRaiseLowerX MyResizeFunc

But I would be more inclined to just write your own function and forget FuncFvwmRaiseLowerX to be honest.

The difference between having to keep the mouse button held as you resize the window, versus you being able to click, resize, and click again to stop the resize is because any calls to FVWM functions grab the pointer.

– Thomas Adam

I updated my config at ]https://gist.github.com/1093101[/url]

I modified the code to slide using the Scroll function. The speed is determined through ScrollSpeed. In order to grab a window and slide it to the next window, I temporarily make the window sticky and unsticky it at the end. The only issue is if ScrollSpeed is set to something not a multiple of 100.

Here is the code:

[code]###############################

Compiz like pager for FVWM

###############################

FEATURES

Slide between pages

Autohide pager after switch

Style FvwmPager NoTitle, !Handles, Borders, Sticky, StaysOnTop, Iconifiable, PositionPlacement center

Set up scroll speed (shorter is quicker)

SetEnv ScrollSpeed 10

Modified to include an extra one if ScrollSpeed is not multiple of 100

DestroyFunc ScrollPage
AddToFunc ScrollPage

  • I PipeRead ‘for i in seq 1 $(($ScrollSpeed + 100 % $ScrollSpeed));
    do echo Scroll “$(( $0 * 100 /$ScrollSpeed ))” “$(( $1 * 100 / $ScrollSpeed))”; done’

Show Pager if currently iconified

DestroyFunc ShowPager
AddToFunc ShowPager

  • I All (FvwmPager) Iconify off
  • I TestRc (!Match) Module FvwmPager

Show pager and then scroll pased on integer command

DestroyFunc ShowAndScrollPager
AddToFunc ShowAndScrollPager

  • I ShowPager
  • I ScrollPage $0 $1
  • I Current (!Root, CurrentPage, AnyScreen)
  • I TestRc (NoMatch) Prev (!FvwmPager,CurrentPage, AnyScreen, Raised, !Focused) Focus

Move current page to other desktop

DestroyFunc ScrollWithPage
AddToFunc ScrollWithPage

  • I ShowPager
  • I PipeRead "echo Current WindowStyle Sticky; echo UpdateStyles; echo ShowAndScrollPager $*; echo Current WindowStyle !Sticky; echo UpdateStyles; "

If pager is shown, run Hide_pager

DestroyFunc HidePager
AddToFunc HidePager

  • I ThisWindow ($0) Deschedule $[w.id]
  • I All ($0) Hide_pager $1

Iconify pager

DestroyFunc Hide_pager
AddToFunc Hide_pager

  • I Schedule $0 $[w.id] Iconify On
  • I Schedule $0 $[w.id] Deschedule $[w.id]

Add the windows you want to AutoHide

DestroyFunc HideMyPager
AddToFunc HideMyPager

  • I HidePager FvwmPager 1500

Start FvwmAuto

AddToFunc StartFunction

  • I Module FvwmAuto FvwmAutoHide -menterleave HideMyPager HideMyPager
    [/code]

My keybindings are:

[code]Key Up A MC ShowAndScrollPager 0 -1
Key Down A MC ShowAndScrollPager 0 +1
Key Right A MC ShowAndScrollPager +1 0
Key Left A MC ShowAndScrollPager -1 0

Mouse 5 R N ScrollPage 1 0
Mouse 4 R N ScrollPage -1 0

Key Up A MCS ScrollWithPage 0 -1
Key Down A MCS ScrollWithPage 0 +1
Key Right A MCS ScrollWithPage +1 0
Key Left A MCS ScrollWithPage -1 0[/code]

I’ve now merged this in to the mainline 2.6.X branch in CVS as well as:

github.com/ThomasAdam/fvwm/tree/branch-2_6

Which is the same thing.

– Thomas Adam