From the description in the man page, I thought I could use State to toggle the titles, and I’m pretty sure I have seen other configs where this was done. However, when I tried to use State, it appeared to have no effect.
Basically, this is what I was trying to do:
The logic:
Call ToggleTitle from a menu that is opened on right-click of a window.
ToggleTitle would set a default action of turning off the title unless the state 1 is set to true, then it must set the action to turning the title back on. Then ToggleTitle would do whatever the action was set as.
The code:
DestroyFunc ToggleTitle
AddToFunc ToggleTitle
+ I SetEnv Action TitleOff
+ I Test (State 1) SetEnv Action TitleOn
+ I $[Action]
DestroyFunc TitleOn
AddToFunc TitleOn
+ I Echo "In TitleOn"
+ I WindowStyle !NoTitle
+ I State 1 False
DestroyFunc TitleOff
AddToFunc TitleOff
+ I Echo "In TitleOff"
+ I WindowStyle NoTitle
+ I State 1 True
The problem:
The state is not actually being set, and TitleOn is never being called. Anybody know why this isn’t working?
[Note: Just before submitting, I did give Taviso’s ToggleTitle function a shot, and it sort of worked, but I’d still like to know why mine does not.]