Skip to content

Quick Settings hotspot toggle for GNOME Shell, plus a companion script.

License

Notifications You must be signed in to change notification settings

shell-extensions/gnome-hotspot

Repository files navigation

GNOME Hotspot Toggle

GNOME Shell License: GPL-2.0

English | Deutsch | Español

A small GNOME Shell extension and companion script to toggle a NetworkManager Wi-Fi hotspot and set up basic NAT/iptables rules.

Screenshots

Hotspot on Hotspot off

Features

  • Quick Settings toggle for GNOME Shell 46/47/48.
  • CLI script for manual use or automation.
  • Optional desktop entry launcher.
  • Sets up NAT/forwarding for hotspot traffic.

Repository Layout

  • hotspot-toggle: main Bash script.
  • [email protected]/: extension sources and bundled script.
  • hotspot-toggle.desktop: desktop entry.
  • install.sh: installer and sudoers setup.

Requirements

  • NetworkManager with nmcli
  • iptables, sysctl, notify-send
  • gnome-extensions (for enabling the extension)
  • sudo access (to install the sudoers entry)

Install

Run the installer and enter your sudo password when prompted:

./install.sh

This installs:

  • ~/.local/bin/hotspot-toggle
  • ~/.local/share/applications/hotspot-toggle.desktop
  • ~/.local/share/gnome-shell/extensions/[email protected]/
  • /etc/sudoers.d/hotspot-toggle

Ensure ~/.local/bin is on your PATH, or invoke the script with the full path. If you rely on the desktop entry, refresh the cache:

update-desktop-database ~/.local/share/applications

Usage

Toggle from the command line:

hotspot-toggle

Pin a specific Wi-Fi interface:

HOTSPOT_WIFI_IF=wlp2s0 hotspot-toggle

The script expects the connection name Hotspot (the default created by nmcli dev wifi hotspot). If your connection uses a different name, update HOTSPOT_NAME in hotspot-toggle.

GNOME Shell Extension

Enable it:

gnome-extensions enable [email protected]

Reload GNOME Shell if needed (Xorg: Alt+F2 then r; Wayland: log out/in).

Uninstall

rm -f ~/.local/bin/hotspot-toggle
rm -f ~/.local/share/applications/hotspot-toggle.desktop
rm -rf ~/.local/share/gnome-shell/extensions/[email protected]
sudo rm -f /etc/sudoers.d/hotspot-toggle

Security Notes

The installer adds a NOPASSWD sudoers entry for specific iptables and sysctl commands. Review /etc/sudoers.d/hotspot-toggle before using in sensitive environments.

License

GPL-2.0. See LICENSE.

About

Quick Settings hotspot toggle for GNOME Shell, plus a companion script.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published