Git Product home page Git Product logo

thebrokenrail / cariboublocker Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lxylxy123456/cariboublocker

0.0 0.0 0.0 31 KB

Prevents caribou from appearing when you use a touchscreen with the on screen keyboard disabled in gnome-shell 3.36

Home Page: https://extensions.gnome.org/extension/3222/block-caribou-36/

License: GNU General Public License v2.0

JavaScript 95.84% CSS 4.16%

cariboublocker's Introduction

cariboublocker for GNOME Shell 3.36 (and above)

Available at: https://extensions.gnome.org/extension/3222/block-caribou-36/

Based on https://github.com/keringar/cariboublocker.

Change some naming to be compatible with GNOME Shell 3.36.

There are some naming changes in GNOME Shell, so the original project by keringar no longer works on some GNOME Shell versions (For me, it works on Fedora 31 with gnome-shell-3.34.5 and Xorg, but not on Fedora 32 with gnome-shell-3.36.3 and Xorg).

Install

Install this extension using one of the following ways. If your GNOME Shell version is higher than this extension is configured to support, you can still try this extension following Installing on high GNOME Shell version below.

Update for GNOME Shell 44 (Fedora 38): it looks like you need to restart GNOME Shell after enabling or disabling this extension.

Way 1: use extensions.gnome.org

This extension is available at the official GNOME Shell Extensions website: https://extensions.gnome.org/extension/3222/block-caribou-36/

Way 2: download zip

Go to Releases, and choose the zip file corresponding to your gnome-shell version. Then gnome-extensions install <your-gnome-shell-version>.zip.

Installing on high GNOME Shell version

This extension is likely to work for a high GNOME Shell version, if GNOME Shell's keyboard.js is not changed. This extension specifies a number of supported GNOME Shell versions in metadata.json. If your GNOME Shell version is not in this list, you may not be able to install this extension.

There are a few possible solutions:

  1. In dconf, set disable-extension-version-validation (in /org/gnome/shell/) to True. See https://gjs.guide/extensions/overview/anatomy.html#shell-version.
  2. Download this extension as a zip file, from either extensions.gnome.org or GitHub. Then add your GNOME Shell version number to metadata.json in the list specified by "shell-version".
  3. Wait for the extension maintainer (currently lxylxy123456) to update the extension. Maybe notifying the maintainer on extensions.gnome.org or GitHub can help.

Test Log

  • 13 Jun 2020: 3.36.3 PASS on Fedora 32 with gnome-shell-3.36.3 and Xorg
  • 20 Feb 2021: 3.36.3 PASS on Fedora 33 with gnome-shell-3.38.4 and Xorg
  • 29 Apr 2021: 40.0 PASS on Fedora 34 with gnome-shell-40.0 and Xorg
  • 5 Dec 2021: 41 PASS on Fedora 35 with gnome-shell-41.1 and Xorg
  • 12 Jun 2022: 42 PASS on Fedora 36 with gnome-shell-42.2 and Xorg
  • 12 Dec 2022: 43 PASS on Fedora 37 with gnome-shell-43.1 and Xorg
  • 4 Jun 2023: 44 PASS on Fedora 38 with gnome-shell-44.0 and Xorg

Change Log

  • Replace Keyboard with KeyboardManager in extensions.js.
  • Simply change "shell-version" in metadata.json to 40.0. For some reason the version string "3.36.3" still works on Fedora 33's gnome-shell-3.38.
  • Update shell-version in metadata.json
  • Update shell-version in metadata.json
  • Update shell-version and description to be more comprehensive
  • Update shell-version in metadata.json
  • Update shell-version in metadata.json

Relevant Code

See js/ui/keyboard.js. Here are links for some versions after 3.36:

The structure of code is:

var KeyboardManager = class KeyBoardManager {
    constructor() {
        ...
    }

    _lastDeviceIsTouchscreen() {

        if (!this._lastDevice)
            return false;

        let deviceType = this._lastDevice.get_device_type();
        return deviceType == Clutter.InputDeviceType.TOUCHSCREEN_DEVICE;
    }

    ...
}

This extension simply replaces _lastDeviceIsTouchscreen with a function that always returns false.

In GNOME Shell 3.34 and earlier, the class was named Keyboard instead of KeyboardManager. So keringar's extension no longer works after GNOME Shell 3.36.

Development Hints

Looking Glass is very helpful for debugging (saves my time installing an IDE etc).

To create a zip file for https://extensions.gnome.org/upload/, use zip -j a.zip extension.js metadata.json

RESOLVED https://bugs.launchpad.net/ubuntu/+source/gnome-shell/+bug/1723857

cariboublocker

Prevents caribou from appearing when you use a touchscreen with the on screen keyboard disabled

Installation

  1. https://extensions.gnome.org/extension/1326/block-caribou/
  2. You may need to install an extension, Gnome Shell Integration, see the gnome extensions about page for more details.
  3. Click the toggle flag in the top right to ON.

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.