Add kwinscript subcommand for running arbitrary KWin JavaScript#58
Open
marvin1099 wants to merge 1 commit into
Open
Add kwinscript subcommand for running arbitrary KWin JavaScript#58marvin1099 wants to merge 1 commit into
marvin1099 wants to merge 1 commit into
Conversation
Supports --file <path> and --inline <code> (mutually exclusive) to run raw KWin JS directly, with full access to the script helper functions (output_result, output_error, etc.) and D-Bus callback mechanism. The user's script body is wrapped in a try-catch inside the generated run() function so that any JavaScript error is reported via output_error instead of producing a cryptic D-Bus 'No such object path' error.
597db9d to
d597f68
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds the kwinscript sub-command for custom kde control
Would add request #31
AI was used here, i did checking and testing myself, it is working, and looks correct in my eyes.
Would this be acceptable?
Here are some examples of what can be done with this:
Set opacity (0.0 - 1.0)
kdotool kwinscript --inline 'var w=workspace.activeWindow;if(w){w.opacity=0.5;output_result("50% opacity");}'
Get all the window stats you ever (not), wanted
Create file window_stats.js at preferred location with contents:
then run:
kdotool kwinscript --file window_stats.js
To get all the stats.