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

[Feature Request] Commandline API #212

Closed
R15H opened this issue Apr 19, 2024 · 6 comments
Closed

[Feature Request] Commandline API #212

R15H opened this issue Apr 19, 2024 · 6 comments

Comments

@R15H
Copy link

R15H commented Apr 19, 2024

Just found this awesome app! Thank you! I haven't seen any tool like this, and this is even cross platform!

How hard would I be to have a headless version of nyrna?
It could be something as simple as nyrna.exe freeze PID or nyrna.exe resume PID?

@Merrit
Copy link
Owner

Merrit commented Apr 19, 2024

❯ flatpak run codes.merritt.Nyrna --help
Nyrna - Suspend games and applications.


Run Nyrna without any arguments to launch the GUI.

Supported arguments:

    --[no-]minimize    Used with the `toggle` flag, `no-minimize` instructs
                       Nyrna not to automatically minimize / restore the active
                       window - it will be suspended / resumed only.
                       (defaults to on)
-t, --toggle           Toggle the suspend / resume state for the active window.
                       ❗Please note this will immediately suspend the active
                       window, and is intended to be used with a hotkey - be
                       sure not to run this from a terminal and accidentally
                       suspend your terminal! ❗
-v, --verbose          Output verbose logs for troubleshooting and debugging.

Looks like I need to document this somewhere other than in the program! Do these cli interfaces work for your usecase?

@R15H
Copy link
Author

R15H commented Apr 20, 2024

Yes, it would. Is this implemented in the windows version? I tried it and it simply ignores any arguments.

@Merrit
Copy link
Owner

Merrit commented Apr 20, 2024

It is in the Windows version yes, though you can't see the help text like I showed there because Windows doesn't show CLI output.

Did you try --toggle?

PS C:\Users\Merritt\Downloads\Nyrna-Windows-Portable> sleep 5 && .\nyrna.exe --toggle

I ran this, switched to Notepad, and after the 5 second delay it suspended it. Ran again and Notepad resumed.

Can also be set as a custom shortcut with a hotkey. Though I am curious, does something about Nyrna's built-in hotkey not work for you that you'd prefer a CLI interface?

@R15H
Copy link
Author

R15H commented Apr 20, 2024

Indeed it works! Thank you!

Nothing wrong with the hotkey feature. I'm building a set of abstractions over my desktop enviroment. I want to have all apps, no matter how heavy, always open and then automatically hide them according to the task I'm focusing on. So I will be using this as dependency rather than directly. I will be sure to reference this repo in the Info page. :) Again Merrit, thank you.

@Merrit
Copy link
Owner

Merrit commented Apr 20, 2024

Glad to hear it is working for you! 🎉

Enjoy 😁

@Merrit Merrit closed this as completed Apr 20, 2024
Merrit added a commit that referenced this issue Apr 26, 2024
@Merrit
Copy link
Owner

Merrit commented Apr 26, 2024

I rebuilt the Nyrna website with better docs, and documented this here:

https://nyrna.merritt.codes/docs/hotkey#cli

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

No branches or pull requests

2 participants