Skip to content
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

add new state syntax #44

Closed
wants to merge 1 commit into from
Closed

add new state syntax #44

wants to merge 1 commit into from

Conversation

tsl0922
Copy link
Owner

@tsl0922 tsl0922 commented Jan 26, 2024

Syntax:

#@state=<expr> is an improved version of #@prop:check to extend support for other state like disabled.

<expr> can be:

#@prop:check is still suppored (but deprecated, and will be removed soon).

Usage

_           ignore                                 #menu: Disabled #@state=disabled
_           ignore                                 #menu: Checked #@state=checked

Ctrl+s      stop                                   #menu: Stop #@state=${?playlist-playing-pos==-1:disabled}
m           cycle mute                             #menu: Mute #@state=${?mute==yes:checked}

@zhongfly
Copy link

zhongfly commented Jan 26, 2024

I prefer the expr syntax of Conditional auto profiles
You can use some codes in https://github.com/mpv-player/mpv/blob/master/player/lua/auto_profiles.lua

I don't think the syntax of Property Expansion is appropriate, especially when writing compound conditions, e.g. it's difficult to express "and" and "or".

@tsl0922
Copy link
Owner Author

tsl0922 commented Jan 28, 2024

#46

@tsl0922 tsl0922 closed this Jan 28, 2024
@tsl0922 tsl0922 deleted the state branch January 29, 2024 02:47
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