Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: maiself/gnome-shell-extension-invert-color
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: tutacat/gnome-invert-color-updates
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Can’t automatically merge. Don’t worry, you can still create the pull request.

Commits on Sep 8, 2020

  1. true color invert commit

    Jack Kenney committed Sep 8, 2020
    Copy the full SHA
    32025de View commit details

Commits on Sep 14, 2020

  1. Create README.md

    JackKenney authored Sep 14, 2020
    Copy the full SHA
    31aae30 View commit details

Commits on Jul 5, 2021

  1. Create README.md

    JackKenney committed Jul 5, 2021
    Copy the full SHA
    05f7e4a View commit details
  2. update for gnome 40

    JackKenney committed Jul 5, 2021
    Copy the full SHA
    e999859 View commit details
  3. add gnome 3.32 support

    JackKenney committed Jul 5, 2021
    Copy the full SHA
    ac1f54a View commit details
  4. add 3.38 support

    JackKenney committed Jul 5, 2021
    Copy the full SHA
    18a2ff2 View commit details
  5. update fix language issue

    JackKenney committed Jul 5, 2021
    Copy the full SHA
    41093f7 View commit details
  6. Copy the full SHA
    6c7e5e4 View commit details
  7. Merge pull request #1 from JackKenney/gnome-40

    Add GNOME 40 support as well as for other versions.
    JackKenney authored Jul 5, 2021
    Copy the full SHA
    7106056 View commit details
  8. Update README.md

    JackKenney authored Jul 5, 2021
    Copy the full SHA
    3c297c4 View commit details
  9. Update README.md

    JackKenney authored Jul 5, 2021
    Copy the full SHA
    fc252b4 View commit details

Commits on Jul 6, 2021

  1. fix invisibility bug

    JackKenney committed Jul 6, 2021
    Copy the full SHA
    2aba34a View commit details
  2. fix typo

    JackKenney committed Jul 6, 2021
    Copy the full SHA
    0302d55 View commit details
  3. update version

    JackKenney committed Jul 6, 2021
    Copy the full SHA
    64deb78 View commit details

Commits on Jul 8, 2021

  1. turn down shifting

    JackKenney committed Jul 8, 2021
    Copy the full SHA
    5f5b371 View commit details
  2. Copy the full SHA
    d906ca6 View commit details
  3. Merge pull request #2 from JackKenney/remove-lang

    Remove lang
    JackKenney authored Jul 8, 2021
    Copy the full SHA
    ab49ccf View commit details
  4. add build script

    JackKenney committed Jul 8, 2021
    Copy the full SHA
    2f76b50 View commit details
  5. cut release 0.0.5

    JackKenney committed Jul 8, 2021
    Copy the full SHA
    3db0163 View commit details

Commits on Oct 22, 2021

  1. add Gnome 41 support

    JackKenney committed Oct 22, 2021
    Copy the full SHA
    345377a View commit details

Commits on Oct 23, 2021

  1. Merge pull request #3 from JackKenney/release-6

    add Gnome 41 support
    JackKenney authored Oct 23, 2021
    Copy the full SHA
    1772e4d View commit details

Commits on Nov 5, 2021

  1. Copy the full SHA
    d964e32 View commit details
  2. Copy the full SHA
    dab1099 View commit details
  3. cut release 8

    JackKenney committed Nov 5, 2021
    Copy the full SHA
    25173ed View commit details

Commits on Apr 25, 2022

  1. support gnome 42

    JackKenney committed Apr 25, 2022
    Copy the full SHA
    4af7cdc View commit details
  2. Merge pull request #4 from JackKenney/gnome-42

    support gnome 42
    JackKenney authored Apr 25, 2022
    Copy the full SHA
    3fd7498 View commit details

Commits on Aug 1, 2022

  1. fix: window shadow

    G-dH authored Aug 1, 2022
    Copy the full SHA
    0af94c3 View commit details

Commits on Aug 4, 2022

  1. Merge pull request #5 from G-dH/main

    fix: window shadow
    JackKenney authored Aug 4, 2022
    Copy the full SHA
    244a59b View commit details

