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

Gnome / Ubuntu / Unity / Compiz filter or Xcalib? #5

Open
log69 opened this issue Nov 23, 2018 · 13 comments
Open

Gnome / Ubuntu / Unity / Compiz filter or Xcalib? #5

log69 opened this issue Nov 23, 2018 · 13 comments
Labels

Comments

@log69
Copy link

log69 commented Nov 23, 2018

Dear Vasilii, have you tried to apply the compiz filter solution to the Unity window manager of Ubuntu? I'd appreciate any help on this. I'm on Ubuntu 18 and would like to get it working with unity as a last resort.

Haven't you thought about changing the source code of Xcalib? It's a single C file and all we would need is an RGB shift method that does the 180 degree turn in HUE that should be easy enough.

Thanks for the collection of info.

@vn971
Copy link
Owner

vn971 commented Nov 23, 2018

Hi. Regarding xcalib. Unfortunately, it deals with each color separately -- an approach that can only lead to RGB inversion, but not anything smarter. See this section on alternatives: https://github.com/vn971/linux-color-inversion#alternatives-future-work

Regarding Unity. Maybe you can just use compton with it? I haven't tried to be honest (XFCE user here), but I think it could work? If you'll try to install&use compton, please tell me how it goes!

@vn971 vn971 added the question label Nov 23, 2018
@log69
Copy link
Author

log69 commented Nov 23, 2018

Digging into the the topic:

  • tried compton, no success
  • cannot replace unity with compiz
  • investigated the xcalib source and as you said it, smart inversion cannot be achieved by that
  • checked a gnome shell extension ( https://github.com/maiself/gnome-shell-extension-invert-color/ ) but I still can't see much chance here as well to make the plain inversion to smart, I've written to the author though asking this question
  • now checking this Firefox addon which does smart inversion, works flawlessly: https://addons.mozilla.org/en-US/firefox/addon/nightreader/ - it was a luck that I found it, it doesn't appear in the list when search for the invert keyword, but it does bring it up when I search for "hue"

Will let you know when progress farther.

@vn971
Copy link
Owner

vn971 commented Nov 23, 2018

@log69 thanks, that's very interesting. I actually knew about the firefox add-on -- just don't use it personally. I think it makes all the sense to add it to the main description -- thanks a lot for bringing this up!

@log69
Copy link
Author

log69 commented Nov 23, 2018

Yeah, the addon is good and a viable solution because the CSS engine can do hue manipulations by default. Well, keep up the good work.

@log69
Copy link
Author

log69 commented Nov 23, 2018

Just found a complete solution for desktops using the Gnome shell. Using the shell extension above and patching its code makes it work perfectly. Steps:

  1. download Gnome shell extension from here:
    https://github.com/maiself/gnome-shell-extension-invert-color/
  2. unzip it into:
    ~/.local/share/gnome-shell/extensions/invert-window@maiself
  3. patch the extension.js file the way written here and save it:
    Colors Effects and Brightness / Contrast settings maiself/gnome-shell-extension-invert-color#1 (comment)
  4. reload Gnome shell by hittin Alt+F2 and typing "r" + enter
  5. install gnome-tweak-tool (unity-tweak-tool)
  6. enable this extension on its Extensions panel tossing it to "on"
  7. hit Ctrl+I key on a window that will go smart invert
  8. Enjoy -> thank you for all the guys on the links above!

@log69 log69 closed this as completed Nov 23, 2018
@log69
Copy link
Author

log69 commented Nov 23, 2018

Updated the patch, see here:

maiself/gnome-shell-extension-invert-color#1 (comment)

@vn971
Copy link
Owner

vn971 commented Dec 6, 2018

@log69 I wonder if it makes sense to move said instruction to a separate paragraph in this repo or any others(?). If you'd be willing to provide a PR, I'd certainly merge it.

@vn971
Copy link
Owner

vn971 commented Dec 6, 2018

Maybe the correct way would be to fork "gnome-shell-extension-invert-color", make necessary changes, add "RGB shift" version and advertise the fork from this repo. You know what', I'll re-raise the issue.

@vn971 vn971 reopened this Dec 6, 2018
@vn971 vn971 changed the title Ubuntu / Unity / Compiz filter or Xcalib? Gnome / Ubuntu / Unity / Compiz filter or Xcalib? Dec 6, 2018
@JackKenney
Copy link

Is there a way that works for xrandr?
It was designed to be really portable between monitor/graphics cards/etc.

This wrapper does the standard single channel inversion, https://github.com/zoltanp/xrandr-invert-colors, but I'm looking for a way to preserve hue that will work for my computer like this does.

I'm on an Ubuntu 18.04 system with X11.

When I try to use this, I get a "Another composite manager is already running" error.
If I kill the existing composite manager my display stops being functional and I have to restart.

@vn971
Copy link
Owner

vn971 commented Feb 2, 2020

Hi @JackKenney. xrandr, or anything channel-independent, absolutely cannot work like the advanced approaches "RGB shift" and "matrices". This is partly covered in the bottom section, maybe you'll find it useful(?) https://github.com/vn971/linux-color-inversion#alternatives-future-work

If you want to run picom (former known as "compton"), you may indeed need to kill the old composite manager first. The thing that you describe as "not functional" maybe be the view without any compositor at all. If you cannot operate from this state at all, maybe you can chain the commands together, e.g.

pkill old_compositor; compton --backend glx --glx-fshader-win "$(cat shift_whiteish.glsl)" --invert-color-include id!=0

@JackKenney
Copy link

JackKenney commented Feb 2, 2020

Hi @JackKenney. xrandr, or anything channel-independent, absolutely cannot work like the advanced approaches "RGB shift" and "matrices". This is partly covered in the bottom section, maybe you'll find it useful(?) https://github.com/vn971/linux-color-inversion#alternatives-future-work

If you want to run picom (former known as "compton"), you may indeed need to kill the old composite manager first. The thing that you describe as "not functional" maybe be the view without any compositor at all. If you cannot operate from this state at all, maybe you can chain the commands together, e.g.

pkill old_compositor; compton --backend glx --glx-fshader-win "$(cat shift_whiteish.glsl)" --invert-color-include id!=0

Thanks for your response :)

Unfortunately, in Ubuntu/ElementaryOS the the compositor is only part of mutter so killing mutter or gala messes up the window management and changes the color shading successfully but makes the windows unusable.

I've been unable to find a way to have mutter execute the GLSL files so far.

@vn971
Copy link
Owner

vn971 commented Feb 2, 2020

For XFCE specifically I know xfwm expressed interest in glsl support (or color inversion specifically), I think they might be willing to help writing this feature as well. For ElementaryOS, no information.

@JackKenney
Copy link

JackKenney commented Oct 13, 2020

Maybe the correct way would be to fork "gnome-shell-extension-invert-color", make necessary changes, add "RGB shift" version and advertise the fork from this repo. You know what', I'll re-raise the issue.

I ended up doing this here:
https://extensions.gnome.org/extension/3530/true-color-invert/

So I figured I would send it back this way in case anyone is looking for this. Works on Ubuntu 18.04 and 20.04 so far without bugs. GitHub fork here:
https://github.com/JackKenney/gnome-true-color-invert
If anyone runs into a problem with it, feel free to create an issue there.

Cited this in the extension.js, thanks for doing the hard work @vn971 !

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

3 participants