-
Notifications
You must be signed in to change notification settings - Fork 602
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[REQUEST] Ability to use variables in calc functions. #1258
Comments
This not possible in the current implementation and would require significant effort (I think ) to get implemented right. |
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. |
It does and I understand. |
Environment variables have to be used for now as global variables don't work with `calc` in Rofi. davatorium/rofi#1258
Before creating a feature request
I checked the next branch to see if the feature has already been
implemented
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
The text was updated successfully, but these errors were encountered: