Coder Social home page Coder Social logo

glassy-gnome's People

Contributors

chrislauinger77 avatar emiapwil avatar rharriso avatar russell-jones avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

glassy-gnome's Issues

Instructions to use gsettings are confusing

I propose a simpler set of instructions

cd ~/.local/share/gnome-shell/extensions/glassygnome@emiapwil/schemas
vim org.gnome.shell.extensions.glassy-gnome.gschema.xml

or use your favorite editor and add/edit rules as follows

[
(
['vlc'],
100,
100,
0
),
(
['.*'],
100,
80,
0
)
]

then run the following command and reload the extension

glib-compile-schemas .

You can reload the extension by toggling it on and off in the interface or running this in the extensions directory

gnome-shell extension-tool -r glassygnome@emiapwil
'glassygnome@emiapwil' reloaded.

Unshading a window won't restore it to non-transparent state

Hi,

On gnome 3.18, unshading a previously shaded window by double tapping the window title bar will result in a window that is still transparent. I propose the following patch that seems to have fixed my problem:

--- extension.js.0  2015-09-25 11:43:42.000000000 +0800
+++ extension.js    2016-04-14 10:12:11.687902943 +0800
@@ -20,7 +20,7 @@

 var settings, filters, activated;

-var on_window_created, on_restacked;
+var on_window_created, on_restacked, on_focused;

 var setting_signals;

@@ -311,6 +311,7 @@

     on_window_created = global.display.connect('window-created', glassify);
     on_restacked = global.screen.connect('restacked', glassify);
+    on_focused = global.display.connect('notify::focus-window', glassify);

     connect_signals();
     create_label();

Hotkey to toggle glassy-gnome for some windows

Hi,

I need to disable glassy for some windows on demand via hotkeys - like one non transparent Firefox window but the other Firefox windows remain glassy. I propose the following patch in the hope that it will be useful to someone else. It uses Supr-7 to toggle between enable/disable state.

--- extension.js.3  2016-04-18 16:56:56.764140355 +0800
+++ extension.js    2016-04-19 13:00:26.724875643 +0800
@@ -17,6 +17,7 @@
 const inc_key           = 'inc-opacity-key';
 const dec_key           = 'dec-opacity-key';
 const reset_key         = 'reset-opacity-key';
+const disable_key  = 'disable-opacity-key';

 var settings, filters, activated;

@@ -92,6 +93,9 @@
         return;
     }

+    if (!win.get_meta_window().glassy.enabled) {
+        opacity = 0;
+    }
     indicator.set_opacity(opacity);
 }

@@ -231,6 +235,22 @@
     glassify();
 }

