🌍 🌏 🌎
Agism
Flag of Russia

Agism

Agism1 is (D-Bus) API for GNOME Input Source Manager2. It allows third party applications (e. g. keyboard layout switchers or keyboard layout indicators) to enumerate, activate and monitor input sources3. There are prebult extension pack4 and RPM packages for a few releases of Fedora, Mageia, OpenMandriva, openSUSE, recent versions of RHEL and its clones. Source tarball for configure && make is also available, it should work for GNOME running on any GNU/Linux distro, including (but not limited to) Arch, Debian and Ubuntu5. Agism is free software.

Why?

To let Tapper 0.6.0 (or later) work in GNOME.

Tapper 0.5.0 uses the GNOME Shell’s Eval method to enumerate and activate input sources. The Eval method allows to execute arbitrary JavaScript code in the GNOME Shell context. Starting from GNOME 41, the method is considered unsafe and disabled (it is still present and can be called but it does nothing), so Tapper 0.5.0 does not work properly in GNOME 41 (or later).

However, GNOME Shell extensions are not applications — they run in the context of the GNOME Shell, so they:

  1. can access all GNOME Shell internals (including input sources), and
  2. can have API for external programs.

Thus, a 3rd party application can activate input sources if some GNOME Shell extension does it for the application.

Agism is such an extension. It provides D-Bus API to enumerate, activate and monitor6 input sources. Agism is a Tapper’s agent in GNOME Shell, that allows Tapper 0.6.0 (or later) to work in GNOME.

Agism was made specially for Tapper, but it can be used by other applications, including shell scripts. See the agism(7) man page for the Agism API.

BTW, if Agism is installed and enabled, you will automatically have an English keyboard layout when you enter your password to unlock the screen.7

Current version

Current version is 3-0.vdb.1, released on 2023-04-28. See NEWS.md for list of user-visible changes.

Installing

Installing the prebuilt RPM package

This is the easiest way to install Agism. The RPM package installs Agism as a system extension, available to all users of the system; it can be upgraded or removed using the system package manager.

Fedora

$ sudo dnf copr enable vandebugger/tapper
$ sudo dnf install gnome-shell-extension-agism

Mageia

$ su -c "dnf copr enable vandebugger/tapper"
$ su -c "dnf install gnome-shell-extension-agism"

OpenMandriva

Replace $VER with the version of your system, e. g. cooker or rolling:

$ sudo wget -O /etc/yum.repos.d/vandebugger-tapper.repo https://copr.fedorainfracloud.org/coprs/vandebugger/tapper/repo/openmandriva-$VER
$ sudo dnf install gnome-shell-extension-agism

openSUSE

Replace $VER with the version of your system, e. g. leap-15.3, leap-15.4 or tumbleweed:

$ sudo zypper addrepo https://copr.fedorainfracloud.org/coprs/vandebugger/tapper/repo/opensuse-$VER/vandebugger-tapper-opensuse-$VER.repo
$ sudo zypper install gnome-shell-extension-agism

Installing the prebuilt extension pack

If installing the prebuilt RPM package is not feasible or prebuilt RPM package does not exist for your system, you can install the prebuilt extension pack. An extension pack is a distro-agnostic zip archive with the extension files. The extension pack installs Agism as user extension, available only to the user who installed it. To download and install the extension pack:

$ gnome-extensions install --force https://sourceforge.net/projects/agism/files/3/agism@agism.sourceforge.io.shell-extension.zip

The --force option can be omitted if you install the extesion pack for the first time. An attempt to overwrite an existing extension (e. g. upgrading it) will require the --force option.

If gnome-extension fails to download Agism, use another tool for downloading, and then use gnome-extension to install the downloaded pack, e. g.:

$ wget https://sourceforge.net/projects/agism/files/3/agism@agism.sourceforge.io.shell-extension.zip
$ gnome-extensions install --force agism@agism.sourceforge.io.shell-extension.zip

Note: The extension pack does not install the man page.

Building and installing from source

If neither prebuilt RPM package nor prebuilt extension pack meets your needs, you can build and install Agism from source. See INSTALL.md for instructions.

Enabling

A just installed extension does not appear in the GNOME Shell until it is restarted. If you run X Window System session, press Alt+F2 to open Run Dialog, then press r and Enter. In case of Wayland session you have to log out and log in.

Installed Agism is available for the users (or the user, depending on the installation type: system or user), but not active. To make Agism up and running, enable it:

$ gnome-extensions enable agism@agism.sourceforge.io

This needs to be done once — being enabled, the extension is automatically activated every time you logs in to the system until it is disabled or removed.

Alternatively, enable Agism through Extensions application (command gnome-extensions-app).

Note: Older versions of gnome-extensions program (e. g. 3.36.9 in Ubuntu 20.04.1) may fail silently! It is a good idea to make sure that Agism is really enabled:

$ gnome-extensions show agism@agism.sourceforge.io
Name: Agism
...
Version: 3
State: ENABLED

Pay attention to the last line of the output: it must end with the word “ENABLED”, as shown above.

Reporting bugs

See BUGS.md.

Footnotes


  1. Agism stands for (D-Bus) API for GNOME Input Source Manager.↩︎

  2. Input Source Manager is a GNOME Shell component which manages input sources, e. g. activates them, updates language indicator, etc.↩︎

  3. Input Source is a GNOME term for both keyboard layout and input method.↩︎

  4. Extension pack is a GNOME term. A GNOME extension pack is distro-agnostic zip archive with the extension files.↩︎

  5. In Ubuntu graphical session, the environment variable XDG_SESSION_DESKTOP value is "ubuntu". However, the Ubuntu desktop is actually the GNOME Shell with few Ubuntu-specific extensions. Agism works for Ubuntu desktop, too.↩︎

  6. Monitoring application will receive a notification each time the user switch keyboard layout or adds, removes or reorders the list of input sources through GNOME Settings.↩︎

  7. Strictly speaking, it will be not the English keyboard layout but the first one (which is usually English). This is side effect: the GNOME Shell disables all the extensions just before it locks the screen, and Agism activates the first keyboard layout when Agism is disabled.↩︎

3-0.vdb.1
Source Forge
2023-04-28