-
Notifications
You must be signed in to change notification settings - Fork 512
Expressions
Expressions are used in various operations and configs and allow you to specify values that can chaged based on current dimensions of the screen and window that an operation is being applied to.
Expressions are literally mathematical expressions containing variables that will be evaluated on the fly. Here is a list of allowed variables:
-
screenOriginX
- target screen's top left x coordinate (should not be used in Window Hints configs) -
screenOriginY
- target screen's top left y coordinate (should not be used in Window Hints configs) -
screenSizeX
- target screen's width -
screenSizeY
- target screen's height -
windowTopLeftX
- window's current top left x coordinate (should not be used in Window Hints configs) -
windowTopLeftY
- window's current top left y coordinate (should not be used in Window Hints configs) -
windowSizeX
- window's width -
windowSizeY
- window's height -
newWindowSizeX
- window's new width (after resize, only usable intopLeftX
andtopLeftY
, should not be used in configs) -
newWindowSizeY
- window's new height (after resize, only usable intopLeftX
andtopLeftY
, should not be used in configs) -
windowHintsWidth
- the value of the windowHintsWidth config (only usable inwindowHintsTopLeftX
andwindowHintsTopLeftY
) -
windowHintsHeight
- the value of the windowHintsHeight config (only usable inwindowHintsTopLeftX
andwindowHintsTopLeftY
)
Here are the list of functions and operators that can be used in Expressions:
+ e.g. 1+1 = 2
- e.g. 1-1 = 0
* e.g. 2*2 = 4
/ e.g. 4/2 = 2
** e.g. 3**2 = 9
sum e.g. sum({1,2,3}) = 6
count e.g. count({4,5,6}) = 3
min e.g. min({1,3,5}) = 1
max e.g. max({1,3,5}) = 5
average e.g. average({1,2,3,4}) = 2.5
median e.g. median({1,2,3,10,15}) = 3
stddev e.g. stddev({1,2,3,4,5}) = 1.4142135623730951
sqrt e.g. sqrt(9) = 3.0
log e.g. log(100) = 2.0
ln e.g. ln(8) = 2.0794415416798357
exp e.g. exp(2) = 7.3890560989306504 (this is "e**parameter")
floor e.g. floor(1.9) = 1.0
ceiling e.g. ceiling(1.1) = 2.0
abs e.g. abs(-1) = 1
trunc e.g. trunc(1.1123123123) = 1.0
random e.g. random() = 0.20607629744336009 (random float between 0 and 1)
randomn e.g. randomn(10) = 4 (random integer between 0 and parameter-1)
Note: Spaces are not allowed in Expressions!
This will be the x midpoint on the current screen.
This will be half the difference between the current screen's width and current window's width
This will be the the x midpoint on the current screen if half the current screen's width is less than the current window's width. Otherwise, if the current window's width is less than half the current screen's width, this will be the x point on the current screen that is the window's width in pixels away from the left side of the screen.