Commits on Mar 22, 2023

  1. Updated gnome version support

    Added support for Gnome 43, and EXPERIMENTAL support for Gnome 44
    Lynet101 committed Mar 22, 2023
    Copy the full SHA
    3d3cc8a View commit details
  2. Update README.md

    Lynet101 authored Mar 22, 2023
    Copy the full SHA
    3116e68 View commit details
  3. Copy the full SHA
    1488a08 View commit details
  4. Copy the full SHA
    5cd13c9 View commit details
  5. Copy the full SHA
    8232462 View commit details
  6. Copy the full SHA
    3c11c84 View commit details
  7. Copy the full SHA
    cd5bc37 View commit details
  8. minor tweaks and fixes

    Lynet101 committed Mar 22, 2023
    Copy the full SHA
    bb87817 View commit details
  9. Copy the full SHA
    c6ded1a View commit details
  10. Update LICENSE

    Lynet101 authored Mar 22, 2023
    Copy the full SHA
    415e76c View commit details
  11. Update README.md

    Lynet101 authored Mar 22, 2023
    Copy the full SHA
    0ec864c View commit details
  12. Update README.md

    Lynet101 authored Mar 22, 2023
    Copy the full SHA
    d9a88d0 View commit details
  13. Update README.md

    Lynet101 authored Mar 22, 2023
    Copy the full SHA
    851cfb4 View commit details
  14. Update README.md

    Lynet101 authored Mar 22, 2023
    Copy the full SHA
    2d384f9 View commit details
  15. Update extension.js

    Lynet101 committed Mar 22, 2023
    Copy the full SHA
    ecad799 View commit details
  16. gnome 44

    Lynet101 committed Mar 22, 2023
    Copy the full SHA
    d1d05ae View commit details

Commits on Mar 23, 2023

  1. Copy the full SHA
    7a86c3a View commit details
  2. Copy the full SHA
    c021ab9 View commit details
  3. Copy the full SHA
    ba1f959 View commit details
  4. updated versioning to 13

    Lynet101 committed Mar 23, 2023
    Copy the full SHA
    931e42d View commit details

Commits on Sep 25, 2023

  1. Update README.md

    Lynet101 authored Sep 25, 2023
    Copy the full SHA
    8775b8e View commit details
  2. Merge pull request #1 from Lynet101/Lynet101-patch-1

    Update README.md
    Lynet101 authored Sep 25, 2023
    Copy the full SHA
    bf470dc View commit details
2 changes: 0 additions & 2 deletions .gitignore

This file was deleted.

2 changes: 2 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
The MIT License (MIT)

Copyright (c) 2016 Mai Lavelle
Copyright (c) 2020-2022 Jack Kenney
Copyright (c) 2023 Sebastian Lindau-Skands

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
63 changes: 63 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# True Color Window Inverter

**!!!IMPORTANT!!!**
*As of December the 5th, 2023, this project is orphaned, and will no longer be maintained by developer Lynet_101*
This decission comes due to changes and stress in the personal, as well as professional life.
I thank you all for using this extension, and apologize for any inconvenience this change might cause
---

**This is a fork of JackKenney/true-color-window-invert due to 2+ years of inactivity on the project**

**Gnome 45**
is currently experimental. This will need fixing.


GNOME shell extension for inverting window colors in hue preserving manner. Effectively a manual dark theme for GNOME windows.

Not currently available on the GNOME Extensions website.<!-- here.-->

<!--https://extensions.gnome.org/extension/5829/true-color-invert/-->

## Supported Versions

- Gnome 3.32 (deprecated)
- Gnome 3.36 (deprecated)
- Gnome 3.38 (deprecated)
- Gnome 40
- Gnome 41
- Gnome 42
- Gnome 43
- Gnome 44
- Gnome 45 (experimental)
- Gnome 46 (experimental)

Deprecated versions should work, but will not be supported nor will they recieve any further updates.

## Keyboard Shortcut

`Super + I`

## Debugging

Errors will print out here:
```bash
journalctl -f -o cat /usr/bin/gnome-shell
```

## Contributing

Before submitting pull requests, please run:

```bash
glib-compile-schemas schemas/
```

To recompile the `gschemas`.
This step is not neccesary if the 'build.sh' is used, as it's included in the script

## Building for Release

To make the ZIP for the GNOME Shell Extension website:

1. `sh build.sh`
2. Tag `main` at that time with a release tag according to the revisions made.
8 changes: 8 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
rm invert-window-colors.zip
cd invert-window-colors@tutacat.github.io
glib-compile-schemas schemas/
if command -v gnome-extensions; then
gnome-extensions pack . -o ..
else
zip -r "../$(basename "$(realpath .)").zip .
fi
93 changes: 0 additions & 93 deletions convenience.js

This file was deleted.

101 changes: 0 additions & 101 deletions extension.js

This file was deleted.

117 changes: 117 additions & 0 deletions invert-colors@tutacat.github.io/extension.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
import * as Main from 'resource:///org/gnome/shell/ui/main.js';
import GObject from 'gi://GObject/GObject';
import Meta from 'gi://GnomeDesktop/Meta';
import Shell from 'gi://GnomeDesktop/Shell';
import Clutter from 'gi://Clutter/Clutter';

import {Extension} from 'resource:///org/gnome/shell/extensions/extension.js';
const Self = Extension.metadata;

const SHORTCUT = 'invert-window-shortcut';

class TrueInvertWindowEffect extends Clutter.ShaderEffect {
vfunc_get_static_shader_source() {
return `
uniform bool invert_color;
uniform float opacity = 1.0;
uniform sampler2D tex;
/**
* based on shift_whitish.glsl https://github.com/vn971/linux-color-inversion with minor edits
*/
void main() {
vec4 c = texture2D(tex, cogl_tex_coord_in[0].st);
float white_bias = c.a * 0.1; // lower -> higher contrast
float m = 1.0 + white_bias;
float shift = white_bias + c.a - min(c.r, min(c.g, c.b)) - max(c.r, max(c.g, c.b));
c = vec4((shift + c.r) / m,
(shift + c.g) / m,
(shift + c.b) / m,
c.a);
cogl_color_out = c;
}
`;
}

vfunc_paint_target(paint_node = null, paint_context = null) {
this.set_uniform_value("tex", 0);

if (paint_node && paint_context)
super.vfunc_paint_target(paint_node, paint_context);
else if (paint_node)
super.vfunc_paint_target(paint_node);
else
super.vfunc_paint_target();
}
}

const TrueInvertWindowEffect = new GObject.registerClass({Name: 'TrueInvertWindowEffect'}, TrueInvertWindowEffect);

function InvertWindow() {
this.settings = ExtensionUtils.getSettings(Self.metadata["settings-schema"]);
}

InvertWindow.prototype = {
toggle_effect() {
for (actor in global.get_window_actors()) {
let meta_window = actor.get_meta_window();
if (meta_window.has_focus()) {
if (let actor.get_effect('invert-color')) {
actor.remove_effect_by_name('invert-color');
delete meta_window._invert_window_tag;
}
else {
let effect = new TrueInvertWindowEffect();
actor.add_effect_with_name('invert-color', effect);
meta_window._invert_window_tag = true;
}
}
}
},

enable() {
Main.wm.addKeybinding(
SHORTCUT,
this.settings,
Meta.KeyBindingFlags.NONE,
Shell.ActionMode.NORMAL,
this.toggle_effect
);

for (actor in global.get_window_actors()) {
let meta_window = actor.get_meta_window();
if (meta_window.hasOwnProperty('_invert_window_tag')) {
let effect = new TrueInvertWindowEffect();
actor.add_effect_with_name('invert-color', effect);
}
}
},

disable() {
Main.wm.removeKeybinding(SHORTCUT);

for (actor in global.get_window_actors()) {
actor.remove_effect_by_name('invert-color');
}
}
}

let invert_window;

function init() {
}

function enable() {
invert_window = new InvertWindow();
invert_window.enable();
}

function disable() {
invert_window.disable();
invert_window = null;
}

Loading