Posted by member 7223 on 2004-06-03 16:23:38
Then, add this line to your theme.rc:
and !recycle.
vwm.txt (v1.1)
------------------------------------------------------------------------------
1. Introduction:
---------------
This trick will enhance your vwm.
You need to add the following lines somewhere in your theme.rc to make it works:
; an $evars$ defining the popup module to load
PopupID popup2-2.1.7
; these modules
*netloadmodule $PopupID$
*netloadmodule wndman-0.15
*netloadmodule rabidvwm-1.1.1
*netloadmodule one-0.7
*netloadmodule xlabel-3.0.5
*netloadmodule mzscript-0.9-beta_12
; and some settings:
xlabelusetextedit
mzautosavevars immediately
include "$configdir$vwm.rc"
2. The tricks:
-------------
2.1. VWM's tooltip:
------------------
Hovering VWM's mini-windows shows a tooltip displaying these informations:
- the class of the window you're over
- the window title
- the window handle
- its specific alpha-transparency level
2.2 VWM mouse clicks:
----------------------
The way VWM manage clicks should be slightly different from the standard:
- the "desktop switching" on right-click have been disabled
- an "AllWithLeftClick" mode have been introduced allowing: desktop switching, window
draging and giving focus to the window you're clicking on.
- Right-clicking pops up the VWM's popup menu (see below)
2.3 Alpha transparency management:
-----------------------------------
This trick offers you three "alpha management" modes. All modes allow you to modify the
alpha transparency level of any windows by middle-clicking on its VWM mini-window and,
then, using the mouse wheel.
Depending on the "Alpha mode" you're in, you might store the alpha level of any window
class in a "specific list".
Note that some windows might have strange reactions while playing with their alpha level.
In that case, adding the class of these windows to the "exclusion list" should be a good
idea (see below) You won't be able to change the alpha level of windows stored in the
"exclusion list", whatever mode you're in.
2.3.1 "Disabled" mode:
In that mode (even if it's called "disabled") changing the alpha level can be done like
describe above. But the changes won't be save except if that window is already on the
"specific list". Opening new windows, even those in the "specific list", won't change their
alpha level. You have to middle-click on it to enable the alpha stuff for that window.
2.3.2 "On new window" mode:
Opening windows that are in the specific list will automatically change the alpha level for
that window according to its specific value. In that mode, you can change the alpha
level of other windows and, by doing this, that window class is automatically save to the
"specific list" with the corresponding alpha value.
To remove a given window from the "specific list", just middle-click on it and scroll the
mouse wheel up until you see "Alpha: undefined" in the tooltip.
2.3.3 "Alpha toggle" mode:
In that mode, all windows will have the "inactive windows" alpha level except those
stored in the "specific list". The active window will have the "active window" alpha level.
You can define on the fly "inactive" and active" alpha levels simply by setting the alpha
level of any window and choosing the corresponding option in the menu (see below)
Note that you can add / remove windows to / from the "specific list" like in "On new
window" mode.
2.4 The VWM's popup menu:
---------------------------
2.4.1 "Alpha mode" allow you to:
- switch between "Disabled", "On new window" and "Alpha toggle" modes.
- add "window class" to the "exclusion list" (only when clicking on a mini-window) if that
class isn't already stored in that list.
- remove "window class" to the "exclusion list" (only when clicking on a mini-window) if
that class is already stored in that list.
- if you're in "Alpha toggle" mode and the window you've right-clicked on have a specific
alpha level, you'll be able to define that alpha level as the "inactive" or "active" windows
default alpha level. Note that this window will be remove from the "specific list".
- open "specific list" in "$txteditor$"
- open "exclusion list" in "$txteditor$"
2.4.2 "Send to clipboard":
- the window's class
- the window's title
- the window's handle
2.4.3 "Behavior" lets you toggle:
- hide tasks on switch
- switch on focus
- no wrap
- snap windows on drag
Note: changes of these parameters are stored in "$configdir$vwm.var$" but you have to
be sure you don't have the following settings defined in your theme.rc:
- VwmHideTaskOnSwitch
- VwmSwitchOnAnyFocus
- VwmNoWrap
- VwmSnapWindowOnDrag
2.4.4 Gather windows brings all windows to the current desktop
2.5 Important notes:
--------------------
- If some windows doesn't seem to remember their specific alpha level, make sure they
don't have dynamic classes. In that case, there's nothing more I can do.
- The VWM must always be visible for the "Alpha toggle" mode to work. If you need to
hide it, just move it to $resolutionx*9$ $resolutiony*9$.
- Popup module is reloaded each time you right-click on the VWM but no !reload is done.
- In "Aplha toggle" mode, it's a good idea to have VWMFocusTop set
have fun,
Smurth
bug report and suggestions:
smurth at free dot fr
; vwm.rc (v1.1)
;------------------------------------------------------------------------------
*mzvarfile "$configdir$vwm.var"
*mzvarfile "$configdir$vwm_alpha.var"
*mzvarfile "$configdir$vwm_alphaex.var"
*mzscriptfile "$configdir$vwm.mz"
include "$configdir$vwm.var"
vwmmouseright 0
vwmonleftbuttondown !execute [!vwmdesk ^@md^][!one [hwnd:^@ch^]]
; enables tooltip support
;vwmonmouseover !vwmaction hover !vwm_ext_tooltip ^@#c^@ch^@#c^ "^@#c^@cc^@#c^" "^@#c^@ct^@#c^"
vwmonhover !vwm_ext_tooltip ^@ch^ "^@cc^" "^@ct^"
vwmonunhover !labelhide ext_tooltip
; enables alpha modes
vwmonrepaint !ifeq vwm_alphamode "2" !vwm_winalpharepaint ^@wh^
vwmonnewwindow !ifeq vwm_alphamode "1" !vwm_winalphanew ^@cc^
vwmonmiddlebuttondown !execute [!vwmdesk ^@md^][!labelrefresh ext_tooltip ext_tooltiponwheelup !vwm_winalpha ^@ch^ 8][!labelrefresh ext_tooltip ext_tooltiponwheeldown !vwm_winalpha ^@ch^ -8][!one [hwnd:^@ch^]][!vwm_winalpha ^@ch^ 0][!one xLabel ext_tooltip]
; enables popup on right-click
vwmonrightbuttondown !vwm_popupbuild ^@ch^ "^@cc^" "^@ct^"
vwm_win_ch
vwm_win_cc
vwm_win_ct
vwm_popupa0
vwm_popupa1
vwm_popupa2
vwm_popupb1
vwm_popupb2
vwm_popupb3
vwm_popupb4
vwm_popupc1
vwm_popupc2
vwm_popupd1
vwm_popupd2
vwm_popupd3
*popup "VWM" !new !popupvwm
*popup .icon=.none "Alpha mode" folder
*popup $vwm_popupa0$
*popup $vwm_popupa1$
*popup $vwm_popupa2$
*popup !separator
*popup $vwm_popupc1$
*popup $vwm_popupc2$
*popup $vwm_popupd1$
*popup $vwm_popupd2$
*popup $vwm_popupd3$
*popup .icon=.none "Open specific list" "$txteditor$" "$configdir$vwm_alpha.var$"
*popup .icon=.none "Open exclusion list" "$txteditor$" "$configdir$vwm_alphaex.var$"
*popup ~folder
*popup .icon=.none "Send to clipboard" folder
*popup "Class: $vwm_win_cc$" !labelinfoexport clipboard "$vwm_win_cc$"
*popup "Title: $vwm_win_ct$" !labelinfoexport clipboard "$vwm_win_ct$"
*popup "Handle: $vwm_win_ch$" !labelinfoexport clipboard "$vwm_win_ch$"
*popup ~folder
*popup .icon=.none "Behavior" folder
*popup $vwm_popupb1$
*popup $vwm_popupb2$
*popup $vwm_popupb3$
*popup $vwm_popupb4$
*popup ~folder
*popup !separator
*popup "Gather windows" !vwmgather
*popup ~new
*label ext_tooltip
ext_tooltipstarthidden
ext_tooltipalwaysontop
ext_tooltipnoescapesequence
ext_tooltiptransparencymode .none
ext_tooltipwidth 32
ext_tooltipheight 10
ext_tooltipcurrentwidth $ext_tooltipwidth$
ext_tooltipcurrentheight $ext_tooltipheight$
ext_tooltipautowidthmode left
ext_tooltipautoheightmode top
ext_tooltipfontalign left
ext_tooltipfontvertalign top
ext_tooltipnewlinespace 2
ext_tooltiptopborder 4
ext_tooltipleftborder 4
ext_tooltiponenter !labelhide ext_tooltip
; wwm.mz (v1.1)
;------------------------------------------------------------------------------
*script start !varset P %
*script start !varset vwm_hl 0
; !vwm_winalpha
; - handle
; - alpha offset
;
; modified vars:
; - %{vwm_cc} : current window class
; - %{vwm_cq} : current window class (quoted)
; - %{vwm_ac} : current window's alpha level
*script bang !vwm_winalpha
*script gotoif ("%{\1}" = "0") vwm_winalphaend
*script exec !vwmexec !varset vwm_cq "^@wc(#h %{\1})^"
*script exec !varset vwm_cc %{vwm_cq}
*script gotoif ("%{vwm_cq}" <> "%{vwm_cc}") vwm_winalphaend
*script gotoif ("%{vwm_alphamode}" = "0") vwm_winalpha_sc
*script exec !ifnexist %{vwm_cc} !textappend @$configdir$vwm_alpha.var@ @%{vwm_cc} 254@
*script label vwm_winalpha_sc
*script exec !ifnexist %{vwm_cc} !varset %{vwm_cc} 254
*script exec !varset vwm_ac %{P}{%{vwm_cc}}
*script gotoif ("%{vwm_ac}" = ".none") vwm_winalphaend
*script exec !varadd vwm_ac %{\2}
*script exec !ifeval ("%{vwm_ac}" < "31") !varset vwm_ac 31
*script gotoif ("%{vwm_ac}" >= "255") vwm_winalpharemvar
*script exec !varset %{vwm_cc} %{vwm_ac}
*script exec !wndsetopacity "%{vwm_cc}" %{vwm_ac}
*script exec !vwmexec !vwm_ext_tooltip %{\1} "^@wc(#h %{\1})^" "^@wt(#h %{\1})^"
*script exit
*script label vwm_winalpharemvar
*script exec !wndsetopacity "%{vwm_cc}" 255
*script exec !varremove %{vwm_cc}
*script exec !textdel @$configdir$vwm_alpha.var@ @^%{vwm_cc}@
*script exec !vwmexec !vwm_ext_tooltip %{\1} "^@wc(#h %{\1})^" "^@wt(#h %{\1})^"
*script label vwm_winalphaend
*script ~bang
; !vwm_winalpharepaint
; - handle
;
; modified vars:
; - %{vwm_hl} : last window handle
; - %{vwm_cl} : last window class
; - %{vwm_ac} : current window's alpha level
*script bang !vwm_winalpharepaint
*script gotoif ("%{\1}" = "0") vwm_winalpharepaintend
*script gotoif ("%{\1}" = "%{vwm_hl}") vwm_winalpharepaintend
*script exec !vwmexec !varset vwm_ac ^@wc(#h %{\1})^
*script exec !vwmexec !varset vwm_cl "^@wc(#h %{vwm_hl})^"
*script exec !ifexist %{vwm_ac} '!varset vwm_ac %{P}{%{vwm_ac}}' else '!varset vwm_ac %{vwm_activalpha}'
*script gotoif ("%{vwm_ac}" = ".none") vwm_winalpharepaintend
*script exec !wndsetopacity "%{vwm_cl}" %{vwm_inactivalpha}
*script exec !wndsetopacity %active% %{vwm_ac}
*script exec !varset vwm_hl %{\1}
*script label vwm_winalpharepaintend
*script ~bang
; !vwm_winalphanew
; - class
*script bang !vwm_winalphanew
*script exec !ifexist %{\1} !wndsetopacity %{\1} %{P}{%{\1}}
*script ~bang
; !vwm_ext_tooltip
; - handle
;
; modified vars:
; - %{ext_tooltipx}
; - %{ext_tooltipy}
*script bang !vwm_ext_tooltip
*script gotoif ("%{\1}" = "0") vwm_ext_tooltipend
*script exec !ifexist %{\2} '!varset ext_tooltipx %{P}{%{\2}}' else '!varset ext_tooltipx undefined'
*script exec !ifeq ext_tooltipx ".none" !varset ext_tooltipx disabled
*script exec !varset ext_tooltipy %{ext_tooltipx}
*script exec !varint ext_tooltipy
*script exec !ifneq ext_tooltipy "0" !varset ext_tooltipx %#resolutionx-resolutionx+%{ext_tooltipy}*100/255%#%
*script exec !varset ext_tooltipy %{\2}
*script exec !ifneq \2 "%{ext_tooltipy}" !varremove ext_tooltipx
*script exec !ifexist ext_tooltipx !varset ext_tooltipx "\nalpha: < i> %{ext_tooltipx} </i>"
*script exec !labelsettext ext_tooltip "class: %{\2}\ntitle: %{\3}\nhandle: %{\1}%{ext_tooltipx}"
*script exec !varset ext_tooltipx %{mousex}
*script exec !varset ext_tooltipy %{mousey}
*script exec !ifeval ("%{ext_tooltipx}" > "%#resolutionx/2%#") !varadd ext_tooltipx -%#ext_tooltipcurrentwidth%#
*script exec !ifeval ("%{ext_tooltipy}" > "%#resolutiony/2%#") '!varadd ext_tooltipy -%#ext_tooltipcurrentheight%#' else '!varadd ext_tooltipy 18'
*script exec !labelmove ext_tooltip %{ext_tooltipx} %{ext_tooltipy}
*script exec !labelshow ext_tooltip
*script label vwm_ext_tooltipend
*script ~bang
; !vwm_popupbuild
; - handle
; - class
; - title
;
; modified vars:
; - %{vwm_popupbuild} (removed)
*script bang !vwm_popupbuild
*script exec !vwmaction hover !none
*script exec !setevar vwm_win_ch ""
*script exec !setevar vwm_win_cc "%{\2}"
*script exec !setevar vwm_win_ct "%{\3}"
*script exec !ifneq \1 "0" !setevar vwm_win_ch %{\1}
*script exec !labelhide ext_tooltip
*script gotoif ("%{vwm_alphamode}" = "0") vwm_popupa0
*script gotoif ("%{vwm_alphamode}" = "1") vwm_popupa1
*script exec !setevar vwm_popupa0 '" Disabled" !varset vwm_alphamode 0'
*script exec !setevar vwm_popupa1 '" On new window" !varset vwm_alphamode 1'
*script exec !setevar vwm_popupa2 '"> Alpha toggle (%#resolutionx-resolutionx+%{vwm_inactivalpha}*100/255%#% - %#resolutionx-resolutionx+%{vwm_activalpha}*100/255%#%)" !none'
*script goto vwm_popupaend
*script label vwm_popupa0
*script exec !setevar vwm_popupa0 '"> Disabled" !none'
*script exec !setevar vwm_popupa1 '" On new window" !varset vwm_alphamode 1'
*script exec !setevar vwm_popupa2 '" Alpha toggle (%#resolutionx-resolutionx+%{vwm_inactivalpha}*100/255%#% - %#resolutionx-resolutionx+%{vwm_activalpha}*100/255%#%)" !varset vwm_alphamode 2'
*script goto vwm_popupaend
*script label vwm_popupa1
*script exec !setevar vwm_popupa0 '" Disabled" !varset vwm_alphamode 0'
*script exec !setevar vwm_popupa1 '"> On new window" !none'
*script exec !setevar vwm_popupa2 '" Alpha toggle (%#resolutionx-resolutionx+%{vwm_inactivalpha}*100/255%#% - %#resolutionx-resolutionx+%{vwm_activalpha}*100/255%#%)" !varset vwm_alphamode 2'
*script label vwm_popupaend
*script exec !ifexist vwmhidetaskonswitch '!execute [!setevar vwm_popupb1 "!execute [!varremove vwmhidetaskonswitch][!textdel @$configdir$vwm.var@ @^vwmhidetaskonswitch@][!vwmtogglehidetask off]"][!varset vwm_popupbuild >]' else '!execute [!setevar vwm_popupb1 "!execute [!varset vwmhidetaskonswitch true][!textappend @$configdir$vwm.var@ @vwmhidetaskonswitch@][!vwmtogglehidetask on]"][!varset vwm_popupbuild " "]'
*script exec !setevar vwm_popupb1 '"%{vwm_popupbuild} Hide tasks on switch" %#vwm_popupb1%#'
*script exec !ifexist vwmswitchonanyfocus '!execute [!setevar vwm_popupb2 "!execute [!varremove vwmswitchonanyfocus][!textdel @$configdir$vwm.var@ @^vwmswitchonanyfocus@][!vwmtoggle switchonanyfocus off]"][!varset vwm_popupbuild >]' else '!execute [!setevar vwm_popupb2 "!execute [!varset vwmswitchonanyfocus true][!textappend @$configdir$vwm.var@ @vwmswitchonanyfocus@][!vwmtoggle switchonanyfocus on]"][!varset vwm_popupbuild " "]'
*script exec !setevar vwm_popupb2 '"%{vwm_popupbuild} Switch on focus" %#vwm_popupb2%#'
*script exec !ifexist vwmnowrap '!execute [!setevar vwm_popupb3 "!execute [!varremove vwmnowrap][!textdel @$configdir$vwm.var@ @^vwmnowrap@][!vwmtoggle nowrap off]"][!varset vwm_popupbuild >]' else '!execute [!setevar vwm_popupb3 "!execute [!varset vwmnowrap true][!textappend @$configdir$vwm.var@ @vwmnowrap@][!vwmtoggle nowrap on]"][!varset vwm_popupbuild " "]'
*script exec !setevar vwm_popupb3 '"%{vwm_popupbuild} No wrap" %#vwm_popupb3%#'
*script exec !ifexist vwmsnapwindowondrag '!execute [!setevar vwm_popupb4 "!execute [!varremove vwmsnapwindowondrag][!textdel @$configdir$vwm.var@ @^vwmsnapwindowondrag@][!vwmtoggle snapwindowondrag off]"][!varset vwm_popupbuild >]' else '!execute [!setevar vwm_popupb4 "!execute [!varset vwmsnapwindowondrag true][!textappend @$configdir$vwm.var@ @vwmsnapwindowondrag@][!vwmtoggle snapwindowondrag on]"][!varset vwm_popupbuild " "]'
*script exec !setevar vwm_popupb4 '"%{vwm_popupbuild} Snap windows on drag" %#vwm_popupb4%#'
*script exec !setevar vwm_popupc1 ""
*script exec !setevar vwm_popupc2 ""
*script exec !setevar vwm_popupd1 ""
*script exec !setevar vwm_popupd2 ""
*script exec !setevar vwm_popupd3 ""
*script gotoif ("%{\1}" = "0") vwm_popupdend
*script exec !setevar vwm_popupc2 !separator
*script exec !ifexist %{\2} !varset vwm_popupbuild %{P}{%{\2}}
*script gotoif ("%{vwm_popupbuild}" ".none") vwm_popupc1
*script exec !setevar vwm_popupc1 '"Remove %{\2} from exclusion list" !execute [!textdel @$configdir$vwm_alphaex.var@ @^%{\2} .none@][!varremove %{\2}]'
*script goto vwm_popupdend
*script label vwm_popupc1
*script exec !setevar vwm_popupc1 '"Add %{\2} to exclusion list" !execute [!textdel @$configdir$vwm_alpha.var@ @^%{\2} @][!textappend @$configdir$vwm_alphaex.var@ @%{\2} .none@][!varset %{\2} .none]
*script label vwm_popupcend
*script exec !varint vwm_popupbuild
*script gotoif ("%{vwm_popupbuild}" = "0") vwm_popupdend
*script gotoif ("%{vwm_alphamode}" <> "2") vwm_popupdend
*script exec !setevar vwm_popupd1 '"Set active alpha level to %#resolutionx-resolutionx+%{vwm_popupbuild}*100/255%#%" !execute [!varset vwm_activalpha %{vwm_popupbuild}][!textdel @$configdir$vwm_alpha.var@ @^%{\2} @][!varremove %{\2}]'
*script exec !setevar vwm_popupd2 '"Set inactive alpha level to %#resolutionx-resolutionx+%{vwm_popupbuild}*100/255%#%" !execute [!varset vwm_inactivalpha %{vwm_popupbuild}][!textdel @$configdir$vwm_alpha.var@ @^%{\2} @][!varremove %{\2}]'
*script exec !setevar vwm_popupd3 !separator
*script label vwm_popupdend
*script exec !varremove vwm_popupbuild
*script exec !netreloadmodule $PopupID$
*script exec !popupvwm
*script exec !vwmaction hover !vwm_ext_tooltip ^@ch^ "^@cc^" "^@ct^"
*script ~bang
; vwm.var
;------------------------------------------------------------------------------
vwm_activalpha 230
vwm_inactivalpha 55
vwm_alphamode 0
; vwm_alpha.var
;------------------------------------------------------------------------------
; This file contain the classes of windows
; which have a specific alpha level
; vwm_alphaex.var
;------------------------------------------------------------------------------
; This file contain the classes of windows that
; should not be affected by alpha managing
#32770 .none
WinRarWindow .none
SciTEWindow .none
MediaPlayerClassicW .none