DEV Community

Shawon Saha
Shawon Saha

Posted on

Adding Keyboard Shortcut Functionality to the Windows Quick List Applet in Linux Mint Cinnamon

Adding Keybinding Functionality to the Windows Quick List Applet in Cinnamon

If you're using the Windows Quick List applet in Cinnamon and want to enhance its functionality by adding a customizable keybinding, follow these steps to modify the applet.js and settings-schema.json files.

Modifying applet.js

Step 1 - Import the Settings modules at the beginning of the file:

  const Settings = imports.ui.settings;
Enter fullscreen mode Exit fullscreen mode

Step 2 - In the constructor method of the CinnamonWindowsQuickListApplet class, add the following lines after the existing code:

this.settings = new Settings.AppletSettings(this, metadata.uuid, instance_id);

Enter fullscreen mode Exit fullscreen mode

Step 3 - Add the _onSourceKeyPress, on_keybinding_changed, and on_hotkey_triggered methods to the CinnamonWindowsQuickListApplet class:

_onSourceKeyPress(actor, event) {
        let symbol = event.get_key_symbol();

        if (symbol == Clutter.KEY_space || symbol == Clutter.KEY_Return) {
            return true;
        } else if (symbol == Clutter.KEY_Escape && {
            return true;
        } else if (symbol == Clutter.KEY_Down) {
            if (!
  , Gtk.DirectionType.DOWN, false);
            return true;
        } else
            return false;

    on_keybinding_changed() {


    on_hotkey_triggered() {
        if ( {
        } else {
Enter fullscreen mode Exit fullscreen mode

These changes will make the Windows Quick List applet accessible via the keybinding defined in the applet settings. The _onSourceKeyPress method handles the key press events when the applet actor is focused, allowing you to toggle the menu with the Space or Return key, close the menu with the Escape key, and navigate the menu with the Down arrow key.
The on_keybinding_changed method is called when the keybinding setting changes and adds the hotkey using Main.keybindingManager.addHotKey. The on_hotkey_triggered method is called when the hotkey is triggered, and it toggles the menu open or closed.

Modifying settings-schema.json

To make the hotkey customizable, crate a new file settings-schema.json in the same path and add the corresponding setting definition to the applet's settings schema file:

  "section1": {
    "type": "section",
    "description": "Behavior"
  "keyOpen": {
    "type": "keybinding",
    "description": "Show List",
    "default": "<Super>a",
    "tooltip": "Shortcut to open/close the window list"
Enter fullscreen mode Exit fullscreen mode

This adds a new setting named keyOpen under the "Behavior" section. The setting is of type "keybinding" and allows users to customize the shortcut for opening and closing the window list. The default keybinding is set to <Super>a, but users can change it according to their preference.

With these modifications to applet.js and settings-schema.json, your Windows Quick List applet will now have a customizable keybinding that users can configure through the applet settings.

If you are too lazy to tweak the source code, clone this repo and replace files inside /usr/share/cinnamon/applets/

Remember to restart Cinnamon or reload the applet after making these changes for them to take effect.

Happy customizing!

Top comments (0)