+function disable_window_opacity() {
+    let win = get_active_window();
+    if (win != null) {
+        let meta_win = win.get_meta_window();
+        test_glassy_window(meta_win);
+
+        if (activated && meta_win.glassy.enabled) {
+            meta_win.glassy.enabled = false;
+        } else if (activated && !meta_win.glassy.enabled) {
+            meta_win.glassy.enabled = true;
+        }
+    }
+
+    glassify();
+}
+
 function _add_keybinding(key, func) {
     if (Main.wm.addKeybinding) {
         Main.wm.addKeybinding(key, settings, Meta.KeyBindingFlags.NONE,
@@ -255,6 +275,7 @@
     _add_keybinding(inc_key, increase_window_opacity);
     _add_keybinding(dec_key, decrease_window_opacity);
     _add_keybinding(reset_key, reset_window_opacity);
+    _add_keybinding(disable_key, disable_window_opacity);
 }

 function unbind_shortcuts() {
@@ -263,6 +284,7 @@
     _remove_keybinding(inc_key);
     _remove_keybinding(dec_key);
     _remove_keybinding(reset_key);
+    _remove_keybinding(disable_key);
 }

 function init() {
@@ -295,6 +317,7 @@
     setting_signals.push(settings.connect('changed::' + inc_key, update_settings));
     setting_signals.push(settings.connect('changed::' + dec_key, update_settings));
     setting_signals.push(settings.connect('changed::' + reset_key, update_settings));
+    setting_signals.push(settings.connect('changed::' + disable_key, update_settings));
 }

 function disconnect_signals() {
--- schemas/org.gnome.shell.extensions.glassy-gnome.gschema.xml.0   2015-08-28 14:32:04.000000000 +0800
+++ schemas/org.gnome.shell.extensions.glassy-gnome.gschema.xml 2016-04-19 12:30:19.038915689 +0800
@@ -46,6 +46,11 @@
             <summary>Shortcut to reset the opacity of the active window to default (the values in the filters).</summary>
         </key>

+        <key name="disable-opacity-key" type="as">
+            <default><![CDATA[['<Super>7']]]></default>
+            <summary>Shortcut to disable the opacity of the active window.</summary>
+        </key>
+
         <key name="auto-start" type="b">
             <default>true</default>
             <summary>Start Glassy GNOME when the system starts up.</summary>

Errors in syslog

Just a drive-by dump of some errors I'm noticing in syslog/journald

Version: v16
OS: Pop_OS 19.04 (aka a "skinned/extension-ed" Ubuntu 19.04)

What was I doing? Changing transparency with shortcut SUPER+9, which unfortunately also launches an app in my Dash-to-Dock extension (trying to fix that).

Sep 16 10:10:23 kodiak gnome-shell[3279]: JS ERROR: Error: Error invoking GLib.timeout_add: Expected function for callback argument function, got null#012asynchronous_glassify@/home/eric/.local/share/gnome-shell/extensions/glassygnome@emiapwil/extension.js:373:5
Sep 16 10:10:24 kodiak gnome-shell[3279]: JS ERROR: TypeError: global.screen is undefined#012_updateSolidStyle@/home/eric/.local/share/gnome-shell/extensions/[email protected]/transparency.js:88:13#012wrapper@resource:///org/gnome/gjs/modules/_legacy.js:82:22
Sep 16 10:10:24 kodiak gnome-shell[3279]: JS ERROR: TypeError: global.screen is undefined#012_updateSolidStyle@/home/eric/.local/share/gnome-shell/extensions/[email protected]/transparency.js:88:13#012wrapper@resource:///org/gnome/gjs/modules/_legacy.js:82:22
Sep 16 10:10:28 kodiak gnome-shell[3279]: JS ERROR: TypeError: global.screen is undefined#012_updateSolidStyle@/home/eric/.local/share/gnome-shell/extensions/[email protected]/transparency.js:88:13#012wrapper@resource:///org/gnome/gjs/modules/_legacy.js:82:22#012_onWindowActorRemoved@/home/eric/.local/share/gnome-shell/extensions/[email protected]/transparency.js:78:9#012wrapper@resource:///org/gnome/gjs/modules/_legacy.js:82:22#012_destroyWindowDone@resource:///org/gnome/shell/ui/windowManager.js:1825:13#012_callOnFunction@resource:///org/gnome/gjs/modules/tweener/tweener.js:208:13#012_updateTweenByIndex@resource:///org/gnome/gjs/modules/tweener/tweener.js:342:9#012_updateTweens@resource:///org/gnome/gjs/modules/tweener/tweener.js:355:18#012_onEnterFrame@resource:///org/gnome/gjs/modules/tweener/tweener.js:370:10#012_emit@resource:///org/gnome/gjs/modules/signals.js:128:27#012_onNewFrame@resource:///org/gnome/shell/ui/tweener.js:238:9#012ClutterFrameTicker</<@resource:///org/gnome/shell/ui/tweener.js:209:1

Icon toggle and Default Opacity questions

I mostly opened this issue to say thank you! Works great.

I've hacked at the .js to remove the icon, but when you create a GUI that would be a nice feature (show/hide icon option).

Thanks again, this is perfect!

Transparent effect on game window

Hi, I have seen transparency effect when I played LIMBO the game (you must know it, saling on Steam). You can see the white right angles at back picture. This is a open window of Gnome-tweak.
Снимок экрана от 2019-09-03 14-57-31

Change transparency by Alt+scroll

Hi,

Compiz have a plugin "Opacity, Brightness and Saturation" with the similar functionality as your extension but it uses keybinding scheme that I find as a very convinient: Alt + scroll-up to make window less transparent and Alt + scroll-down to make it more transparent https://askubuntu.com/a/133295

Would it be possible to add such a keybindings to your extension?

Document range of opacity values

I'm fine with using gsettings and dconf-tool, but the README doesn't tell anything about the valid range of opacity values. My guess is 0-100 (0x64).

On that note: If I hit Super+0 for a fully opaque window, say, three times, I need to hit Super+9 four times until the window starts becoming transparent.

get_wm_class() may return NULL for some windows

Hi,

For some reasons, get_wm_class() might return null for some unnamed windows, and generate some error messages in the logs. I propose the following patch that works for me:

--- extension.js.1  2016-04-14 10:12:11.687902943 +0800
+++ extension.js    2016-04-18 16:52:24.785771615 +0800
@@ -52,11 +52,12 @@
             offset:     0
         };
     }
+    let window_class = meta_win.get_wm_class();
     for (let i in filters) {
         let filter = filters[i];
         for (let j in filter.patterns) {
             let pattern = filter.patterns[j];
-            if (meta_win.get_wm_class().match('^' + pattern + '$')) {
+            if (window_class && window_class.match('^' + pattern + '$')) {
                 meta_win.glassy.filter = filter;
                 return;
             }

build errors (eslint, ast, gjs)

In a fresh clone, just running make leaves me with this error:

£ make
npx eslint -c ./.eslintrc.js ./glassygnome@emiapwil/*.js
npx: installed 118 in 13.857s

Oops! Something went wrong! :(

ESLint: 7.30.0

ESLint couldn't find the plugin "eslint-plugin-gjs".

(The package "eslint-plugin-gjs" was not found when loaded as a Node module from the directory "/home/.../git/glassy-gnome".)

It's likely that the plugin isn't installed correctly. Try reinstalling by running the following:

    npm install eslint-plugin-gjs@latest --save-dev

The plugin "eslint-plugin-gjs" was referenced from the config file in "--config".

If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team.

make: *** [Makefile:25: lint] Error 2

After doing that, there's another error:

£ make
npx eslint -c ./.eslintrc.js ./glassygnome@emiapwil/*.js
npx: installed 118 in 11.68s

Oops! Something went wrong! :(

ESLint: 7.30.0

Error: Failed to load plugin 'gjs' declared in '--config': Cannot find module 'eslint/lib/ast-utils'
Referenced from: /home/.../git/glassy-gnome/.eslintrc.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
    at Function.Module._load (internal/modules/cjs/loader.js:562:25)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (/home/.../.npm/_npx/18511/lib/node_modules/eslint/node_modules/v8-compile-cache/v8-compile-cache.js:159:20)
    at Object.<anonymous> (/home/.../git/glassy-gnome/node_modules/eslint-plugin-gjs/lib/rules/translation-strings.js:8:18)
    at Module._compile (/home/.../.npm/_npx/18511/lib/node_modules/eslint/node_modules/v8-compile-cache/v8-compile-cache.js:192:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
make: *** [Makefile:25: lint] Error 2

Some UI widgets always transparent

Hi,

Some UI widgets are always transparent even if it is in the foreground, for e.g., drop down menus, context menus, splash screens, tool tips, etc. Depending on the transparency settings, the themes being used and the personal tastes, the final display could be something cool to something really illegible.

I made the following quick fix that is not quite ideal but then again it works for me. Need to apply the patch from issue 3 first.

--- extension.js.2  2016-04-18 16:52:24.785771615 +0800
+++ extension.js.3  2016-04-18 16:56:56.764140355 +0800
@@ -52,6 +52,14 @@
             offset:     0
         };
     }
+    let window_type = meta_win.get_window_type();
+    if (window_type == Meta.WindowType.DROPDOWN_MENU ||
+        window_type == Meta.WindowType.POPUP_MENU ||
+        window_type == Meta.WindowType.SPLASHSCREEN ||
+        window_type == Meta.WindowType.TOOLTIP ||
+        window_type == Meta.WindowType.OVERRIDE_OTHER) {
+            return;
+        }
     let window_class = meta_win.get_wm_class();
     for (let i in filters) {
         let filter = filters[i];

Preset modes and quick switching between them

First of all, thank you very much for this nice extension! I am loving it! 😃

Now to the question.
Is it possible to make at least two presets, so I can quickly toggle between then with a few dedicated shortcuts?

The thing is I think that I don't need this opacity effect all the time but sometimes it is very useful to see what is happening in the background. Would be nice to have a shortcut for "turn off" this opacity effect, and a shortcut for turn it on to a preset value (maybe even the last one set).

Thanks again!

Set Default Transparencies?

I was wondering if there's a command that can be used to set the default transparency of active and inactive windows. I didn't see anything in the readme.

Glassy Gnome

when I activate this plugin windows shakes and doesnt work properly, thats will be great if you add some settings to the extension, Thanks in an advance!!!

Incorrect Patterns?

On my machine, I had to change 'Terminal' to 'Gnome-terminal' for the settings change to work.

I'm running Ubuntu 18.04 with Gnome 3.28.3.

Additionally, the looking class link in the README seems to be down.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.