maiself / gnome-shell-extension-invert-color Goto Github PK
View Code? Open in Web Editor NEWGNOME Shell extension for inverting the color of windows
License: MIT License
GNOME Shell extension for inverting the color of windows
License: MIT License
had to manually git clone and install using:
mkdir -p "$HOME/.local/share/gnome-shell/extensions/invert-window@maiself"
cd /tmp
git clone https://github.com/maiself/gnome-shell-extension-invert-color.git
cd /tmp/gnome-shell-extension-invert-color
cp convenience.js extension.js metadata.json schemas/ "$HOME/.local/share/gnome-shell/extensions/invert-window@maiself" -r
enable invert window from gnome-tweak tool and restart gnome-shell (alt+f2 r )
The sidebar scrolling menu disappears in full screen mode under inversion. It shows what ever is behind it. It seems to target specific apps like firefox but not gnome-terminal. currently using GNOME Shell 3.32.2. issue seems to be in GNOME Shell 3.30.x as well.
Firefox 69 dev version Inverted windowed mode
Firefox 69 dev version Inverted Full screen mode. you can see that the sidebar scrolling menu is non-existent and shows what is in the background instead. issue exists on Firefox 69- as well.
same window uninverted
Gnome-shell Inverted. No sidebar scrolling menu rendering issue.
Loving this extension, really useful whenever something is way too bright at night. Unfortunately it stopped working with 3.36. All it does is make the window invisible. It otherwise works correctly, the window can be made visible by pressing the shortcuts again. The extension does not log any errors either.
Side note: I tried the fix proposed in #1 and it does not help either, so it probably is some broken API that changed in the shell...
Hi! I feel like I'm going blind without the ability invert windows :-O
I just upgraded to Ubuntu 21.10 - which uses GNOME 40.4.0 (with Wayland). The Invert Window Color extension (version 7) is listed as "The extension is incompatible with the current GNOME version".
Could you please add color effect like gnome, as can be seen in the accessibility settings:
Also, please consider options for LIGHT and DARK colors
There's a software for windows called negativescreen, which has a smart mode that can invert black and white colors keeping other colors intact. i.e., invert only white and black, that'd be cool as well
Please see
http://arcanesanctum.net/negativescreen/
All in all, invert color extension is really useful for me, as Linux Admin and as a Reader. Thank you I don't need to use xcalib (which is not supported in wayland) :-)
super+c is a easier to do with just one hand
Wouldnt it be nice to be able to choose a different shortcut?
Hi there,
I'm BM, a very nice and polite guy.
Feature request: xfce4 compatible version. Cannot find a way to inverse colors in xfce4.
I'm not sure why, but it seems to not work when an app like zathura
is in full screen (F11), but it does work for full-screen mode for say Google Chrome.
Any tips? Is this fixable in the extension?
The issue is that windows get render chopped and sometimes don't render at all the left area of overview mode. windows also sometimes don't render in the right area of the overview mode where different virtual workspaces are rendered. over all there is incompatibility between this extension and the overview mode.
I was able to isolate the issue to the call actor.add_effect_with_name('invert-color', effect);
and even tried calling it with an effect object that doesn't do anything but still faced the same issue. I experimented a bit and found that the size of the window determines whether it is going to be chopped or not and that the window doesn't render in the small overview box to the right if the virtual workspace is focused and it is the only window in that virtual workspace. my assumption is that there is an incompatibility the add_effect method that the extension uses and how overview renders these windows.
are there any alternatives to the overview mode for gnome? any solutions to this issue? I will look into gnome-shells implementation for the overview mode for inspirations.
I am using ubuntu 18.04 latest version, gnome shell 3.28.3.
After locking the screen (super+L) and unlocking, the inverted window becomes normal.
How to reproduce:
please let unlock keep the invert on.
Dear Maiself,
I'd like to ask you whether there is a possibility to make your code do the inversion by inverting the brightness of the colors instead of the RGB values? This way we'd get a smart conversion that keeps the colors and invert only the whites and blacks.
Would it be too CPU intesive? Would it be possible at all to do that as an extension?
If I'm not mistaken, then the heavy RGB -> HSL -> modification -> RGB conversion could be reduced easily by rotating the RGB values in HSL format by 180 degrees without converting them to HSL.
Thanks.
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?
Using below environment, using the Invert Window Color extension does not actually invert colors. I've also tried using xcalib -i -a but this also does not work, making me suspect that the issue is related to my graphics cards+driver+x11.
How would I go about root causing this as it's causing me to find using a linux OS highly irritating, and straining on my eyes.
Installed in Firefox:
https://addons.mozilla.org/en-US/firefox/addon/gnome-shell-integration/
Installed via website and displayed in Tweaks GUI in the "On" position:
https://extensions.gnome.org/extension/1041/invert-window-color/
lsb_release -rd
Description: Ubuntu 20.04.3 LTS
Release: 20.04
apt-cache policy gnome-shell-extensions
gnome-shell-extensions:
Installed: 3.36.1-1
Candidate: 3.36.1-1
Version table:
*** 3.36.1-1 500
500 http://us.archive.ubuntu.com/ubuntu focal/universe amd64 Packages
500 http://us.archive.ubuntu.com/ubuntu focal/universe i386 Packages
100 /var/lib/dpkg/status
apt-cache policy gnome-tweak-tool
gnome-tweak-tool:
Installed: 3.34.0-2ubuntu1
Candidate: 3.34.0-2ubuntu1
Version table:
*** 3.34.0-2ubuntu1 500
500 http://us.archive.ubuntu.com/ubuntu focal/universe amd64 Packages
500 http://us.archive.ubuntu.com/ubuntu focal/universe i386 Packages
100 /var/lib/dpkg/status
apt-cache policy chrome-gnome-shell
chrome-gnome-shell:
Installed: 10.1-5
Candidate: 10.1-5
Version table:
*** 10.1-5 500
500 http://us.archive.ubuntu.com/ubuntu focal/universe amd64 Packages
500 http://us.archive.ubuntu.com/ubuntu focal/universe i386 Packages
100 /var/lib/dpkg/status
apt-cache policy xcalib
xcalib:
Installed: 0.8.dfsg1-2.1
Candidate: 0.8.dfsg1-2.1
Version table:
*** 0.8.dfsg1-2.1 500
500 http://us.archive.ubuntu.com/ubuntu focal/universe amd64 Packages
100 /var/lib/dpkg/status
apt-cache policy nvidia-driver-460
nvidia-driver-460:
Installed: 460.91.03-0ubuntu0.20.04.1
Candidate: 460.91.03-0ubuntu0.20.04.1
Version table:
*** 460.91.03-0ubuntu0.20.04.1 500
500 http://us.archive.ubuntu.com/ubuntu focal-updates/restricted amd64 Packages
500 http://us.archive.ubuntu.com/ubuntu focal-security/restricted amd64 Packages
100 /var/lib/dpkg/status
uname -a
Linux apc 5.11.0-34-generic #36~20.04.1-Ubuntu SMP Fri Aug 27 08:06:32 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
sudo lshw -c video
[sudo] password for moniker:
*-display
description: VGA compatible controller
product: UHD Graphics 620
vendor: Intel Corporation
physical id: 2
bus info: pci@0000:00:02.0
version: 07
width: 64 bits
clock: 33MHz
capabilities: pciexpress msi pm vga_controller bus_master cap_list rom
configuration: driver=i915 latency=0
resources: irq:157 memory:db000000-dbffffff memory:60000000-7fffffff ioport:e000(size=64) memory:c0000-dffff
*-display
description: 3D controller
product: GP108GLM [Quadro P500 Mobile]
vendor: NVIDIA Corporation
physical id: 0
bus info: pci@0000:02:00.0
version: a1
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress bus_master cap_list
configuration: driver=nvidia latency=0
resources: irq:168 memory:dc000000-dcffffff memory:80000000-8fffffff memory:90000000-91ffffff ioport:d000(size=128)
This application is working well, but I would rather <Super>n
. <Super>i
is terribly inconvenient on the dvorak keyboard when the <Super>
key is under the left hand. I don't see any way to configure it using gnome tweak tool nor gnome standard settings. I'm new to gnome, though, so perhaps I'm missing it.
It would be nice to have an option for inverting only window contents without decorations, it would make sense for people (like me) who use themes like Adwaita-Dark.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.