Skip to content

Instantly share code, notes, and snippets.

@punassuming
Created July 19, 2011 17:07
Show Gist options
  • Save punassuming/1093101 to your computer and use it in GitHub Desktop.
Save punassuming/1093101 to your computer and use it in GitHub Desktop.
FVWM Pager
###############################
# 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 9
# 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment