]> git.phdru.name Git - dotfiles.git/blobdiff - .fvwm/phd.m4
.fvwmrc: test for a window before starting browser
[dotfiles.git] / .fvwm / phd.m4
index 898bc04306d8e23a45092fa7b775684447e0a27a..083b3e5bab771b6b9174ed5ef98934a41481868d 100644 (file)
@@ -26,6 +26,7 @@ dnl define(`XBUFFY_FONT', `-cronyx-helvetica-bold-r-*-*-*-100-*-*-*-*-koi8-r')
 
 
 dnl TrueType Fonts
+define(`VERY_SMALL_FONT', `xft:Sans:size=10')
 define(`SMALL_FONT', `xft:Sans:size=12')
 define(`MEDIUM_FONT', `xft:Sans:size=14')
 define(`BIG_FONT', `xft:Sans:size=16')
@@ -47,6 +48,7 @@ define(`PAGER_GEOM',
 ifelse(eval(WIDTH < 1024), 1, `365x100+0+0',
        eval(WIDTH < 1920), 1, `365x100+0+0', `600x160+0+0'))
 
+define(`SMALL_PAGER_FONT', ifelse(eval(WIDTH < 1920), 1, VERY_SMALL_FONT, SMALL_FONT))
 define(`PAGER_FONT', ifelse(eval(WIDTH < 1920), 1, SMALL_FONT, BIG_FONT))
 define(`BUTTONS_FONT', PAGER_FONT)
 
@@ -132,7 +134,6 @@ define(`REMOTE_HOST_KOI8_BIG_MENU',
 "$2 (koi8)" REMOTE_HOST_KOI8_BIG($1, $2))
 divert
 
-
 ##########################################################################
 # PATH Setup
 #
@@ -219,7 +220,6 @@ DesktopSize 2 2
 #
 Style * PositionPlacement Center
 
-
 ############################################################################
 # STYLE Flag Setup
 #
@@ -362,7 +362,6 @@ ButtonStyle 3 12 10x23@0 90x23@0 90x28@0 10x28@1 10x47@1 90x47@0 90x52@0 10x52@1
 # the number "2"
 #ButtonStyle 8 12 80x80@0 22x80@0 80x40@0 70x25@0 30x25@0 20x35@0 20x30@1 30x20@1 70x20@1 80x30@1 20x75@1 80x75@1
 
-
 ############################################################################
 # MOUSE Setup
 #
@@ -446,20 +445,31 @@ Key 8           A       CM      GotoPage 1 1
 #############################################################################
 # START-UP Functions
 #
-AddToFunc "InitFunction"
+DestroyFunc InitFunction
+AddToFunc InitFunction
 +              I Module FvwmBacker
 +              I Module FvwmButtons
 +              I Module FvwmCommandS
 +              I Module FvwmPager 0 2
 
-AddToFunc "RestartFunction"
+DestroyFunc RestartFunction
+AddToFunc RestartFunction
 +              I Module FvwmBacker
 +              I Module FvwmButtons
 +              I Module FvwmCommandS
 +              I Module FvwmPager 0 2
-+              I Next [!iconic CurrentScreen xterm] Focus
++              I Schedule 1000 Raise-All
 
-AddToFunc "StartStandardSession"
+DestroyFunc UrgencyFunc
+AddToFunc UrgencyFunc
++                             I Iconify off
++                             I ThisWindow ("*Downloads") Break
++                             I FlipFocus
++                             I Raise
++                             I WarpToWindow 5p 5p
+
+DestroyFunc StartStandardSession
+AddToFunc StartStandardSession
 +              I GotoDeskAndPage 0 0 0
 +              I TERM_KOI8
 +              I Wait TERM
@@ -471,8 +481,7 @@ AddToFunc "StartStandardSession"
 +              I Wait TERM
 +              I PaVuControl
 +              I Wait "Volume Control"
-+              I FireFox
-+              I Wait "*Mozilla Firefox"
++              I FireFox-Wait
 +              I GotoDeskAndPage 1 0 1
 +              I TERM_KOI8
 +              I Wait TERM
@@ -488,6 +497,17 @@ AddToFunc "StartStandardSession"
 +              I GotoDeskAndPage 1 1 0
 +              I Schedule 1000 GotoDeskAndPage 0 1 0
 
+DestroyFunc ResumeFunction
+AddToFunc ResumeFunction
++              I GotoDeskAndPage 0 0 0
++              I TERM_KOI8
++              I Wait TERM
++              I PaVuControl
++              I Wait "Volume Control"
++              I Exec $HOME/current/projects/xsetbg/print-filename.py | text-wrap.py -w TEXT_WIDTH -s -n | gxmessage -buttons Ok -default Ok -fn 'MESSAGE_FONT' -file -
++              I Wait gxmessage
++              I None ("*Mozilla Firefox") FireFox-Wait
++              I GotoDeskAndPage 0 1 0
 
 ############################################################################
 # COMPLEX FUNCTIONS
@@ -496,47 +516,61 @@ DestroyFunc Center
 AddToFunc Center                I Move 50-50w 50-50w
 +                               I WarpToWindow 74p 18p
 
+DestroyFunc Iconify-and-Raise
 AddToFunc Iconify-and-Raise     I Iconify
 +                               I Raise
 
+DestroyFunc Maximize-Func
 AddToFunc Maximize-Func         C Maximize     toggle
 +                               D Maximize     100 100
 
+DestroyFunc Move-or-Iconify
 AddToFunc Move-or-Iconify       I Raise
 +                               M Move
 +                               D Iconify
 
+DestroyFunc Move-or-Raise
 AddToFunc Move-or-Raise         I Raise
 +                               M Move
 +                               D Lower
 
+DestroyFunc Move-or-Raise2
 AddToFunc Move-or-Raise2        M Raise
 +                               M Move
 +                               D Lower
 
+DestroyFunc Resize-or-Raise
 AddToFunc Resize-or-Raise       I Raise
 +                               M Resize
 +                               D Lower
 
+DestroyFunc Resize-or-Raise2
 AddToFunc Resize-or-Raise2      M Raise
 +                               M Resize
 +                               D Lower
 
+DestroyFunc Shadify
 AddToFunc Shadify               D WindowShade
 +                               M Move
 +                               C RaiseLower
 
+DestroyFunc warp-or-run
 AddToFunc warp-or-run           I Next [$0 CirculateHit] Iconify -1
 +                               I Next [$0 CirculateHit] Focus
 +                               I None [$0] $1
 
+DestroyFunc MailFunction
 AddToFunc MailFunction          I Next [$0] Iconify -1
 +                               I Next [$0] focus
 +                               I None [$0] Exec exec $0 $1
 
+DestroyFunc PrintFunction
 AddToFunc PrintFunction         I Raise
 +                               I Exec exec xdpr -id $w
 
+DestroyFunc Raise-All
+AddToFunc Raise-All           I All (!"FvwmButtons|System|*clock") Raise
+
 ##############################################################################
 # User-defined functions
 #
@@ -571,9 +605,15 @@ AddToFunc Term-Phdru-Big      I GotoDeskAndPage 1 0 1
 +                             I REMOTE_HOST_KOI8_BIG(phdru.name, phdru.name)
 
 DestroyFunc FireFox
-AddToFunc FireFox             I GotoDeskAndPage 1 0 0
+AddToFunc FireFox             I Any ("*Mozilla Firefox") Break
++                             I GotoDeskAndPage 1 0 0
 +                             I Exec LC_CTYPE=ru_RU.KOI8-R exec start-browser firefox
 
+DestroyFunc FireFox-Wait
+AddToFunc FireFox-Wait        I Any ("*Mozilla Firefox") Break
++                             I FireFox
++                             I Wait "*Mozilla Firefox"
+
 DestroyFunc Gajim
 AddToFunc Gajim               I GotoDeskAndPage 1 1 0
 +                             I Exec exec gajim
@@ -582,17 +622,6 @@ DestroyFunc Pidgin
 AddToFunc Pidgin              I GotoDeskAndPage 1 1 0
 +                             I Exec exec pidgin
 
-DestroyFunc Raise-All
-AddToFunc Raise-All           I All (!"FvwmButtons|System|*clock") Raise
-
-DestroyFunc UrgencyFunc
-AddToFunc UrgencyFunc
-+                             I Iconify off
-+                             I ThisWindow ("*Downloads") Break
-+                             I FlipFocus
-+                             I Raise
-+                             I WarpToWindow 5p 5p
-
 ##############################################################################
 # MENU Setup
 #
@@ -615,7 +644,7 @@ AddToMenu Window-Ops    "Window Ops"    Title
 +                       "Refresh Screen" Refresh
 
 # A trimmed down version of "Window Ops", good for binding to decorations
-DestroyMenu "Window-Ops2"
+DestroyMenu Window-Ops2
 AddToMenu Window-Ops2   "Center"        Center
 +                       "Move"          Move-or-Raise
 +                       "Iconify"       Iconify
@@ -776,8 +805,8 @@ AddToMenu Utilities     "Choose one:" Title
 DestroyMenu  Browsers
 AddToMenu Browsers      "Choose one:" Title
 +                       "FireFox" FireFox
-+                       "Chromium" Exec LC_CTYPE=ru_RU.KOI8-R exec start-browser chromium
-+                       "Opera" Exec LC_CTYPE=ru_RU.KOI8-R exec start-browser opera
++                       "Chromium" None ("*Chromium") Exec LC_CTYPE=ru_RU.KOI8-R exec start-browser chromium
++                       "Opera" None ("*Opera") Exec LC_CTYPE=ru_RU.KOI8-R exec start-browser opera
 
 # A wide variety of screenlocking options...
 #AddToMenu XlockMenu     "Choose one:" Title
@@ -855,7 +884,6 @@ changequote([`], ['])
 # Background
 #*FvwmButtons: Pixmap fvwm.xpm
 
-
 # Define the buttons to use.....
 #*FvwmButtons: Move              arrows2.xpm     Move
 #*FvwmButtons: Kill              skull.xpm       Destroy
@@ -875,7 +903,6 @@ changequote([`], ['])
 #*FvwmButtons: Real    bell.xpm    Exec cd /opt/audio && exec realplay
 #*FvwmButtons: Kill    rbomb.xpm    Destroy
 
-
 # Buttons
 *FvwmButtons: (Title Term,     Icon rterm2.xpm,      Action TERM_KOI8)
 *FvwmButtons: (Title UTF-8,    Icon rterm2.xpm,      Action TERM_UTF8)
@@ -1043,7 +1070,7 @@ changequote([`], ['])
 *FvwmPager: Label 0 System
 *FvwmPager: Label 1 Net
 *FvwmPager: Label 2 Work
-*FvwmPager: SmallFont PAGER_FONT
+*FvwmPager: SmallFont SMALL_PAGER_FONT
 
 *FvwmPager: Balloons All
 *FvwmPager: BalloonBack #efe3b5