maiself / gnome-shell-extension-invert-color

GNOME Shell extension for inverting the color of windows
MIT License
43 stars 24 forks source link

How to run in script? #12

Open Fabian42 opened 5 years ago

Fabian42 commented 5 years ago

I want to put that what this extension does into a short script, for running some programs always in inverted mode. But I can't figure out how to launch this effect in any other way than manually pressing Win+I. Not even letting xdotool press Win+I works. If I try to execute ~/.local/share/cinnamon/extensions/rnbdsh@negateWindow/extension.js with programs like js, nodejs etc., I get:

/home/fabian/.local/share/cinnamon/extensions/rnbdsh@negateWindow/extension.js:53
                let meta_window = actor.get_meta_window();
                ^^^

SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:373:25)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Function.Module.runMain (module.js:441:10)
    at startup (node.js:140:18)
    at node.js:1043:3

And I doubt that this works anyway, because it would probably not jump to the inverting method. Googling how to invert windows any other way either tells me to use "compton", which doesn't play well with my system ("Another composite manager is already running") or even claims that it's impossible (which it clearly isn't, as this extension proves).

So what should I do instead to get this extension's action running in a script?

asdf23 commented 2 years ago

me too