Skip to content

akmalkadi/cinnamon-alt-tab-current-monitor-toggle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

Cinnamon Alt-Tab: Current-Monitor Toggle

Adds a “Show windows from current monitor only” option to Cinnamon’s Alt-Tab.
Includes a safe patch/unpatch script that edits the Cinnamon schema, Settings panel, and app switcher JS, recompiles schemas, and restarts Cinnamon automatically.

  • ✅ Detects existing/manual patches (won’t duplicate changes)
  • ✅ Clearly marked BEGIN/END blocks for clean removal
  • ✅ Timestamped backups of modified files
  • status command to inspect current state

What it changes

  1. Schema: Adds alttab-switcher-show-current-monitor to org.cinnamon.gschema.xml (default false)
  2. Settings → Windows: Adds a toggle row in cs_windows.py
  3. Alt-Tab logic: Makes appSwitcher.js filter to current monitor when the key is true

The script compiles schemas and runs cinnamon --replace automatically.


Requirements

  • Cinnamon desktop (Linux Mint or other distros with Cinnamon)
  • Root privileges to modify system files & compile schemas
  • Default paths (adjust in script if your distro differs):
    • /usr/share/glib-2.0/schemas/org.cinnamon.gschema.xml
    • /usr/share/cinnamon/cinnamon-settings/modules/cs_windows.py
    • /usr/share/cinnamon/js/ui/appSwitcher/appSwitcher.js

Screenshots

Before

Before

After

After


Install

git clone https://github.com/<your-username>/cinnamon-alt-tab-current-monitor-toggle.git
cd cinnamon-alt-tab-current-monitor-toggle
chmod +x cinnamon-current-monitor-toggle.sh

Usage

Apply patch

./cinnamon-current-monitor-toggle.sh patch

Enable/disable at runtime:

gsettings set org.cinnamon alttab-switcher-show-current-monitor true   # enable
gsettings set org.cinnamon alttab-switcher-show-current-monitor false  # disable

Unpatch (clean removal of our blocks)

./cinnamon-current-monitor-toggle.sh unpatch

If it detects manual/unmarked edits, it leaves them intact and warns you.

Status

./cinnamon-current-monitor-toggle.sh status

Shows presence of the schema key, settings toggle, JS logic, and whether our markers are present.


How detection works

  • Schema: Skips insertion if org.cinnamon already has the key
  • Settings: Skips if cs_windows.py already references the key
  • JS: Skips if appSwitcher.js already contains the logic (with or without our markers)

Unpatch removes only our BEGIN/END:CURRENT_MONITOR_PATCH blocks. Manual changes are not touched.


Safety & recovery

  • Backups are created next to each modified file (e.g. *.bak.YYYYMMDD-HHMMSS)
  • If Cinnamon doesn’t come back after restart, log out/in or run:
    cinnamon --replace &

Notes

  • GSettings overrides (*.gschema.override) cannot add new keys; we edit the schema and recompile.
  • Distro updates may overwrite these files; simply run patch again if needed.

License

MIT — see LICENSE.

About

One-command patch/unpatch to filter Alt-Tab to the current monitor in Cinnamon. Edits schema + settings + JS with clear markers, compiles GSettings schemas, and runs cinnamon --replace. Backups included; unpatch removes changes cleanly.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages