]> git.phdru.name Git - dotfiles.git/commitdiff
.fvwm: Publish my real `main.m4`
authorOleg Broytman <phd@phdru.name>
Sun, 24 May 2020 01:20:29 +0000 (04:20 +0300)
committerOleg Broytman <phd@phdru.name>
Sun, 24 May 2020 22:10:30 +0000 (01:10 +0300)
Too much troubles updating it for publishing every time.

.fvwm/main.m4

index 4f15734c95e6927f94c92dd913085c69555db1d6..7812b7281fdaa31ec14dc6de7ad91e8325e66255 100644 (file)
@@ -3,7 +3,7 @@
 #
 
 dnl The file is in m4 format, use FvwmM4 module to read it
-dnl like this: ModuleSynchronous FvwmM4 -lock .fvwm2rc
+dnl like this: ModuleSynchronous FvwmM4 -lock main.m4
 
 dnl This is to prevent FvwmM4 to shadow $HOME
 undefine(`HOME')
@@ -85,14 +85,16 @@ ifelse(eval(WIDTH < 1024), 1, `96x30',
 
 define(`TERM', `urxvt')
 define(`TERM_KOI8', `Exec LC_CTYPE=ru_RU.KOI8-R exec TERM')
-define(`TERM_UTF8', `Exec exec "$HOME"/lib/X11/utf8rxvt')
+define(`TERM_RU_UTF8', `Exec LC_CTYPE=ru_RU.UTF-8 exec TERM -name URxvt')
+define(`TERM_EN_UTF8', `Exec LC_CTYPE=en_US.UTF-8 exec TERM -name URxvt')
+define(`TERM_HEB_UTF8', `Exec LC_CTYPE=he_IL.UTF-8 exec TERM -name URxvt')
 define(`TERM_KOI8_BOTLT', `TERM_KOI8 -geometry TERM_GEOM_BOTLT')
-define(`TERM_UTF8_BOTLT', `TERM_UTF8 -geometry TERM_GEOM_BOTLT')
+define(`TERM_RU_UTF8_BOTLT', `TERM_RU_UTF8 -geometry TERM_GEOM_BOTLT')
 define(`TERM_KOI8_BOTRT', `TERM_KOI8 -geometry TERM_GEOM_BOTRT')
-define(`TERM_UTF8_BOTRT', `TERM_UTF8 -geometry TERM_GEOM_BOTRT')
+define(`TERM_RU_UTF8_BOTRT', `TERM_RU_UTF8 -geometry TERM_GEOM_BOTRT')
 
 
-define(`SSH', `ssh -4')
+define(`SSH', `cgmem_nice 300 ssh -4')
 
 define(`REMOTE_HOST_TERM', `$1 -e SSH $2')
 
@@ -101,15 +103,26 @@ define(`REMOTE_HOST_TERM_TITLE', `$1 -title $3 -n $3 -e SSH $2')
 define(`REMOTE_HOST_KOI8',
 REMOTE_HOST_TERM_TITLE(TERM_KOI8, $1, $2))
 
+define(`REMOTE_SCREEN', `-t $1 exec screen -xRR -S default')
+
+define(`REMOTE_HOST_KOI8_SCREEN',
+REMOTE_HOST_KOI8(REMOTE_SCREEN($1), $2))
+
 define(`REMOTE_HOST_KOI8_MENU',
 "$2 (koi8)" REMOTE_HOST_KOI8($1, $2))
 
 define(`REMOTE_HOST_KOI8_BOTLT',
 REMOTE_HOST_TERM_TITLE(TERM_KOI8_BOTLT, $1, $2))
 
+define(`REMOTE_HOST_KOI8_SCREEN_BOTLT',
+REMOTE_HOST_TERM_TITLE(TERM_KOI8_BOTLT, REMOTE_SCREEN($1), $2))
+
 define(`REMOTE_HOST_KOI8_BOTRT',
 REMOTE_HOST_TERM_TITLE(TERM_KOI8_BOTRT, $1, $2))
 
+define(`REMOTE_HOST_KOI8_SCREEN_BOTRT',
+REMOTE_HOST_TERM_TITLE(TERM_KOI8_BOTRT, REMOTE_SCREEN($1), $2))
+
 define(`REMOTE_HOST_KOI8_BOTLT_MENU',
 "$2 (koi8,btlt)" REMOTE_HOST_KOI8_BOTLT($1, $2))
 
@@ -117,16 +130,16 @@ define(`REMOTE_HOST_KOI8_BOTRT_MENU',
 "$2 (koi8,btrt)" REMOTE_HOST_KOI8_BOTRT($1, $2))
 
 define(`REMOTE_HOST_UTF8',
-REMOTE_HOST_TERM(TERM_UTF8, $1))
+REMOTE_HOST_TERM(TERM_RU_UTF8, $1))
 
 define(`REMOTE_HOST_UTF8_MENU',
 "$2 (utf8)" REMOTE_HOST_UTF8($1, $2))
 
 define(`REMOTE_HOST_UTF8_BOTLT',
-REMOTE_HOST_TERM(TERM_UTF8_BOTLT, $1))
+REMOTE_HOST_TERM(TERM_RU_UTF8_BOTLT, $1))
 
 define(`REMOTE_HOST_UTF8_BOTRT',
-REMOTE_HOST_TERM(TERM_UTF8_BOTRT, $1))
+REMOTE_HOST_TERM(TERM_RU_UTF8_BOTRT, $1))
 
 define(`REMOTE_HOST_UTF8_BOTLT_MENU',
 "$2 (utf8,btlt)" REMOTE_HOST_UTF8_BOTLT($1, $2))
@@ -484,9 +497,9 @@ AddToFunc StartStandardSession
 +              I TERM_KOI8
 +              I Wait TERM
 +              I GotoDeskAndPage 0 0 1
-+              I TERM_UTF8 -geometry 38x30+0-0
++              I TERM_RU_UTF8 -geometry 38x30+0-0
 +              I Wait URxvt
-+              I Exec exec pulseaudio --start
++              I Exec exec cgmem_nice 200 pulseaudio --start
 +              I PaVuControl
 +              I Exec exec "$HOME"/current/projects/audio-cdr-video/audio/pa-mic-off
 +              I XsetbgFilename
@@ -504,7 +517,7 @@ AddToFunc ResumeFunction
 +              I GotoDeskAndPage 0 0 0
 +              I TERM_KOI8
 +              I Wait TERM
-+              I Exec exec pulseaudio --start
++              I Exec exec cgmem_nice 200 pulseaudio --start
 +              I None ("Volume Control") PaVuControl
 +              I Exec sleep 10; exec "$HOME"/current/projects/audio-cdr-video/audio/pa-mic-off
 +              I XsetbgFilename
@@ -581,7 +594,7 @@ AddToFunc Raise-All           I All Raise
 
 DestroyFunc PaVuControl
 AddToFunc PaVuControl         I GotoDeskAndPage 0 1 1
-+                             I Exec exec pavucontrol
++                             I Exec exec cgmem_nice 200 pavucontrol
 +                             I Wait "Volume Control"
 
 changequote([,])
@@ -591,7 +604,23 @@ changequote([`], ['])
 
 DestroyFunc AudioPlayer
 AddToFunc AudioPlayer         I GotoDeskAndPage 0 1 1
-+                             I Exec exec audacious
++                             I Exec LC_CTYPE=ru_RU.KOI8-R exec cgmem_nice 200 audacious
+
+DestroyFunc Term-Iskra
+AddToFunc Term-Iskra          I GotoDeskAndPage 1 1 2
++                             I REMOTE_HOST_KOI8(iskra-aviel.phdru.name, iskra)
+
+DestroyFunc Term-Iskra-Big
+AddToFunc Term-Iskra-Big      I GotoDeskAndPage 1 1 2
++                             I REMOTE_HOST_KOI8_BIG(iskra-aviel.phdru.name, iskra)
+
+DestroyFunc Term-Oper
+AddToFunc Term-Oper           I GotoDeskAndPage 1 1 2
++                             I REMOTE_HOST_KOI8_BOTRT(oper.med.ru, oper)
+
+DestroyFunc Term-Oper-Big
+AddToFunc Term-Oper-Big       I GotoDeskAndPage 1 1 2
++                             I REMOTE_HOST_KOI8_BIG(oper.med.ru, OPER)
 
 DestroyFunc Term-Phdru
 AddToFunc Term-Phdru          I GotoDeskAndPage 1 0 1
@@ -604,19 +633,19 @@ AddToFunc Term-Phdru-Big      I GotoDeskAndPage 1 0 1
 DestroyFunc FireFox
 AddToFunc FireFox             I Any ("*Mozilla Firefox") Break
 +                             I GotoDeskAndPage 1 0 0
-+                             I Exec exec start-browser firefox
++                             I Exec LC_CTYPE=ru_RU.KOI8-R exec cgmem_nice 4000 start-browser firefox
 +                             I Wait "*Mozilla Firefox"
-+                             I Exec exec firefox --new-window
++                             I Exec LC_CTYPE=ru_RU.KOI8-R exec cgmem_nice 4000 firefox --new-window
 +                             I Wait "*Mozilla Firefox"
 +                             I Next ("*Mozilla Firefox") Iconify true
 
 DestroyFunc Gajim
 AddToFunc Gajim               I GotoDeskAndPage 1 1 0
-+                             I Exec exec gajim
++                             I Exec exec cgmem_nice 300 gajim
 
 DestroyFunc Pidgin
 AddToFunc Pidgin              I GotoDeskAndPage 1 1 0
-+                             I Exec exec pidgin
++                             I Exec exec cgmem_nice 300 pidgin
 
 DestroyFunc XFilename
 AddToFunc XSetbgFilename      I Exec "$HOME"/current/projects/xsetbg/print-filename.py | text-wrap.py -w TEXT_WIDTH -s | gxmessage -buttons Ok -default Ok -fn 'MESSAGE_FONT' -file -
@@ -663,16 +692,17 @@ AddToMenu Window-Ops2   "Center"        Center
 
 AddToMenu Terminals     "Terminals" Title
 +               "Grey term (koi8)" TERM_KOI8
-+               "Grey term (utf8)" TERM_UTF8
++               "Grey term (utf8)" TERM_RU_UTF8
++               "Grey term (heb-utf8)" TERM_HEB_UTF8
 +               "Grey term (koi8,btlt)" TERM_KOI8_BOTLT
 +               "Grey term (koi8,btrt)" TERM_KOI8_BOTRT
-+               "Grey term (utf8,btlt)" TERM_UTF8_BOTLT
-+               "Grey term (utf8,btrt)" TERM_UTF8_BOTRT
++               "Grey term (utf8,btlt)" TERM_RU_UTF8_BOTLT
++               "Grey term (utf8,btrt)" TERM_RU_UTF8_BOTRT
 +               "Big grey term (koi8)" TERM_KOI8 -geometry TERM_GEOM_BIG
-+               "Big grey term (utf8)" TERM_UTF8 -geometry TERM_GEOM_BIG
++               "Big grey term (utf8)" TERM_RU_UTF8 -geometry TERM_GEOM_BIG
 +                       ""      Nop
 +               "White/black term (koi8)" TERM_KOI8 -fg white -cr white -bg black
-+               "White/black term (utf8)" TERM_UTF8 -fg white -bg black
++               "White/black term (utf8)" TERM_RU_UTF8 -fg white -bg black
 
 AddToMenu TermColors    "Term Colors" Title
 +                       "Term: black/mediumturquoise" TERM_KOI8 -fg black -cr black -bg mediumturquoise
@@ -700,6 +730,14 @@ AddToMenu TermColors    "Term Colors" Title
 +                       "Term: white/black" TERM_KOI8 -fg white -cr white -bg black
 
 AddToMenu Systems       "Systems" Title
++                       REMOTE_HOST_KOI8_MENU(iskra-aviel.phdru.name, iskra)
++                       REMOTE_HOST_UTF8_BOTLT_MENU(iskra-aviel.phdru.name, iskra)
++                       REMOTE_HOST_KOI8_BIG_MENU(iskra-aviel.phdru.name, ISKRA)
++                       ""        Nop
++                       REMOTE_HOST_KOI8_BOTRT_MENU(oper.med.ru, oper)
++                       REMOTE_HOST_UTF8_BOTRT_MENU(oper.med.ru, oper)
++                       REMOTE_HOST_KOI8_BIG_MENU(oper.med.ru, OPER)
++                       ""        Nop
 +                       REMOTE_HOST_KOI8_MENU(phdru.name, phdru)
 +                       REMOTE_HOST_UTF8_BOTLT_MENU(phdru.name, phdru)
 +                       REMOTE_HOST_KOI8_BIG_MENU(phdru.name, PHDRU)
@@ -776,10 +814,11 @@ AddToMenu RootMenu "Root Menu"  Title
 # This menu will fire up some often used programs
 DestroyMenu  Utilities
 AddToMenu Utilities     "Choose one:" Title
-+                       "qPDFview" Exec exec qpdfview
-+                       "FBReader" Exec exec fbreader
++                       "qPDFview" Exec LC_CTYPE=ru_RU.KOI8-R exec qpdfview
++                       "FBReader" Exec LC_CTYPE=ru_RU.KOI8-R exec fbreader
 +                       ""       Nop
-+                       "GVim"     Exec exec gvim
++                       "GVim (koi8)" Exec LC_CTYPE=ru_RU.KOI8-R exec gvim
++                       "GVim (utf8)" Exec LC_CTYPE=ru_RU.UTF-8  exec gvim
 +                       ""       Nop
 #+                       "XFortune" Exec /usr/games/fortune | gxmessage -buttons Ok -default Ok -fn 'MESSAGE_FONT' -file -
 #+                       "xbuffy" Exec exec xbuffy -fn 'XBUFFY_FONT' -geometry +0+125 -boxfile mail/misc/.xbuffyrc
@@ -807,8 +846,8 @@ AddToMenu Utilities     "Choose one:" Title
 DestroyMenu  Browsers
 AddToMenu Browsers      "Choose one:" Title
 +                       "FireFox" FireFox
-+                       "Chromium" None ("*Chromium") Exec exec start-browser chromium
-+                       "Opera" None ("*Opera") Exec exec start-browser opera
++                       "Chromium" None ("*Chromium") Exec LC_CTYPE=ru_RU.KOI8-R exec cgmem_nice 2000 start-browser chromium
++                       "Opera" None ("*Opera") Exec LC_CTYPE=ru_RU.KOI8-R exec cgmem_nice 2000 start-browser opera
 
 # A wide variety of screenlocking options...
 #AddToMenu XlockMenu     "Choose one:" Title
@@ -836,7 +875,7 @@ AddToMenu XScreenSaverMenu     "Choose mode:" Title
 
 AddToMenu XSetBgMenu    "XSetBg" Title
 +                       "Change wallpaper" Exec exec "$HOME"/current/projects/xsetbg/xsetbg-force
-+                       "Start" Exec exec "$HOME"/current/projects/xsetbg/xsetbg-http-start
++                       "Start" Exec exec cgmem_nice 100 "$HOME"/current/projects/xsetbg/xsetbg-http-start
 +                       "Stop" Exec exec "$HOME"/current/projects/xsetbg/xsetbg-http-stop
 +                       "Restart" Exec exec "$HOME"/current/projects/xsetbg/xsetbg-http-restart
 +                       ""       Nop
@@ -894,18 +933,20 @@ changequote([`], ['])
 
 # Buttons
 pushdef(`TERM_KOI8', `Exec "TERM" LC_CTYPE=ru_RU.KOI8-R exec TERM')
-pushdef(`TERM_UTF8', `Exec "URxvt" exec "$HOME"/lib/X11/utf8rxvt')
+pushdef(`TERM_RU_UTF8', `Exec "URxvt" LC_CTYPE=ru_RU.UTF-8 exec TERM -name URxvt')
 *FvwmButtons: (Title Term,     Icon rterm2.xpm,      Action TERM_KOI8)
-*FvwmButtons: (Title UTF-8,    Icon rterm2.xpm,      Action TERM_UTF8)
-*FvwmButtons: (Title phdru,    Icon xterm-sgi.xpm,   Action REMOTE_HOST_KOI8(phdru.name, phdru.name))
-popdef(`TERM_KOI8', `TERM_UTF8')
+*FvwmButtons: (Title UTF-8,    Icon rterm2.xpm,      Action TERM_RU_UTF8)
+*FvwmButtons: (Title phdru,    Icon xterm-sgi.xpm,   Action REMOTE_HOST_KOI8_SCREEN(-D 1080 phdru.name, phdru.name))
+*FvwmButtons: (Title iskra,    Icon xterm-sgi.xpm,   Action REMOTE_HOST_KOI8_SCREEN(iskra-aviel.phdru.name, iskra))
+*FvwmButtons: (Title oper,     Icon xterm-linux.xpm, Action REMOTE_HOST_KOI8_SCREEN_BOTRT(oper.med.ru, oper))
+popdef(`TERM_KOI8', `TERM_RU_UTF8')
 
 *FvwmButtons: (Title Wallpaper, Icon find1.xpm,        Action Exec "gxmessage" "$HOME"/current/projects/xsetbg/print-filename.py | text-wrap.py -w TEXT_WIDTH -s | gxmessage -buttons Ok -default Ok -fn 'MESSAGE_FONT' -file -)
 *FvwmButtons: (Title "-1",      Icon find1.xpm,        Action Exec "gxmessage" "$HOME"/current/projects/xsetbg/print-filename.py 1 | text-wrap.py -w TEXT_WIDTH -s | gxmessage -buttons Ok -default Ok -fn 'MESSAGE_FONT' -file -)
 *FvwmButtons: (Title Next,      Icon Jrecycle.xpm,     Action Exec exec "$HOME"/current/projects/xsetbg/xsetbg-http-force)
-*FvwmButtons: (Title pavucontrol, Icon mini.sound.xpm, Action Exec "Volume Control" exec pavucontrol)
+*FvwmButtons: (Title pavucontrol, Icon mini.sound.xpm, Action Exec "Volume Control" exec cgmem_nice 200 pavucontrol)
 #*FvwmButtons: (Title Id3Info,  Icon bell.xpm,         Action Id3Info)
-*FvwmButtons: (Title AudioPlayer,  Icon bell.xpm,      Action Exec "Audacious" exec audacious)
+*FvwmButtons: (Title AudioPlayer,  Icon bell.xpm,      Action Exec "Audacious" LC_CTYPE=ru_RU.KOI8-R exec cgmem_nice 200 audacious)
 #*FvwmButtons: (Title XLock,     Icon Jxlock.xpm,      Action Exec exec xscreensaver-command -lock)
 
 ############################################################################