Skip to content

Latest commit

 

History

History
82 lines (55 loc) · 2.85 KB

README.md

File metadata and controls

82 lines (55 loc) · 2.85 KB

GNOME Shell - Mouse Follows Focus

This extension enables mouse-follows-focus on GNOME Shell 45+.

The user experience is meant to be as similar as possible to i3/sway.

Features

  • Automatic Mouse Positioning: Automatically repositions the mouse pointer to the center of the window that gains focus.
  • Multi-Monitor Support: Seamlessly operates across multiple monitors, ensuring consistent behavior in multi-display setups.
  • Compatibility: Designed for GNOME Shell version 45 and above.

Installation

The extension is available on Gnome Extensions.

Manual Installation

Install the extension code

git clone https://github.com/crisidev/mouse-follows-focus
npm install
npm run build
cp -r dist ~/.local/share/gnome-shell/extensions/[email protected]
glib-compile-schemas ~/.local/share/gnome-shell/extensions/[email protected]/schemas/

Restart GNOME Shell and enable the extension

gnome-extensions enable [email protected]     

Configuration

The extension can be configured with dconf / gsettings under the namespace org.gnome.shell.extensions.mouse-follows-focus and with a dynamic UI built in the extension. Settings changed with the UI will be synced with gsettings and vice versa.

  • enable-debugging: Set to true to enable debugging. It's very verbose :D
  • minimum-size-trigger: minimum window size (NxN) triggering mouse-follows-focus events
  • motion-event-timeout: How long before resetting the mouse motion event detection timeout

Dbus Integration

The extensions exposes some Dbus methods I am using for my day to day productivity:

Focus a Workspace

gdbus call --session --dest org.gnome.Shell --object-path /org/gnome/Shell/Extensions/MouseFollowsFocus \
    --method org.gnome.Shell.Extensions.MouseFollowsFocus.FocusWorkspace $WORSPACE_NUMBER # 1,2,3,etc..

Hide the Overview

gdbus call --session --dest org.gnome.Shell --object-path /org/gnome/Shell/Extensions/MouseFollowsFocus \
    --method org.gnome.Shell.Extensions.MouseFollowsFocus.HideOverview

Clear all Notifications

gdbus call --session --dest org.gnome.Shell --object-path /org/gnome/Shell/Extensions/MouseFollowsFocus \
    --method org.gnome.Shell.Extensions.MouseFollowsFocus.ClearNotifications

Contributing

Contributions are welcome! Feel free to open issues or submit pull requests to improve the extension.

Acknowledgments

This extension is based on the amazing GNOME Shell Extensions typescript template made by swsnr.