emiapwil / glassy-gnome Goto Github PK
View Code? Open in Web Editor NEWTo bring opacity features to gnome windows.
License: GNU General Public License v2.0
To bring opacity features to gnome windows.
License: GNU General Public License v2.0
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.
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();
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>
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
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!
https://extensions.gnome.org/extension/982/glassy-gnome/
Could you please update it - the version only supports 3.34
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?
system:ubuntu gnome 16.10 LTS,GNOME 3.18
GPU :use INTEL GRAPHICS UPDATE TOOL FOR LINUX install GPU driver,pls refer 安装显卡驱动.txt
steps:
note:
chrome browser maximize can work when check "use system title-bar and border"
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.
when i press super + 9 , will more transprent, but when i close windows ( terminal or file manager ) it's will be back to before transparent.. thanks..
Hello,
plugin creates huge flickering of windows and shadows with actual gnome version 3.36.2.
Tested on manjaro 20.
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;
}
keyboard shortcuts to increase/decrease opacity have no effect, arch linux w/ gnome 3.30
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
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];
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!
arch linux gnome 3.34, only other windows show through when transparency is decreased, instead of windows and background
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.
when windows are opacified artifacts show on screen while moving
how can i make all windows have the same transparency whether active or inactive, for a uniform look?
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!!!
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.
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.