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

Feed command a variable? #140

Open
dannydav709 opened this issue Mar 8, 2022 · 1 comment
Open

Feed command a variable? #140

dannydav709 opened this issue Mar 8, 2022 · 1 comment
Labels

Comments

@dannydav709
Copy link

I am wondering if it is possible to give the "c: ...." command a variable instead of a number. I would like to set the value of the variable to be a number based on the current resolution of the screen, since my computer is used in different scenarios with different monitors.

@BlueM BlueM added the question label Mar 10, 2022
@BlueM
Copy link
Owner

BlueM commented Mar 10, 2022

The command you pass to cliclick is a string. By inserting a variable into that string, you can effectively use a variable. How to do that depends on the programming language used. For instance, in a Bash script, code such as this could be used:

width=$(system_profiler SPDisplaysDataType | fgrep Resolution | awk '{print $2}')
cliclick m:$width,200

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants