Skip to content

Add _toggle command#16

Open
rtxa wants to merge 3 commits intoLevShisterov:masterfrom
rtxa:add-toggle-cvar-cmd
Open

Add _toggle command#16
rtxa wants to merge 3 commits intoLevShisterov:masterfrom
rtxa:add-toggle-cvar-cmd

Conversation

@rtxa
Copy link
Contributor

@rtxa rtxa commented Feb 11, 2019

Info

  • This command switches the values ​​of cvar. It takes the current value of the cvar and switch to the next one. To avoid the switch don't go in to a circle, the last value must be repeated twice.

Syntax

  • Case 1
    If only the cvar is specified, then switches between 1 and 0.
    _toggle <cvar>
  • Case 2
    You can also specify two or more values to switch.
    _toggle <cvar> <val1> <val2> ... [valN]

Examples

_toggle r_drawviewmodel If current value is 1, then switches to 0.
_toggle volume 0.0 0.25 0.5 0.75 1.0 1.0 If volume gets to 1.0, it will not move from there.
_toggle name "Kit fisto" "Neo" "willy wonka" If my current name is 'willy wonka', then it will switch to 'Kit fisto'.

Credits

The feature was taken from rofi's client.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants