Open ShadowKing345 opened 3 years ago
This not possible in the current implementation and would require significant effort (I think ) to get implemented right. Currently a variable replaces the full 'right hand side' of the assignment, and cannot be partial.
I understand. I will keep this in mind for now and find alternative methods of reducing redundancy. I am not sure if I should close this request or just leave it in case one day it will be completed.
Lets leave it open.
What is supported atm is environment variables, those can be mixed at any point. (it is handled in the tokonizer)
So I can specify a environment variable and it can be used in a calc function without issue. Lovely. I will look through the docks to see how they are done then do some prototyping. Thank you.
Never tested this, but I think it should work. I would like to add some more flexibility to the parser (like implementing this feature request) but I do not have the time atm. (I first want to get rid of the multiple older configuration options and 'backwards' compatibility.)
It does and I understand.
Before creating a feature request
[x] I checked the next branch to see if the feature has already been implemented
[X] I searched existing reports to see if it is already requested.
What is the user problem or growth opportunity you want to see solved?
When creating a theme, you cannot pass user defined variables to the calc function. Being allowed to use user defined variables to calculate would be nice to have.
How do you know that this problem exists today? Why is this important?
When you attempt to pass a variable and open rofi, the error "syntax error, unexpected Reference, expected Integer number or Floating-point number or "Parent left ('(')" ".
Example code
Who will benefit from it?
In theory, anyone who uses themes and variables to dynamically change the way output looks.
Version
Output of
rofi -v
" Version: 1.6.1 "Configuration
https://gist.github.com/ShadowKing345/b1b6f0d26edf8bd8e0828035504027d9
Additional details: I am trying to create a dmenu options script that i want to dynamically changes the padding based on the number of elements provided. While i have managed to get the basic padding working for 5 elements i don't want to create a copy of the theme and alter the variables for 2 or n number of elements.
Gist of theme file for power options. https://gist.github.com/ShadowKing345/f939c19bedefb55db4e6a1e24fa0e13f