Code Monkey home page Code Monkey logo

gnome-shell-extension-transparent-window's Introduction

gnome-shell-extension-transparent-window

Summary

The extension will change the opacity of window through simple mouse/keyboard operation.

Usage

Move mouse cursor into the window you want to change, hover over the window, hold Alt key(or customized modifier key) and scroll to make the window transparent.

Environment

Tested on:

  1. Ubuntu 18.04 Gnome 3.28.
  2. Ubuntu 20.04 Gnome 3.36.

Motivation

Transparent window is a very useful feature that can improve work effeciency. It is implemented by software on multiple platforms. Even other Linux desktops like Ubuntu Unity can use Compiz to achieve this goal. There is no reason Gnome doesn't have this feature.

Design

Use GdkKeymap to monitor the hotkeys. When the modifier key is pressed, create an overlay actor that will monitor the scroll event. Once the scroll event is detected, modify the opacity of the mouse hovered window.

Limits

An overlay on top of all windows has to be created in order to monitor scroll event. Thus Alt+drag operation won't work anymore. Feel free to contact me or make a commit if you have a better idea to solve the problem.

Background knowledge

Gjs

Gjs is a JavaScript binding for GNOME and can be used to interact with Gtk

GTK

GTK is a widget toolkit for creating GUI on top of GDK.

GDK

The wrapper library of low-level window/graphics functions.

Clutter

Overview

Clutter is a GObject-based graphics library for creating user interfaces.

Actor

Actor is a basic element of Clutter. It encapsulates the postion/size/event of a node in the scene graph. In short, it is the abstraction of a window.

Mutter

Mutter is the default window manager of GNOME3 which uses Clutter as library.

Tips

Mutter is a portmanteau of "Metacity"(The deprecated window manger of GNOME2) and "Clutter".

GNOME Shell

GNOME Shell itself is a plugin of Mutter. This means when devloping shell extension, we are building plugin on plugin lol. Project location: https://gitlab.gnome.org/GNOME/gnome-shell/

ST(Shell Toolkit)

This is Gnome-shell's Clutter-based toolkit that defines useful actors. Examples are StBin, StButton, etc.

Debugging

Looking Glass

Looking Glass is GNOME Shell's integrated debugger and inspector tool. It would be helpful to debug any issue of the extension.

Usage

Press Alt-F2, type lg, then hit Enter.

Logs

Gnome shell extensions log to the standard location of Linux logs: /var/log/syslog

Use journalctl -b0 /usr/bin/gnome-shell |grep -i transparent.*window to inspect logs.

Logging Level

Different logging levels can be configured. Set "Log Verbose Level" to "Debug" to get detailed log.

Reload Gnome shell

You may need to reload gnome shell to test and debug extension changes. Press Alt-F2, type r, then hit Enter to reload gnome shell.

Reference

  1. https://wiki.gnome.org/Projects/GnomeShell/LookingGlass

LICENSE

MIT

gnome-shell-extension-transparent-window's People

Contributors

coadmunkee avatar igolskyi avatar pashaigood avatar pbxqdown avatar

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.