182 Commits

Author SHA1 Message Date
Dome e6c8ef7f34 Update README.md 2026-04-21 11:59:34 +02:00
Dome 5b975187ba Update README.md 2026-04-12 22:13:25 +02:00
Dome fed6486932 Update README.md 2026-04-12 22:12:58 +02:00
Dome a7994f6742 Update README.md 2026-04-12 22:12:18 +02:00
Dome efd6bef0c4 Update README.md 2026-04-12 21:40:57 +02:00
Dome c9cbb56805 Update README.md 2026-04-12 21:40:04 +02:00
Dome d3fafa15ff add Zeitfresser Matrix Community Badge to readme.md 2026-04-12 21:32:51 +02:00
Dome 8db89fc155 Update Makefile 2025-10-11 22:22:35 +02:00
Dome 39e8a3541b Update enterprise.js 2025-10-11 22:12:59 +02:00
Dome 47f5a734be Update interim.js 2025-10-11 22:12:33 +02:00
Dome 1d5cdf480c Update modern.js 2025-10-11 22:12:13 +02:00
Dome 5f09053e06 Update enterprise.js 2025-10-01 16:44:20 +02:00
Dome 2295756f19 Update enterprise.js 2025-10-01 16:28:43 +02:00
Dome 58b4e746b6 Update interim.js 2025-10-01 16:28:03 +02:00
Dome e37cc5f8f4 Update legacy.js 2025-10-01 16:26:50 +02:00
Dome f10d3f0adf Update prefs_enterprise.js 2025-10-01 16:26:28 +02:00
Dome 528bf11371 Update prefs_interim.js 2025-10-01 16:26:02 +02:00
Dome 0598fa615d Update prefs_legacy.js 2025-10-01 16:25:45 +02:00
Dome 2e61ade64f Update prefs_modern.js 2025-10-01 16:25:02 +02:00
Dome 37e8a149f1 Update Makefile 2025-10-01 09:56:42 +02:00
Dome ef67c2d187 Update README.md 2025-10-01 09:47:02 +02:00
Dome 56ad942f24 Create prefs_enterprise.js 2025-10-01 09:43:12 +02:00
Dome ba04453c65 Create metadata_enterprise.json.in 2025-10-01 09:42:47 +02:00
Dome fd174e084e Create enterprise.js 2025-10-01 09:42:14 +02:00
Dome 6ade2e1520 Update Makefile 2025-10-01 09:41:35 +02:00
Dome b2099a6c1e Update metadata_interim.json.in 2025-09-30 17:10:30 +02:00
Dome 034bdcb05b Update Makefile 2025-09-29 20:08:56 +02:00
Dome 6d7acefed9 Update interim.js 2025-09-29 20:06:10 +02:00
Dome ef098d8986 Update modern.js 2025-09-29 09:39:12 +02:00
Dome 18d698cf7e Update interim.js 2025-09-29 09:15:19 +02:00
Dome 0aa80fda6a Update interim.js 2025-09-29 09:13:23 +02:00
Dome 7e51b5ff62 Update modern.js 2025-09-29 09:00:15 +02:00
Dome fe41ea8312 Update modern.js
fixes error "Fails on GNOME Shell 48.3 with TypeError get_session not a function" on modern.,js
2025-09-29 08:56:34 +02:00
Dome 5020250699 Update README.md 2025-09-28 23:33:32 +02:00
Dome 16688d6996 Update README.md 2025-09-28 23:17:24 +02:00
Dome 6b8ac746aa Update modern.js 2025-09-28 23:16:42 +02:00
Dome bcc5044cf8 Update prefs_modern.js 2025-09-28 23:15:56 +02:00
Dome e2df9fb038 Delete metadata_gnome45-48.json.in 2025-09-28 23:11:46 +02:00
Dome 5e23390911 Delete prefs_gnome45-48.js 2025-09-28 23:11:27 +02:00
Dome 7ba8dd1b0f Delete gnome45-48.js 2025-09-28 23:11:18 +02:00
Dome 849e2dc177 Update metadata_modern.json.in 2025-09-28 23:11:03 +02:00
Dome 982ca71642 Update modern.js 2025-09-28 23:10:43 +02:00
Dome a62c2307f9 Merge pull request #13 from ValerioCataldo/gnome49-comp
Gnome 49 compatibility
2025-09-28 20:21:56 +00:00
Dome b1c4924276 Rename metadata_modern,json.in to metadata_modern.json.in 2025-09-28 22:20:56 +02:00
Dome 73874fbd4b Rename prefs.interim.js to prefs_interim.js 2025-09-28 22:19:08 +02:00
valerio cataldo e4af31cb90 updating metadata 2025-09-27 13:26:15 +02:00
valerio cataldo b400189b4f split files 2025-09-27 13:23:26 +02:00
ValerioCataldo 568ceb7823 Merge branch 'Domoel:main' into gnome49-comp 2025-09-27 13:12:59 +02:00
valerio cataldo 138701a33d fixed for gnome49 2025-09-27 13:03:24 +02:00
Dome bbe09af89b Update interim.js 2025-08-22 12:37:08 +02:00
Dome 3331c84f31 Update Makefile 2025-08-22 12:34:32 +02:00
Dome 6591690c69 Update interim.js 2025-08-22 12:27:05 +02:00
Dome 40bea7a937 Update prefs_modern.js 2025-08-22 12:25:30 +02:00
Dome 4ea80d27bf Update README.md 2025-08-13 03:33:25 +00:00
Dome 55dd6ca691 Update Makefile 2025-08-11 22:48:20 +02:00
Dome 573ddc2702 Update prefs_modern.js 2025-08-11 22:47:21 +02:00
Dome a4ce7f2613 Update prefs.interim.js 2025-08-11 22:47:03 +02:00
Dome f2971f2c1c Update README.md 2025-08-11 20:54:31 +02:00
Dome 72fee16254 Update README.md 2025-08-11 08:30:41 +00:00
Dome d127480261 Update README.md 2025-08-11 08:24:46 +00:00
Dome 24f5dba546 Update README.md 2025-08-11 02:17:29 +02:00
Dome c3c47dc025 Update legacy.js 2025-08-11 02:04:49 +02:00
Dome c83e987550 Update README.md 2025-08-11 01:59:15 +02:00
Dome f5c5890fe4 Create interim.js 2025-08-11 01:52:48 +02:00
Dome dd6b1d067e Create metadata_interim.json.in 2025-08-11 01:52:20 +02:00
Dome 18e5f4594c Create prefs.interim.js 2025-08-11 01:51:54 +02:00
Dome a101ad0988 Update Makefile 2025-08-11 01:51:17 +02:00
Dome 8feccbde10 Update legacy.js 2025-08-11 01:50:53 +02:00
Dome 7c9e3e8122 Update metadata_legacy.json.in 2025-08-11 01:50:23 +02:00
Dome b3e00c8f94 Update metadata_modern.json.in 2025-08-11 01:50:09 +02:00
Dome b50c2780d3 Update modern.js 2025-08-11 01:49:52 +02:00
Dome a09c934f1b Update prefs_legacy.js 2025-08-11 01:49:16 +02:00
Dome 9a9e724654 Update prefs_modern.js 2025-08-11 01:48:56 +02:00
Dome bb28c6b936 Update README.md 2025-07-31 21:58:25 +02:00
Dome 6bf3b17054 Update README.md 2025-07-31 16:47:34 +00:00
Dome 0e14ecbd18 Update README.md 2025-07-31 10:34:20 +02:00
Dome 20d9e94417 Update README.md 2025-07-31 10:33:35 +02:00
Dome 58ca81740b Update README.md 2025-07-31 10:31:47 +02:00
Dome 405871c0f3 Update README.md 2025-07-31 10:30:21 +02:00
Dome 053f5fe90a Update Makefile 2025-07-31 10:26:00 +02:00
Dome 6165bc6b62 Update Makefile 2025-07-31 10:22:17 +02:00
Dome 1289af64ce Update README.md 2025-07-31 10:08:23 +02:00
Dome 7ac6d58665 Update Makefile 2025-07-31 09:59:54 +02:00
Dome 6e03f07486 Update Makefile
added 

- make build-legacy-go   # Legacy-Ordner direkt nach ~/.local/…/extensions
- make build-modern-go   # Modern-Ordner direkt nach ~/.local/…/extensions
2025-07-31 09:58:20 +02:00
Dome f07c66101b Update README.md 2025-07-31 09:49:04 +02:00
Dome 992438d480 Update README.md 2025-07-31 09:47:03 +02:00
Dome a5b888b58f Update README.md 2025-07-31 09:44:51 +02:00
Dome 8a14b04958 Delete .gitignore 2025-07-30 15:45:31 +02:00
Dome c34cc0f48e Update README.md 2025-07-30 15:38:13 +02:00
Dome 825e35ff05 Update README.md 2025-07-30 15:37:09 +02:00
Dome cef62f2ad1 Update README.md 2025-07-30 11:08:59 +02:00
Dome 7422622b4d Update README.md 2025-07-30 11:07:27 +02:00
Dome f9cd5255c3 Update README.md 2025-07-30 11:06:37 +02:00
Dome 374f857152 Update README.md 2025-07-30 09:01:14 +02:00
Dome 81ea1db46f Update README.md 2025-07-30 00:35:37 +02:00
Dome 1b2025cb81 Update README.md 2025-07-30 00:34:55 +02:00
Dome 0a2c273a2b Update README.md 2025-07-30 00:10:54 +02:00
Dome 14357adb1e Update README.md 2025-07-30 00:09:41 +02:00
Dome 31a61478ad Update README.md 2025-07-30 00:08:25 +02:00
Dome 2eb304a16a Update LICENSE 2025-07-29 23:49:01 +02:00
Dome 8480e6ccaf Update exceptions.txt 2025-07-29 23:48:44 +02:00
Dome f7a86e51b1 Create Makefile 2025-07-29 23:48:26 +02:00
Dome 1afeb816c4 Create modern.js 2025-07-29 23:48:00 +02:00
Dome 83ceb4ce67 Update and rename extension.js to legacy.js 2025-07-29 23:47:41 +02:00
Dome 6e90d12ee9 Create metadata_modern.json.in 2025-07-29 23:47:07 +02:00
Dome 717ef0b16b Update and rename metadata.json to metadata_legacy.json.in 2025-07-29 23:46:47 +02:00
Dome 1896d992d0 Create prefs_modern.js 2025-07-29 23:46:15 +02:00
Dome 749e3a0275 Update and rename prefs.js to prefs_legacy.js 2025-07-29 23:45:53 +02:00
Dome 1daeb0e100 Update README.md 2025-07-28 08:40:59 +02:00
Dome defa7255df Update README.md 2025-07-28 08:40:21 +02:00
Dome 6031a36664 Update README.md 2025-07-28 08:39:59 +02:00
Dome 021c51040f Update README.md 2025-07-28 00:52:55 +02:00
Dome 98bfaaa3d5 Update README.md 2025-07-27 23:49:09 +02:00
Dome cb26f3aebb Update README.md 2025-07-27 23:47:22 +02:00
Dome d9bacba373 Add files via upload 2025-07-27 10:21:18 +00:00
Dome 4e26db91ea Delete schemas/gschemas.compiled 2025-07-27 12:20:53 +02:00
Dome 6f56a5c7c8 Update org.gnome.shell.extensions.simple-tiling.domoel.gschema.xml 2025-07-27 12:20:40 +02:00
Dome 6549e5bca3 Update prefs.js 2025-07-27 12:20:25 +02:00
Dome 553a1599c6 Update README.md 2025-07-27 12:16:06 +02:00
Dome 921928bd2a Update README.md 2025-07-27 12:14:30 +02:00
Dome 07f1d40726 Add files via upload 2025-07-27 10:13:35 +00:00
Dome 40f7ca64ef Delete schemas/gschemas.compiled 2025-07-27 12:13:22 +02:00
Dome 7d864878b4 Update org.gnome.shell.extensions.simple-tiling.domoel.gschema.xml 2025-07-27 12:13:04 +02:00
Dome 0c79ce6da1 Update extension.js 2025-07-27 12:12:38 +02:00
Dome 843ea1d819 Update metadata.json 2025-07-27 12:12:21 +02:00
Dome c7cf481e33 Update prefs.js 2025-07-27 12:12:08 +02:00
Dome 54172118e1 Update exceptions.txt 2025-07-27 12:11:50 +02:00
Dome 95eb37ddd0 Add files via upload 2025-07-25 14:58:40 +00:00
Dome fe3b242476 Update org.gnome.shell.extensions.simple-tiling.domoel.gschema.xml 2025-07-25 16:58:14 +02:00
Dome 5614e5fff2 Update extension.js 2025-07-25 16:57:56 +02:00
Dome 4de841d8b0 Update metadata.json 2025-07-25 16:57:38 +02:00
Dome b0586e9c36 Update prefs.js 2025-07-25 16:57:22 +02:00
Dome c39a6799e2 Update README.md 2025-07-25 09:37:11 +02:00
Dome c495c85e95 Update README.md 2025-07-25 09:35:41 +02:00
Dome ca9ea8fcff Update org.gnome.shell.extensions.simple-tiling.domoel.gschema.xml 2025-07-25 00:57:33 +02:00
Dome 0a122565b8 Update org.gnome.shell.extensions.simple-tiling.domoel.gschema.xml 2025-07-25 00:48:37 +02:00
Dome 524098ce68 Update prefs.js 2025-07-25 00:48:18 +02:00
Dome c5e692bb45 Update README.md 2025-07-25 00:27:51 +02:00
Dome 421fb8796f Update README.md 2025-07-25 00:27:17 +02:00
Dome b144a90902 Update org.gnome.shell.extensions.simple-tiling.domoel.gschema.xml 2025-07-25 00:14:51 +02:00
Dome 89982c883d Update extension.js 2025-07-25 00:14:31 +02:00
Dome 5204d40168 Update metadata.json 2025-07-25 00:14:12 +02:00
Dome 7b45cffeff Update prefs.js 2025-07-25 00:13:53 +02:00
Dome 560ca61e41 Update README.md 2025-07-25 00:13:00 +02:00
Dome 6e35a92e9e Update README.md 2025-07-25 00:12:19 +02:00
Dome 38baf60286 Update README.md 2025-07-24 12:08:48 +02:00
Dome 65f5447ea2 Update README.md 2025-07-24 12:08:15 +02:00
Dome 290d067287 Update README.md 2025-07-24 12:04:37 +02:00
Dome 87ab2e8669 Update prefs.js 2025-07-24 00:29:39 +02:00
Dome 209421f479 Update README.md 2025-07-24 00:14:46 +02:00
Dome dd2bc5e589 Update README.md 2025-07-24 00:08:29 +02:00
Dome 9148ef63c6 Update README.md 2025-07-24 00:08:12 +02:00
Dome 56ee5c8933 Create .gitignore 2025-07-24 00:03:59 +02:00
Dome 7a313f7fc4 Update README.md 2025-07-23 23:49:46 +02:00
Dome 62d2792889 Update README.md 2025-07-23 23:48:17 +02:00
Dome 7aa9a30375 Update README.md 2025-07-23 23:43:48 +02:00
Dome ecfc739cc8 Update README.md 2025-07-23 23:42:27 +02:00
Dome 2a94a1c04f Update org.gnome.shell.extensions.simple-tiling.domoel.gschema.xml 2025-07-23 23:36:45 +02:00
Dome 8c1dce1644 Update extension.js 2025-07-23 23:36:27 +02:00
Dome 6a5f421fdf Update metadata.json 2025-07-23 23:36:08 +02:00
Dome 10e9faf528 Update prefs.js 2025-07-23 23:35:52 +02:00
Dome bf492ceeb3 Update README.md 2025-07-23 22:46:06 +02:00
Dome a5ba875df0 Update README.md 2025-07-23 22:45:09 +02:00
Dome 90b8dd952e Update README.md 2025-07-23 22:04:52 +02:00
Dome f3e1a30aae Update README.md 2025-07-23 21:56:47 +02:00
Dome 3a998f943a Update README.md 2025-07-23 21:55:30 +02:00
Dome 0bb95a577d Update README.md 2025-07-23 21:53:44 +02:00
Dome a47cac9f43 Update README.md 2025-07-23 21:50:35 +02:00
Dome 8408c357a5 Delete schemas/gschemas.compiled 2025-07-23 21:41:10 +02:00
Dome d58381e4ec Update org.gnome.shell.extensions.simple-tiling.domoel.gschema.xml 2025-07-23 21:39:49 +02:00
Dome 7ed0b64ffb Update extension.js 2025-07-23 21:39:16 +02:00
Dome b8dcc27bf8 Update metadata.json 2025-07-23 21:39:00 +02:00
Dome 136f49456a Update prefs.js 2025-07-23 21:38:42 +02:00
Dome 09a2740ffe Update README.md 2025-07-23 18:03:30 +02:00
Dome adcb02c953 Update README.md 2025-07-23 18:03:14 +02:00
Dome c9eb0c0212 Update README.md 2025-07-23 18:02:52 +02:00
Dome b0d00f03ec Update README.md 2025-07-23 18:02:26 +02:00
Dome 134c6b2cb6 Update README.md 2025-07-23 17:10:54 +02:00
Dome c4aee6f610 Update README.md 2025-07-23 17:09:31 +02:00
Dome a6045b73a1 Update README.md 2025-07-23 17:08:14 +02:00
Dome 005795cbd9 Update README.md 2025-07-23 17:07:41 +02:00
Dome da86ae9cd2 Update README.md 2025-07-23 17:02:53 +02:00
22 changed files with 3394 additions and 618 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
MIT License
Copyright (c) 2025 Dome
Copyright (c) 2025 Domoel (https://github.com/Domoel/)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
+146
View File
@@ -0,0 +1,146 @@
###############################################################################
# Simple-Tiling Makefile
#
# make build → Erzeugt alle vier Versionen als Archivdatei
# make build-legacy → Erzeugt Legacy-ZIP (Shell 3.38)
# make build-enterprise → Erzeugt Enterprise-ZIP (Shell 40)
# make build-interim → Erzeugt Interim-ZIP (Shell 41-44)
# make build-modern → Erzeugt Modern-ZIP (Shell 45+)
# make install-legacy → Installiert Legacy Extension
# make install-enterprise → Installiert Enterprise Extension
# make install-interim → Installiert Interim Extension
# make install-modern → Installiert Modern Extension
# make clean → Bereinigt das Ausgangsverzeichnis
###############################################################################
UUID := simple-tiling@domoel
VERSION := 7.6
EXTDIR := $(HOME)/.local/share/gnome-shell/extensions
COMMON_FILES := schemas exceptions.txt locale *.css README.md LICENSE
LEGACY_PREFS := prefs_legacy.js
ENTERPRISE_PREFS := prefs_enterprise.js
INTERIM_PREFS := prefs_interim.js
MODERN_PREFS := prefs_modern.js
###############################################################################
# Helper: copies <file list> <dest>
###############################################################################
define copies
@for f in $(1) ; do \
if [ -e $$f ] ; then \
cp -r $$f $(2)/ ; \
fi ; \
done
endef
.PHONY: build build-legacy build-enterprise build-interim build-modern \
install-legacy install-enterprise install-interim install-modern clean
build: build-legacy build-enterprise build-interim build-modern
###############################################################################
# Erzeugt Legacy-ZIP (Shell 3.38)
###############################################################################
build-legacy:
@echo "==> Building LEGACY zip (for GNOME 3.38)..."
@rm -rf build && mkdir -p build/$(UUID)
$(call copies,$(COMMON_FILES),build/$(UUID))
@glib-compile-schemas build/$(UUID)/schemas
@cp legacy.js build/$(UUID)/extension.js
@cp $(LEGACY_PREFS) build/$(UUID)/prefs.js
@sed -e "s/__UUID__/$(UUID)/g" \
-e "s/__VERSION__/$(VERSION)/g" \
metadata_legacy.json.in > build/$(UUID)/metadata.json
@cd build && zip -qr ../$(UUID)-legacy-v$(VERSION).zip .
@rm -rf build
@echo "$(UUID)-legacy-v$(VERSION).zip created"
###############################################################################
# Erzeugt Enterprise-ZIP (Shell 40)
###############################################################################
build-enterprise:
@echo "==> Building ENTERPRISE zip (for GNOME 40)..."
@rm -rf build && mkdir -p build/$(UUID)
$(call copies,$(COMMON_FILES),build/$(UUID))
@glib-compile-schemas build/$(UUID)/schemas
@cp enterprise.js build/$(UUID)/extension.js
@cp $(ENTERPRISE_PREFS) build/$(UUID)/prefs.js
@sed -e "s/__UUID__/$(UUID)/g" \
-e "s/__VERSION__/$(VERSION)/g" \
metadata_enterprise.json.in > build/$(UUID)/metadata.json
@cd build && zip -qr ../$(UUID)-enterprise-v$(VERSION).zip .
@rm -rf build
@echo "$(UUID)-enterprise-v$(VERSION).zip created"
###############################################################################
# Erzeugt Interim-ZIP (Shell 41-44)
###############################################################################
build-interim:
@echo "==> Building INTERIM zip (for GNOME 41-44)..."
@rm -rf build && mkdir -p build/$(UUID)
$(call copies,$(COMMON_FILES),build/$(UUID))
@glib-compile-schemas build/$(UUID)/schemas
@cp interim.js build/$(UUID)/extension.js
@cp $(INTERIM_PREFS) build/$(UUID)/prefs.js
@sed -e "s/__UUID__/$(UUID)/g" \
-e "s/__VERSION__/$(VERSION)/g" \
metadata_interim.json.in > build/$(UUID)/metadata.json
@cd build && zip -qr ../$(UUID)-interim-v$(VERSION).zip .
@rm -rf build
@echo "$(UUID)-interim-v$(VERSION).zip created"
###############################################################################
# Erzeugt Modern-ZIP (Shell 45+)
###############################################################################
build-modern:
@echo "==> Building MODERN zip (for GNOME 45+)..."
@rm -rf build && mkdir -p build/$(UUID)
$(call copies,$(COMMON_FILES),build/$(UUID))
@glib-compile-schemas build/$(UUID)/schemas
@cp modern.js build/$(UUID)/extension.js
@cp $(MODERN_PREFS) build/$(UUID)/prefs.js
@sed -e "s/__UUID__/$(UUID)/g" \
-e "s/__VERSION__/$(VERSION)/g" \
metadata_modern.json.in > build/$(UUID)/metadata.json
@cd build && zip -qr ../$(UUID)-modern-v$(VERSION).zip .
@rm -rf build
@echo "$(UUID)-modern-v$(VERSION).zip created"
###############################################################################
# Installiert die verschiedenen Versionen
###############################################################################
install-legacy: build-legacy
@echo "==> Installing LEGACY Extension..."
@rm -rf $(EXTDIR)/$(UUID)
@unzip -q $(UUID)-legacy-v$(VERSION).zip -d $(EXTDIR)/$(UUID)
@rm -f $(UUID)-legacy-v$(VERSION).zip
@echo "✓ Legacy Extension installed to $(EXTDIR)/$(UUID). Restart GNOME Shell to apply."
install-enterprise: build-enterprise
@echo "==> Installing ENTERPRISE Extension..."
@rm -rf $(EXTDIR)/$(UUID)
@unzip -q $(UUID)-enterprise-v$(VERSION).zip -d $(EXTDIR)/$(UUID)
@rm -f $(UUID)-enterprise-v$(VERSION).zip
@echo "✓ Enterprise Extension installed to $(EXTDIR)/$(UUID). Restart GNOME Shell to apply."
install-interim: build-interim
@echo "==> Installing INTERIM Extension..."
@rm -rf $(EXTDIR)/$(UUID)
@unzip -q $(UUID)-interim-v$(VERSION).zip -d $(EXTDIR)/$(UUID)
@rm -f $(UUID)-interim-v$(VERSION).zip
@echo "✓ Interim Extension installed to $(EXTDIR)/$(UUID). Restart GNOME Shell to apply."
install-modern: build-modern
@echo "==> Installing MODERN Extension..."
@rm -rf $(EXTDIR)/$(UUID)
@unzip -q $(UUID)-modern-v$(VERSION).zip -d $(EXTDIR)/$(UUID)
@rm -f $(UUID)-modern-v$(VERSION).zip
@echo "✓ Modern Extension installed to $(EXTDIR)/$(UUID). Restart GNOME Shell to apply."
###############################################################################
# Bereinigt das Ausgangsverzeichnis
###############################################################################
clean:
@rm -f $(UUID)-*.zip
@echo "Build directory and ZIPs removed."
+88 -21
View File
@@ -1,36 +1,58 @@
# Simple Tiling
<p align="center">
<a href="https://ztfr.eu/matrix">
<img src="assets/community-badge.png" alt="Join Zeitfresser Matrix Community" height="70" />
</a>
</p>
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
![GNOME Shell Version](https://img.shields.io/badge/GNOME%20Shell-3.38-blue)
<h1 align="center">
Simple Tiling
</span>
<h4 align="center">
<span style="display:inline-flex; align-items:center; gap:12px;">
A lightweight, opinionated, and automatic tiling window manager for GNOME Shell
</span>
<p>
A lightweight, opinionated, and automatic tiling window manager for GNOME Shell 3.38.
<h6 align="center">
<a href="https://ztfr.eu">🏰 Website</a>
·
<a href="https://ztfr.eu/matrix">📰 Zeitfresser Matrix Community</a>
·
<a href="https://social.ztfr.eu/@dome">🐘 Mastodon</a>
·
<a href="https://look.ztfr.eu/#/#support:ztfr.eu">💬 Supportchat</a>
</h6>
<br>
<img width="2560" height="1440" alt="Simple-Tiling" src="https://github.com/user-attachments/assets/18fcbb34-3e0e-45b8-abe1-0e752b8d970c" />
<img width="2560" height="1440" alt="Simple-Tiling-v6" src="https://github.com/user-attachments/assets/eb0f7cc3-6a5a-4036-8a1e-8f945c52e55c" />
## Introduction
Simple Tiling is a GNOME Shell extension created for users who want a clean, predictable, and automatic tiling layout without the complexity of larger, more feature-heavy tiling extensions. It is designed to be simple to configure and intuitive to use, focusing on a core set of essential tiling features.
This extension was built from the ground up to be stable and performant on **GNOME Shell 3.38**.
This extension was built from the ground up to be stable and performant on **GNOME Shell 3.38**. However it is now also supporting modern gnome shells up to **version 49**.
## Features
* **Automatic Tiling:** Windows are automatically arranged into a master and stack layout without any manual intervention.
* **Master & Fibonacci Stack Layout:** The first window becomes the "master," occupying the left half of the screen. All subsequent windows form a "stack" on the right half, which is tiled using a space-efficient Fibonacci-style algorithm.
* **Configurable New Window Behavior:** Choose whether new windows open as the new master or are appended to the end of the stack.
* **Tiling Lock:** The layout is strict by default. If you manually move a window with the mouse and drop it in an empty space, it will automatically "snap back" to its designated tile position, preserving the integrity of the layout.
* **Interactive Window Swapping:**
* **Drag & Drop:** Swap any two windows by simply dragging one and dropping it over the other.
* **Keyboard Shortcuts:** A full set of keyboard shortcuts allows you to swap the focused window with the master or with its nearest neighbor in any direction (left, right, up, down).
* **Configurable Gaps:** Easily configure inner and outer gaps by editing variables directly in the `extension.js` code to achieve your desired aesthetic.
* **Interactive Window Focus Switcher:** Change the current window focus with a set of customizable keyboard shortcuts in every direction (left, right, up, down).
* **Simple Settings Panel:** A simple settings panel within the gnome extension manager menu to adjust key bindings, window gaps / margins and window behavior.
* **External Exception List:** Use a simple `exceptions.txt` file to list applications (by their `WM_CLASS`) that should be ignored by the tiling manager.
* **Smart Pop-up Handling:** Windows on the exception list, as well as dialogs and other pop-ups, are automatically centered and kept "always on top" for a smooth workflow.
* **Configurable Tiling Window Delays:** Easily configure the tiling window delays if you have race condition issues by editing variables directly in the `extension.js`.
## Requirements
Please note that this extension has been developed for a very specific environment:
Please note that this extension has been developed for a very specific environment. However, with the latest updates, I have ensured that modern Gnome Shells and Wayland are also supported.
* **GNOME Shell Version:** **3.38**
* **Session Type:** **X11** (Wayland is not supported).
* **GNOME Shell Version:** **3.38 - 49**
* **Session Type:** **X11** (Wayland is still in beta but should be fine!).
* **Monitor Setup:** **Single monitor only.** Multi-monitor support is not yet implemented.
## Installation
@@ -41,23 +63,39 @@ Use the [GNOME Shell Extensions website](https://extensions.gnome.org/extension/
#### Manual Installation
1. **Clone the repository** into your local extensions directory:
The repository includes a Makefile that produces readytoinstall ZIP packages for the three supported GnomeShell lines (a legacy build for Gnome-Shell 3.38, an enterprise build for Gnome-Shell 40, an interim build for Gnome-Shell 41 - 44 and a modern build for Gnome-Shell 45+).
1. **Clone the Source**
```bash
git clone https://github.com/Domoel/Simple-Tiling.git
cd Simple-Tiling
```
2. **Install the package that matches your GNOME-Shell version**
Open the Terminal within the Simple-Tiling directory and run
```bash
make install-legacy # Installs Legacy Extension (Gnome-Shell 3.38)
make install-enterprise # Installs Enterprise Extension (Gnome-Shell 40)
make install-interim # Installs Interim Extension (Gnome-Shell 41 - 44)
make install-modern # Installs Modern Extension (Gnome-Shell 45+)
```
**Note:** This command will directly install the extension in the choosen variant (legacy, interim or modern). If you want to manually create and upload the extension to your gnome extensions directory `(~/.local/share/gnome-shell/extensions)` you can just run `make build` to create all versions as .zip or `make build-legacy`, `make build-enterprise`, `make build-interim` or `make build-modern` to create them seperately as .zip. To enable them you need to unzip these archives and put them into your extensions directory.
4. **Reload the shell**
```bash
git clone https://github.com/Domoel/Simple-Tiling.git
Press Alt + F2, type r , hit ↩ (works for X11 and Wayland)
```
2. **Compile the GSettings schema.** This is a mandatory step for the keyboard shortcuts to work.
5. **Clean up (optional)**
```bash
cd ~/.local/share/gnome-shell/extensions/simple-tiling@domoel/
glib-compile-schemas schemas/
make clean # perform this command in the downloaded folder to remove builds and generated ZIPs
```
3. **Restart GNOME Shell.** Press `Alt` + `F2`, type `r`, and press `Enter`.
4. **Enable the extension** using the GNOME Extensions app or GNOME Tweaks.
## Configuration
#### Keyboard Shortcuts
All keyboard shortcuts can be configured through the standard GNOME Settings panel:
All keyboard shortcuts can be configured through the Settings panel of Simple Tiling (which can be found in the Gnome Extension Application):
1. Open **Settings**.
2. Navigate to **Keyboard** -> **View and Customize Shortcuts**.
3. Scroll down to the **Custom Shortcuts** section at the bottom.
@@ -65,12 +103,41 @@ All keyboard shortcuts can be configured through the standard GNOME Settings pan
#### Ignoring Applications (`exceptions.txt`)
To prevent an application from being tiled, you can add its `WM_CLASS` to the `exceptions.txt` file in the extension's directory.
To prevent an application from being tiled, you can add its `WM_CLASS` (x11) or `App ID` (Wayland) to the `exceptions.txt` file in the extension's directory.
* Each application's `WM_CLASS` should be on a new line.
* Each application's `WM_CLASS` or `App ID` should be on a new line.
* Lines starting with `#` are treated as comments and are ignored.
* The check is case-insensitive.
To find an application's `WM_CLASS`, open a terminal and run the command `xprop WM_CLASS`. Your cursor will turn into a crosshair. Click on the window of the application you want to exclude.
To find an application's `WM_CLASS`, open a terminal and run the command `xprop WM_CLASS`. Your cursor will turn into a crosshair. Click on the window of the application you want to exclude. To find the `App ID`, Press Alt + F2, type 'lg', and press Enter. In the Looking Glass window, click the "Windows" tab. Click on the desired window to see its details. Find the value for "app id" and add it to a new line below.
An Example of an exceptions.txt can be found in the repo.
Ignored applications will be opened screen centered and kept above all other windows. These applications can be moved across the screen in floating mode.
#### Adjusting inner and/or outer Window Gaps / Margins
You can adjust the window gap margins (inner gaps between windows, outer gaps horizontal as well as vertical) in the Settings panel of Simple Tiling (which can be found in the Gnome Extension Application).
#### Configurable New Window Behavior
A toogle setting allows you to control the behavior for newly opened windows. You can choose to either have them become the new master window (pushing the old master into the stack) or have them appended to the stack as the last window (Default).
#### Adjusting Tiling Window Delays
If you have race condition issues between mutter (Gnome WM) and the Simple Tiling extension, you can adjust the window delay settings (both for tiling windows as well as for centered application from the exceptions list) directly in the extensions.js (~/.local/share/gnome-shell/extensions/simple-tiling@domoel/extension.js). You will find the parameter at line 17 & 18. Defaults to "20" for General Tiling Window Delay and "5" for centered Apps on the Exception List.
## Future Development
This extension was built to solve a specific need. However, future enhancements could include:
* Multi-monitor support.
* Additional layout algorithms.
* A more detailed settings panel to configure other options via a GUI.
## Development & Support
If you need to get support or want to participate in the active development of this software, you can <a href="https://ztfr.eu/matrix">join our Zeitfresser Matrix Community</a> or the <a href="https://look.ztfr.eu/#/#support:ztfr.eu">Development & Support Channel</a> on Matrix.
## License
This project is licensed under the MIT License - see the `LICENSE` file for details.
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 277 KiB

+604
View File
@@ -0,0 +1,604 @@
////////////////////////////////////////////////////////////////
// Simple-Tiling ENTERPRISE (GNOME Shell 40 non-ESM) //
// © 2025 domoel MIT //
////////////////////////////////////////////////////////////////
// ── GLOBAL IMPORTS ───────────────────────────
const { Meta, Shell, Gio, GLib, Clutter } = imports.gi;
const Main = imports.ui.main;
const ExtensionUtils = imports.misc.extensionUtils;
const Me = ExtensionUtils.getCurrentExtension();
// ── CONST ────────────────────────────────────────────
const WM_SCHEMA = 'org.gnome.desktop.wm.keybindings';
const TILING_DELAY_MS = 20; // Change Tiling Window Delay
const CENTERING_DELAY_MS = 5; // Change Centered Window Delay
const KEYBINDINGS = {
'swap-master-window': (self) => self._swapWithMaster(),
'swap-left-window': (self) => self._swapInDirection('left'),
'swap-right-window': (self) => self._swapInDirection('right'),
'swap-up-window': (self) => self._swapInDirection('up'),
'swap-down-window': (self) => self._swapInDirection('down'),
'focus-left': (self) => self._focusInDirection('left'),
'focus-right': (self) => self._focusInDirection('right'),
'focus-up': (self) => self._focusInDirection('up'),
'focus-down': (self) => self._focusInDirection('down'),
};
// ── HELPERFUNCTION ────────────────────────────────────────
function getPointerXY() {
if (global.get_pointer) {
const [x, y] = global.get_pointer();
return [x, y];
}
const ev = Clutter.get_current_event();
if (ev) {
const coords = ev.get_coords();
if (Array.isArray(coords))
return coords;
}
const device = Clutter.get_default_backend()
.get_default_seat()
.get_pointer();
return device ? device.get_position() : [0, 0];
}
// ── INTERACTIONHANDLER ───────────────────────────────────
class InteractionHandler {
constructor(tiler) {
this.tiler = tiler;
this._settings = this.tiler.settings;
this._wmSettings = new Gio.Settings({ schema: WM_SCHEMA });
this._wmKeysToDisable = [];
this._savedWmShortcuts = {};
this._grabOpIds = [];
this._settingsChangedId = null;
}
enable() {
this._prepareWmShortcuts();
if (this._wmKeysToDisable.length)
this._wmKeysToDisable.forEach(k =>
this._wmSettings.set_value(k, new GLib.Variant('as', [])));
this._bindAllShortcuts();
this._settingsChangedId =
this._settings.connect('changed', () => this._onSettingsChanged());
this._grabOpIds.push(
global.display.connect('grab-op-begin',
(_, __, win) => { if (this.tiler.windows.includes(win))
this.tiler.grabbedWindow = win; })
);
this._grabOpIds.push(
global.display.connect('grab-op-end', () => this._onGrabEnd())
);
}
disable() {
if (this._wmKeysToDisable.length)
this._wmKeysToDisable.forEach(k =>
this._wmSettings.set_value(k, this._savedWmShortcuts[k]));
this._unbindAllShortcuts();
if (this._settingsChangedId) {
this._settings.disconnect(this._settingsChangedId);
this._settingsChangedId = null;
}
this._grabOpIds.forEach(id => global.display.disconnect(id));
this._grabOpIds = [];
}
_bind(key, handler) {
Main.wm.addKeybinding(
key,
this._settings,
Meta.KeyBindingFlags.NONE,
Shell.ActionMode.NORMAL,
(..._args) => handler(this)
);
}
_bindAllShortcuts() { for (const [k,h] of Object.entries(KEYBINDINGS)) this._bind(k, h); }
_unbindAllShortcuts(){ for (const k in KEYBINDINGS) Main.wm.removeKeybinding(k); }
_onSettingsChanged() {
this._unbindAllShortcuts();
this._bindAllShortcuts();
}
_prepareWmShortcuts() {
const schema = this._wmSettings.settings_schema;
if (!schema) return;
const keys = [];
const add = key => { if (schema.has_key(key)) keys.push(key); };
if (schema.has_key('toggle-tiled-left'))
keys.push('toggle-tiled-left', 'toggle-tiled-right');
else {
add('tile-left'); add('tile-right');
}
if (schema.has_key('toggle-maximized'))
keys.push('toggle-maximized');
else {
add('maximize'); add('unmaximize');
}
if (keys.length) {
this._wmKeysToDisable = keys;
keys.forEach(k => this._savedWmShortcuts[k] =
this._wmSettings.get_value(k));
}
}
_focusInDirection(direction) {
const src = global.display.get_focus_window();
if (!src || !this.tiler.windows.includes(src)) return;
const tgt = this._findTargetInDirection(src, direction);
if (tgt) tgt.activate(global.get_current_time());
}
_swapWithMaster() {
const w = this.tiler.windows;
if (w.length < 2) return;
const foc = global.display.get_focus_window();
if (!foc || !w.includes(foc)) return;
const idx = w.indexOf(foc);
if (idx > 0) [w[0], w[idx]] = [w[idx], w[0]];
else [w[0], w[1]] = [w[1], w[0]];
this.tiler.tileNow();
w[0]?.activate(global.get_current_time());
}
_swapInDirection(direction) {
const src = global.display.get_focus_window();
if (!src || !this.tiler.windows.includes(src)) return;
let tgt = null;
const idx = this.tiler.windows.indexOf(src);
if (idx === 0 && direction==='right' && this.tiler.windows.length>1)
tgt = this.tiler.windows[1];
else
tgt = this._findTargetInDirection(src, direction);
if (!tgt) return;
const tidx = this.tiler.windows.indexOf(tgt);
[this.tiler.windows[idx], this.tiler.windows[tidx]] =
[this.tiler.windows[tidx], this.tiler.windows[idx]];
this.tiler.tileNow();
src.activate(global.get_current_time());
}
_findTargetInDirection(src, dir) {
const sRect = src.get_frame_rect(), cand=[];
for (const win of this.tiler.windows) {
if (win===src) continue;
const r=win.get_frame_rect();
if (dir==='left' && r.x<sRect.x) cand.push(win);
if (dir==='right'&& r.x>sRect.x) cand.push(win);
if (dir==='up' && r.y<sRect.y) cand.push(win);
if (dir==='down' && r.y>sRect.y) cand.push(win);
}
if (!cand.length) return null;
let best=null, min=Infinity;
for (const w of cand) {
const r=w.get_frame_rect();
const dev = (dir==='left'||dir==='right')
? Math.abs(sRect.y - r.y)
: Math.abs(sRect.x - r.x);
if (dev<min){min=dev; best=w;}
}
return best;
}
_onGrabEnd() {
const grabbed = this.tiler.grabbedWindow;
if (!grabbed) return;
const tgt = this._findTargetUnderPointer(grabbed);
if (tgt) {
const a = this.tiler.windows.indexOf(grabbed);
const b = this.tiler.windows.indexOf(tgt);
[this.tiler.windows[a], this.tiler.windows[b]] =
[this.tiler.windows[b], this.tiler.windows[a]];
}
this.tiler.queueTile();
this.tiler.grabbedWindow = null;
}
_findTargetUnderPointer(exclude) {
const [x,y] = getPointerXY();
const wins = global.get_window_actors()
.map(a=>a.meta_window)
.filter(w=>w && w!==exclude &&
this.tiler.windows.includes(w) && (()=>{const f=w.get_frame_rect();
return x>=f.x && x<f.x+f.width &&
y>=f.y && y<f.y+f.height;})());
if (wins.length) return wins[wins.length-1];
let best=null, max=0, sRect=exclude.get_frame_rect();
for (const w of this.tiler.windows) {
if (w===exclude) continue;
const r=w.get_frame_rect();
const ovX=Math.max(0, Math.min(sRect.x+sRect.width, r.x+r.width)-Math.max(sRect.x,r.x));
const ovY=Math.max(0, Math.min(sRect.y+sRect.height,r.y+r.height)-Math.max(sRect.y,r.y));
const area=ovX*ovY;
if (area>max){max=area; best=w;}
}
return best;
}
}
// ── TILER ────────────────────────────────────────────────
class Tiler {
constructor(extension) {
this._extension = extension;
this.settings = this._extension.getSettings();
this.windows = [];
this.grabbedWindow = null;
this._signalIds = new Map();
this._tileInProgress = false;
this._innerGap = this.settings.get_int('inner-gap');
this._outerGapVertical= this.settings.get_int('outer-gap-vertical');
this._outerGapHorizontal = this.settings.get_int('outer-gap-horizontal');
this._tilingDelay = TILING_DELAY_MS;
this._centeringDelay = CENTERING_DELAY_MS;
this._exceptions = [];
this._interactionHandler = new InteractionHandler(this);
this._tileTimeoutId = null;
this._centerTimeoutIds= [];
}
enable() {
this._loadExceptions();
this._workspaceManager = global.workspace_manager;
this._signalIds.set('workspace-changed', {
object: this._workspaceManager,
id: this._workspaceManager.connect('active-workspace-changed',
()=>this._onActiveWorkspaceChanged())
});
this._connectToWorkspace();
this._interactionHandler.enable();
this._signalIds.set('settings-changed', {
object: this.settings,
id: this.settings.connect('changed', ()=>this._onSettingsChanged())
});
}
disable() {
if (this._tileTimeoutId) {
GLib.source_remove(this._tileTimeoutId);
this._tileTimeoutId = null;
}
this._centerTimeoutIds.forEach(id=>GLib.source_remove(id));
this._centerTimeoutIds = [];
this._interactionHandler.disable();
this._disconnectFromWorkspace();
for (const [,sig] of this._signalIds) {
try { sig.object.disconnect(sig.id); } catch {}
}
this._signalIds.clear();
this.windows = [];
}
_onSettingsChanged() {
this._innerGap = this.settings.get_int('inner-gap');
this._outerGapVertical = this.settings.get_int('outer-gap-vertical');
this._outerGapHorizontal= this.settings.get_int('outer-gap-horizontal');
this.queueTile();
}
_loadExceptions() {
const file = Gio.File.new_for_path(this._extension.path + '/exceptions.txt');
if (!file.query_exists(null)) { this._exceptions=[]; return; }
const [ok,data] = file.load_contents(null);
if (!ok) { this._exceptions=[]; return; }
const txt = new TextDecoder('utf-8').decode(data);
this._exceptions = txt.split('\n')
.map(l=>l.trim())
.filter(l=>l && !l.startsWith('#'))
.map(l=>l.toLowerCase());
}
_isException(win) {
if (!win) return false;
const wmClass = (win.get_wm_class() || "").toLowerCase();
const appId = (win.get_gtk_application_id() || "").toLowerCase();
return this._exceptions.includes(wmClass) || this._exceptions.includes(appId);
}
_isTileable(win) {
return (
win &&
!win.minimized &&
!this._isException(win) &&
win.get_window_type() === Meta.WindowType.NORMAL
);
}
_centerWindow(win) {
const timeoutId = GLib.timeout_add(
GLib.PRIORITY_DEFAULT,
this._centeringDelay,
() => {
const index = this._centerTimeoutIds.indexOf(timeoutId);
if (index > -1) this._centerTimeoutIds.splice(index, 1);
if (!win || !win.get_display()) return GLib.SOURCE_REMOVE;
if (win.get_maximized())
win.unmaximize(Meta.MaximizeFlags.BOTH);
const monitorIndex = win.get_monitor();
const workspace = this._workspaceManager.get_active_workspace();
const workArea = workspace.get_work_area_for_monitor(
monitorIndex
);
const frame = win.get_frame_rect();
win.move_frame(
true,
workArea.x + Math.floor((workArea.width - frame.width) / 2),
workArea.y +
Math.floor((workArea.height - frame.height) / 2)
);
GLib.idle_add(GLib.PRIORITY_DEFAULT, () => {
if (win.get_display()) {
if (typeof win.set_keep_above === "function")
win.set_keep_above(true);
else if (typeof win.make_above === "function")
win.make_above();
}
return GLib.SOURCE_REMOVE;
});
return GLib.SOURCE_REMOVE;
}
);
this._centerTimeoutIds.push(timeoutId);
}
_onWindowMinimizedStateChanged() {
this.queueTile();
}
_onWindowAdded(workspace, win) {
if (this.windows.includes(win)) return;
if (this._isException(win)) {
this._centerWindow(win);
return;
}
if (this._isTileable(win)) {
if (this.settings.get_string("new-window-behavior") === "master") {
this.windows.unshift(win);
} else {
this.windows.push(win);
}
const id = win.get_id();
this._signalIds.set(`unmanaged-${id}`, {
object: win,
id: win.connect("unmanaged", () =>
this._onWindowRemoved(null, win)
),
});
this._signalIds.set(`size-changed-${id}`, {
object: win,
id: win.connect("size-changed", () => {
if (!this.grabbedWindow) this.queueTile();
}),
});
this._signalIds.set(`minimized-${id}`, {
object: win,
id: win.connect("notify::minimized", () =>
this._onWindowMinimizedStateChanged()
),
});
this.queueTile();
}
}
_onWindowRemoved(workspace, win) {
const index = this.windows.indexOf(win);
if (index > -1) this.windows.splice(index, 1);
["unmanaged", "size-changed", "minimized"].forEach((prefix) => {
const key = `${prefix}-${win.get_id()}`;
if (this._signalIds.has(key)) {
const { object, id } = this._signalIds.get(key);
try {
object.disconnect(id);
} catch (e) {}
this._signalIds.delete(key);
}
});
this.queueTile();
}
_onActiveWorkspaceChanged() {
this._disconnectFromWorkspace();
this._connectToWorkspace();
}
_connectToWorkspace() {
const workspace = this._workspaceManager.get_active_workspace();
workspace
.list_windows()
.forEach((win) => this._onWindowAdded(workspace, win));
this._signalIds.set("window-added", {
object: workspace,
id: workspace.connect("window-added", (ws, win) =>
this._onWindowAdded(ws, win)
),
});
this._signalIds.set("window-removed", {
object: workspace,
id: workspace.connect("window-removed", (ws, win) =>
this._onWindowRemoved(ws, win)
),
});
this.queueTile();
}
_disconnectFromWorkspace() {
this.windows.slice().forEach((win) => this._onWindowRemoved(null, win));
["window-added", "window-removed"].forEach((key) => {
if (this._signalIds.has(key)) {
const { object, id } = this._signalIds.get(key);
try {
object.disconnect(id);
} catch (e) {}
this._signalIds.delete(key);
}
});
}
queueTile() {
if (this._tileInProgress || this._tileTimeoutId) return;
this._tileInProgress = true;
this._tileTimeoutId = GLib.timeout_add(
GLib.PRIORITY_DEFAULT,
this._tilingDelay,
() => {
this._tileWindows();
this._tileInProgress = false;
this._tileTimeoutId = null;
return GLib.SOURCE_REMOVE;
}
);
}
tileNow() {
if (!this._tileInProgress) {
this._tileWindows();
}
}
_splitLayout(windows, area) {
if (windows.length === 0) return;
if (windows.length === 1) {
windows[0].move_resize_frame(
true,
area.x,
area.y,
area.width,
area.height
);
return;
}
const gap = Math.floor(this._innerGap / 2);
const primaryWindows = [windows[0]];
const secondaryWindows = windows.slice(1);
let primaryArea, secondaryArea;
if (area.width > area.height) {
const primaryWidth = Math.floor(area.width / 2) - gap;
primaryArea = {
x: area.x,
y: area.y,
width: primaryWidth,
height: area.height,
};
secondaryArea = {
x: area.x + primaryWidth + this._innerGap,
y: area.y,
width: area.width - primaryWidth - this._innerGap,
height: area.height,
};
} else {
const primaryHeight = Math.floor(area.height / 2) - gap;
primaryArea = {
x: area.x,
y: area.y,
width: area.width,
height: primaryHeight,
};
secondaryArea = {
x: area.x,
y: area.y + primaryHeight + this._innerGap,
width: area.width,
height: area.height - primaryHeight - this._innerGap,
};
}
this._splitLayout(primaryWindows, primaryArea);
this._splitLayout(secondaryWindows, secondaryArea);
}
_tileWindows() {
const windowsToTile = this.windows.filter((win) => !win.minimized);
if (windowsToTile.length === 0) return;
const monitor = Main.layoutManager.primaryMonitor;
const workspace = this._workspaceManager.get_active_workspace();
const workArea = workspace.get_work_area_for_monitor(monitor.index);
const innerArea = {
x: workArea.x + this._outerGapHorizontal,
y: workArea.y + this._outerGapVertical,
width: workArea.width - 2 * this._outerGapHorizontal,
height: workArea.height - 2 * this._outerGapVertical,
};
windowsToTile.forEach((win) => {
if (win.get_maximized()) win.unmaximize(Meta.MaximizeFlags.BOTH);
});
if (windowsToTile.length === 1) {
windowsToTile[0].move_resize_frame(
true,
innerArea.x,
innerArea.y,
innerArea.width,
innerArea.height
);
return;
}
const gap = Math.floor(this._innerGap / 2);
const masterWidth = Math.floor(innerArea.width / 2) - gap;
const master = windowsToTile[0];
master.move_resize_frame(
true,
innerArea.x,
innerArea.y,
masterWidth,
innerArea.height
);
const stackArea = {
x: innerArea.x + masterWidth + this._innerGap,
y: innerArea.y,
width: innerArea.width - masterWidth - this._innerGap,
height: innerArea.height,
};
this._splitLayout(windowsToTile.slice(1), stackArea);
}
}
// ── EXTENSIONWRAPPER ──────────────────────────
let tiler;
function enable() {
tiler = new Tiler(Me);
tiler.enable();
}
function disable() {
if (tiler) {
tiler.disable();
tiler = null;
}
}
+32 -8
View File
@@ -1,11 +1,35 @@
# --- Ausnahmeliste für den Tiler ---
# Jede Zeile enthält die WM_CLASS einer Anwendung, die ignoriert werden soll.
# Die Groß- und Kleinschreibung wird ignoriert.
# --- Exception List for Tiling Windows ---
# Each line contains an application identifier (WM_CLASS for X11, or App ID for Wayland)
# that should be ignored by the tiling manager.
# For best results, add both identifiers for an application if they differ.
# Uppercase and lowercase letters are ignored.
# Befehl zum Finden der WM_CLASS:
# 1. Terminal öffnen
# 2. 'xprop WM_CLASS' eingeben und Enter drücken
# 3. Mit dem Kreuz auf das gewünschte Fenster klicken
# -----------------------------------------------------------
# Finding the App ID (for Wayland & modern apps)
# -----------------------------------------------------------
# 1. Press Alt + F2, type 'lg', and press Enter.
# 2. In the Looking Glass window, click the "Windows" tab.
# 3. Click on the desired window to see its details.
# 4. Find the value for "app id" and add it to a new line below.
# -----------------------------------------------------------
# Finding the WM_CLASS (for X11)
# -----------------------------------------------------------
# 1. Open a terminal.
# 2. Type 'xprop WM_CLASS' and press Enter.
# 3. Your cursor will turn into a crosshair. Click on the desired window.
# 4. The terminal will output a line like: WM_CLASS(STRING) = "navigator", "Firefox".
# 5. Add one of these values (e.g., "firefox") to a new line below.
# --- Start of the Exception List ---
ulauncher
steam
element
totem
extension-manager
timeshift-gtk
gnome-screenshot
org.gnome.NautilusPreviewer
org.gnome.Shell.Extensions
evolution-alarm-notify
-446
View File
@@ -1,446 +0,0 @@
// Simple-Tiling GNOME Shell 3.38 (X11) - Version 1.0
// Features: Fibonacci-Stack-Layout (50/50) · Tiling-Lock · Drag- & Keyboard-Swap
// Pop-ups: zentriert + Always-on-Top + Exception-List
// © 2025 domoel MIT
// Global Imports
const Main = imports.ui.main;
const Meta = imports.gi.Meta;
const Shell = imports.gi.Shell;
const Mainloop = imports.mainloop;
const Gio = imports.gi.Gio;
const GLib = imports.gi.GLib;
const ExtensionUtils = imports.misc.extensionUtils;
const ByteArray = imports.byteArray;
const Me = ExtensionUtils.getCurrentExtension();
const SCHEMA_NAME = 'org.gnome.shell.extensions.simple-tiling.domoel';
const WM_SCHEMA = 'org.gnome.desktop.wm.keybindings';
// InteractionHandler
// Verwaltung aller Nutzerinteraktionen (Maus & Tastatur)
class InteractionHandler {
constructor(tiler) {
this.tiler = tiler;
this._settings = ExtensionUtils.getSettings(SCHEMA_NAME);
this._wmSettings = new Gio.Settings({ schema: WM_SCHEMA });
this._wmKeysToDisable = [];
this._savedWmShortcuts = {};
this._grabOpIds = [];
this._settingsChangedId = null;
this._onSettingsChanged = this._onSettingsChanged.bind(this);
this._prepareWmShortcuts();
}
enable() {
if (this._wmKeysToDisable.length) {
this._wmKeysToDisable.forEach(key => this._wmSettings.set_value(key, new GLib.Variant('as', [])));
}
this._bindAllShortcuts();
this._settingsChangedId = this._settings.connect('changed', this._onSettingsChanged);
this._grabOpIds.push(global.display.connect('grab-op-begin', (display, screen, window) => {
if (this.tiler.windows.includes(window)) { this.tiler.grabbedWindow = window; }
}));
this._grabOpIds.push(global.display.connect('grab-op-end', this._onGrabEnd.bind(this)));
}
disable() {
if (this._wmKeysToDisable.length) {
this._wmKeysToDisable.forEach(key => this._wmSettings.set_value(key, this._savedWmShortcuts[key]));
}
this._unbindAllShortcuts();
if (this._settingsChangedId) {
this._settings.disconnect(this._settingsChangedId);
this._settingsChangedId = null;
}
this._grabOpIds.forEach(id => global.display.disconnect(id));
}
_bind(key, callback) {
Main.wm.addKeybinding(key, this._settings, Meta.KeyBindingFlags.NONE, Shell.ActionMode.NORMAL, callback.bind(this));
}
_bindAllShortcuts() {
this._bind('swap-master-window', this._swapWithMaster);
this._bind('swap-left-window', () => this._swapInDirection('left'));
this._bind('swap-right-window', () => this._swapInDirection('right'));
this._bind('swap-up-window', () => this._swapInDirection('up'));
this._bind('swap-down-window', () => this._swapInDirection('down'));
}
_unbindAllShortcuts() {
['swap-master-window', 'swap-left-window', 'swap-right-window', 'swap-up-window', 'swap-down-window']
.forEach(key => Main.wm.removeKeybinding(key));
}
_onSettingsChanged() {
this._unbindAllShortcuts();
this._bindAllShortcuts();
}
_prepareWmShortcuts() {
const schema = this._wmSettings.settings_schema;
const keys = [];
if (schema.has_key('toggle-tiled-left')) keys.push('toggle-tiled-left', 'toggle-tiled-right');
else if (schema.has_key('tile-left')) keys.push('tile-left', 'tile-right');
if (schema.has_key('toggle-maximized')) keys.push('toggle-maximized');
else {
if (schema.has_key('maximize')) keys.push('maximize');
if (schema.has_key('unmaximize')) keys.push('unmaximize');
}
if (keys.length) {
this._wmKeysToDisable = keys;
keys.forEach(key => this._savedWmShortcuts[key] = this.tiler.wmSettings.get_value(key));
}
}
_swapWithMaster() {
const windows = this.tiler.windows;
if (windows.length < 2) return;
const focusedWindow = global.display.get_focus_window();
if (!focusedWindow || !windows.includes(focusedWindow)) return;
const focusedIndex = windows.indexOf(focusedWindow);
if (focusedIndex > 0) {
[windows[0], windows[focusedIndex]] = [windows[focusedIndex], windows[0]];
} else if (focusedIndex === 0) {
[windows[0], windows[1]] = [windows[1], windows[0]];
}
this.tiler.tileNow();
if (windows.length > 0) windows[0].activate(global.get_current_time());
}
_swapInDirection(direction) {
const sourceWindow = global.display.get_focus_window();
if (!sourceWindow || !this.tiler.windows.includes(sourceWindow)) return;
let targetWindow = null;
const sourceIndex = this.tiler.windows.indexOf(sourceWindow);
if (sourceIndex === 0 && direction === 'right' && this.tiler.windows.length > 1) {
targetWindow = this.tiler.windows[1];
} else {
targetWindow = this._findTargetInDirection(sourceWindow, direction);
}
if (!targetWindow) return;
const targetIndex = this.tiler.windows.indexOf(targetWindow);
[this.tiler.windows[sourceIndex], this.tiler.windows[targetIndex]] = [this.tiler.windows[targetIndex], this.tiler.windows[sourceIndex]];
this.tiler.tileNow();
sourceWindow.activate(global.get_current_time());
}
_findTargetInDirection(source, direction) {
const sourceRect = source.get_frame_rect();
let candidates = [];
for (const win of this.tiler.windows) {
if (win === source) continue;
const targetRect = win.get_frame_rect();
switch (direction) {
case 'left': if (targetRect.x < sourceRect.x) candidates.push(win); break;
case 'right': if (targetRect.x > sourceRect.x) candidates.push(win); break;
case 'up': if (targetRect.y < sourceRect.y) candidates.push(win); break;
case 'down': if (targetRect.y > sourceRect.y) candidates.push(win); break;
}
}
if (candidates.length === 0) return null;
let bestTarget = null;
let minDeviation = Infinity;
for (const win of candidates) {
const targetRect = win.get_frame_rect();
let deviation;
if (direction === 'left' || direction === 'right') {
deviation = Math.abs(sourceRect.y - targetRect.y);
} else {
deviation = Math.abs(sourceRect.x - targetRect.x);
}
if (deviation < minDeviation) {
minDeviation = deviation;
bestTarget = win;
}
}
return bestTarget;
}
_onGrabEnd() {
const grabbedWindow = this.tiler.grabbedWindow;
if (!grabbedWindow) return;
const targetWindow = this._findTargetUnderPointer(grabbedWindow);
if (targetWindow) {
const sourceIndex = this.tiler.windows.indexOf(grabbedWindow);
const targetIndex = this.tiler.windows.indexOf(targetWindow);
[this.tiler.windows[sourceIndex], this.tiler.windows[targetIndex]] = [this.tiler.windows[targetIndex], this.tiler.windows[sourceIndex]];
}
this.tiler.queueTile();
this.tiler.grabbedWindow = null;
}
_findTargetUnderPointer(excludeWindow) {
let [pointerX, pointerY] = global.get_pointer();
let windows = global.get_window_actors().map(actor => actor.meta_window).filter(win => {
if (!win || win === excludeWindow || !this.tiler.windows.includes(win)) return false;
let frame = win.get_frame_rect();
return pointerX >= frame.x && pointerX < frame.x + frame.width &&
pointerY >= frame.y && pointerY < frame.y + frame.height;
});
if (windows.length > 0) { return windows[windows.length - 1]; }
let bestTarget = null;
let maxOverlap = 0;
const sourceFrame = excludeWindow.get_frame_rect();
for (const win of this.tiler.windows) {
if (win === excludeWindow) continue;
const targetFrame = win.get_frame_rect();
const overlapX = Math.max(0, Math.min(sourceFrame.x + sourceFrame.width, targetFrame.x + targetFrame.width) - Math.max(sourceFrame.x, targetFrame.x));
const overlapY = Math.max(0, Math.min(sourceFrame.y + sourceFrame.height, targetFrame.y + targetFrame.height) - Math.max(sourceFrame.y, targetFrame.y));
const overlapArea = overlapX * overlapY;
if (overlapArea > maxOverlap) {
maxOverlap = overlapArea;
bestTarget = win;
}
}
return bestTarget;
}
}
// Tiler
// Die Hauptklasse für die Tiling-Logik.
class Tiler {
constructor() {
this.windows = [];
this.grabbedWindow = null;
this.wmSettings = new Gio.Settings({ schema: WM_SCHEMA });
this._signalIds = new Map();
this._tileInProgress = false;
// Layout-Konfiguration
this._innerGap = 10;
this._outerGapVertical = 5;
this._outerGapHorizontal = 10;
// Delay-Zeiten für das Tiling und Exception Windows
this._tilingDelay = 20;
this._centeringDelay = 5;
this._exceptions = [];
this._interactionHandler = new InteractionHandler(this);
this._onWindowAdded = this._onWindowAdded.bind(this);
this._onWindowRemoved = this._onWindowRemoved.bind(this);
this._onActiveWorkspaceChanged = this._onActiveWorkspaceChanged.bind(this);
this._onWindowMinimizedStateChanged = this._onWindowMinimizedStateChanged.bind(this);
}
enable() {
this._loadExceptions();
const workspaceManager = global.workspace_manager;
this._signalIds.set('workspace-changed', { object: workspaceManager, id: workspaceManager.connect('active-workspace-changed', this._onActiveWorkspaceChanged) });
this._connectToWorkspace();
this._interactionHandler.enable();
}
disable() {
this._interactionHandler.disable();
this._disconnectFromWorkspace();
for (const [, signal] of this._signalIds) {
try { signal.object.disconnect(signal.id); } catch(e) {}
}
this._signalIds.clear();
this.windows = [];
}
_loadExceptions() {
const file = Gio.file_new_for_path(Me.path + '/exceptions.txt');
if (!file.query_exists(null)) { this._exceptions = []; return; }
const [ok, data] = file.load_contents(null);
this._exceptions = ok ? ByteArray.toString(data).split('\n')
.map(l => l.trim()).filter(l => l && !l.startsWith('#'))
.map(l => l.toLowerCase()) : [];
}
_isException(win) {
return !!win && this._exceptions.includes((win.get_wm_class() || '').toLowerCase());
}
_isTileable(win) {
return win && !win.minimized && !this._isException(win) && win.get_window_type() === Meta.WindowType.NORMAL;
}
_centerWindow(win) {
Mainloop.timeout_add(this._centeringDelay, () => {
if (!win || !win.get_display()) return GLib.SOURCE_REMOVE;
if (win.get_maximized()) { win.unmaximize(Meta.MaximizeFlags.BOTH); }
const monitorIndex = win.get_monitor();
const workArea = Main.layoutManager.getWorkAreaForMonitor(monitorIndex);
const frame = win.get_frame_rect();
win.move_frame(true,
workArea.x + Math.floor((workArea.width - frame.width) / 2),
workArea.y + Math.floor((workArea.height - frame.height) / 2));
Mainloop.idle_add(() => {
if (win.get_display()) {
if (typeof win.set_keep_above === 'function') win.set_keep_above(true);
else if (typeof win.make_above === 'function') win.make_above();
}
return GLib.SOURCE_REMOVE;
});
return GLib.SOURCE_REMOVE;
});
}
_onWindowMinimizedStateChanged() {
this.queueTile();
}
_onWindowAdded(workspace, win) {
if (this.windows.includes(win)) return;
if (this._isException(win)) {
this._centerWindow(win);
return;
}
if (this._isTileable(win)) {
this.windows.push(win);
const id = win.get_id();
this._signalIds.set(`unmanaged-${id}`, { object: win, id: win.connect('unmanaged', () => this._onWindowRemoved(null, win)) });
this._signalIds.set(`size-changed-${id}`, { object: win, id: win.connect('size-changed', () => { if (!this.grabbedWindow) this.queueTile(); }) });
this._signalIds.set(`minimized-${id}`, { object: win, id: win.connect('notify::minimized', this._onWindowMinimizedStateChanged) });
this.queueTile();
}
}
_onWindowRemoved(workspace, win) {
const index = this.windows.indexOf(win);
if (index > -1) {
this.windows.splice(index, 1);
}
['unmanaged', 'size-changed', 'minimized'].forEach(prefix => {
const key = `${prefix}-${win.get_id()}`;
if (this._signalIds.has(key)) {
const { object, id } = this._signalIds.get(key);
try { object.disconnect(id); } catch(e) {}
this._signalIds.delete(key);
}
});
this.queueTile();
}
_onActiveWorkspaceChanged() {
this._disconnectFromWorkspace();
this._connectToWorkspace();
}
_connectToWorkspace() {
const workspace = global.workspace_manager.get_active_workspace();
workspace.list_windows().forEach(win => this._onWindowAdded(workspace, win));
this._signalIds.set('window-added', { object: workspace, id: workspace.connect('window-added', this._onWindowAdded) });
this._signalIds.set('window-removed', { object: workspace, id: workspace.connect('window-removed', this._onWindowRemoved) });
this.queueTile();
}
_disconnectFromWorkspace() {
this.windows.slice().forEach(win => this._onWindowRemoved(null, win));
['window-added', 'window-removed'].forEach(key => {
if (this._signalIds.has(key)) {
const { object, id } = this._signalIds.get(key);
try { object.disconnect(id); } catch(e) {}
this._signalIds.delete(key);
}
});
}
queueTile() {
if (this._tileInProgress) return;
this._tileInProgress = true;
Mainloop.timeout_add(this._tilingDelay, () => {
this._tileWindows();
this._tileInProgress = false;
return GLib.SOURCE_REMOVE;
});
}
tileNow() {
if (!this._tileInProgress) {
this._tileWindows();
}
}
_splitLayout(windows, area) {
if (windows.length === 0) return;
if (windows.length === 1) {
windows[0].move_resize_frame(true, area.x, area.y, area.width, area.height);
return;
}
const gap = Math.floor(this._innerGap / 2);
const primaryWindows = [windows[0]];
const secondaryWindows = windows.slice(1);
let primaryArea, secondaryArea;
if (area.width > area.height) {
const primaryWidth = Math.floor(area.width / 2) - gap;
primaryArea = { x: area.x, y: area.y, width: primaryWidth, height: area.height };
secondaryArea = { x: area.x + primaryWidth + this._innerGap, y: area.y, width: area.width - primaryWidth - this._innerGap, height: area.height };
} else {
const primaryHeight = Math.floor(area.height / 2) - gap;
primaryArea = { x: area.x, y: area.y, width: area.width, height: primaryHeight };
secondaryArea = { x: area.x, y: area.y + primaryHeight + this._innerGap, width: area.width, height: area.height - primaryHeight - this._innerGap };
}
this._splitLayout(primaryWindows, primaryArea);
this._splitLayout(secondaryWindows, secondaryArea);
}
_tileWindows() {
const windowsToTile = this.windows.filter(win => !win.minimized);
if (windowsToTile.length === 0) return;
const monitor = Main.layoutManager.primaryMonitor;
const workArea = Main.layoutManager.getWorkAreaForMonitor(monitor.index);
const innerArea = {
x: workArea.x + this._outerGapHorizontal,
y: workArea.y + this._outerGapVertical,
width: workArea.width - 2 * this._outerGapHorizontal,
height: workArea.height - 2 * this._outerGapVertical
};
windowsToTile.forEach(win => { if (win.get_maximized()) win.unmaximize(Meta.MaximizeFlags.BOTH); });
if (windowsToTile.length === 1) {
windowsToTile[0].move_resize_frame(true, innerArea.x, innerArea.y, innerArea.width, innerArea.height);
return;
}
const gap = Math.floor(this._innerGap / 2);
const masterWidth = Math.floor(innerArea.width / 2) - gap;
const master = windowsToTile[0];
master.move_resize_frame(true, innerArea.x, innerArea.y, masterWidth, innerArea.height);
const stackArea = {
x: innerArea.x + masterWidth + this._innerGap,
y: innerArea.y,
width: innerArea.width - masterWidth - this._innerGap,
height: innerArea.height
};
this._splitLayout(windowsToTile.slice(1), stackArea);
}
}
// Extension Wrapper
class SimpleTilingExtension {
constructor() {
this.tiler = null;
}
enable() {
this.tiler = new Tiler();
this.tiler.enable();
}
disable() {
if (this.tiler) {
this.tiler.disable();
this.tiler = null;
}
}
}
function init() {
return new SimpleTilingExtension();
}
+607
View File
@@ -0,0 +1,607 @@
///////////////////////////////////////////////////////////////
// SimpleTiling  INTERIM (GNOME Shell 41 - 44) //
// © 2025domoel  MIT //
/////////////////////////////////////////////////////////////
// ── GLOBAL IMPORTS ────────────────────────────────────────
import Meta from 'gi://Meta';
import Shell from 'gi://Shell';
import Gio from 'gi://Gio';
import GLib from 'gi://GLib';
import Clutter from 'gi://Clutter';
import { Extension } from 'resource:///org/gnome/shell/extensions/js/extensions/extension.js';
import * as Main from 'resource:///org/gnome/shell/ui/main.js';
// ── CONST ────────────────────────────────────────────
const WM_SCHEMA = 'org.gnome.desktop.wm.keybindings';
const TILING_DELAY_MS = 20; // Change Tiling Window Delay
const CENTERING_DELAY_MS = 5; // Change Centered Window Delay
const KEYBINDINGS = {
'swap-master-window': (self) => self._swapWithMaster(),
'swap-left-window': (self) => self._swapInDirection('left'),
'swap-right-window': (self) => self._swapInDirection('right'),
'swap-up-window': (self) => self._swapInDirection('up'),
'swap-down-window': (self) => self._swapInDirection('down'),
'focus-left': (self) => self._focusInDirection('left'),
'focus-right': (self) => self._focusInDirection('right'),
'focus-up': (self) => self._focusInDirection('up'),
'focus-down': (self) => self._focusInDirection('down'),
};
// ── HELPERFUNCTION ────────────────────────────────────────
function getPointerXY() {
if (global.get_pointer) {
const [x, y] = global.get_pointer();
return [x, y];
}
const ev = Clutter.get_current_event();
if (ev) {
const coords = ev.get_coords();
if (Array.isArray(coords))
return coords;
}
const device = Clutter.get_default_backend()
.get_default_seat()
.get_pointer();
return device ? device.get_position() : [0, 0];
}
// ── INTERACTIONHANDLER ───────────────────────────────────
class InteractionHandler {
constructor(tiler) {
this.tiler = tiler;
this._settings = this.tiler.settings;
this._wmSettings = new Gio.Settings({ schema: WM_SCHEMA });
this._wmKeysToDisable = [];
this._savedWmShortcuts = {};
this._grabOpIds = [];
this._settingsChangedId = null;
}
enable() {
this._prepareWmShortcuts();
if (this._wmKeysToDisable.length)
this._wmKeysToDisable.forEach(k =>
this._wmSettings.set_value(k, new GLib.Variant('as', [])));
this._bindAllShortcuts();
this._settingsChangedId =
this._settings.connect('changed', () => this._onSettingsChanged());
this._grabOpIds.push(
global.display.connect('grab-op-begin',
(_, __, win) => { if (this.tiler.windows.includes(win))
this.tiler.grabbedWindow = win; })
);
this._grabOpIds.push(
global.display.connect('grab-op-end', () => this._onGrabEnd())
);
}
disable() {
if (this._wmKeysToDisable.length)
this._wmKeysToDisable.forEach(k =>
this._wmSettings.set_value(k, this._savedWmShortcuts[k]));
this._unbindAllShortcuts();
if (this._settingsChangedId) {
this._settings.disconnect(this._settingsChangedId);
this._settingsChangedId = null;
}
this._grabOpIds.forEach(id => global.display.disconnect(id));
this._grabOpIds = [];
}
_bind(key, handler) {
Main.wm.addKeybinding(
key,
this._settings,
Meta.KeyBindingFlags.NONE,
Shell.ActionMode.NORMAL,
(..._args) => handler(this)
);
}
_bindAllShortcuts() { for (const [k,h] of Object.entries(KEYBINDINGS)) this._bind(k, h); }
_unbindAllShortcuts(){ for (const k in KEYBINDINGS) Main.wm.removeKeybinding(k); }
_onSettingsChanged() {
this._unbindAllShortcuts();
this._bindAllShortcuts();
}
_prepareWmShortcuts() {
const schema = this._wmSettings.settings_schema;
if (!schema) return;
const keys = [];
const add = key => { if (schema.has_key(key)) keys.push(key); };
if (schema.has_key('toggle-tiled-left'))
keys.push('toggle-tiled-left', 'toggle-tiled-right');
else {
add('tile-left'); add('tile-right');
}
if (schema.has_key('toggle-maximized'))
keys.push('toggle-maximized');
else {
add('maximize'); add('unmaximize');
}
if (keys.length) {
this._wmKeysToDisable = keys;
keys.forEach(k => this._savedWmShortcuts[k] =
this._wmSettings.get_value(k));
}
}
_focusInDirection(direction) {
const src = global.display.get_focus_window();
if (!src || !this.tiler.windows.includes(src)) return;
const tgt = this._findTargetInDirection(src, direction);
if (tgt) tgt.activate(global.get_current_time());
}
_swapWithMaster() {
const w = this.tiler.windows;
if (w.length < 2) return;
const foc = global.display.get_focus_window();
if (!foc || !w.includes(foc)) return;
const idx = w.indexOf(foc);
if (idx > 0) [w[0], w[idx]] = [w[idx], w[0]];
else [w[0], w[1]] = [w[1], w[0]];
this.tiler.tileNow();
w[0]?.activate(global.get_current_time());
}
_swapInDirection(direction) {
const src = global.display.get_focus_window();
if (!src || !this.tiler.windows.includes(src)) return;
let tgt = null;
const idx = this.tiler.windows.indexOf(src);
if (idx === 0 && direction==='right' && this.tiler.windows.length>1)
tgt = this.tiler.windows[1];
else
tgt = this._findTargetInDirection(src, direction);
if (!tgt) return;
const tidx = this.tiler.windows.indexOf(tgt);
[this.tiler.windows[idx], this.tiler.windows[tidx]] =
[this.tiler.windows[tidx], this.tiler.windows[idx]];
this.tiler.tileNow();
src.activate(global.get_current_time());
}
_findTargetInDirection(src, dir) {
const sRect = src.get_frame_rect(), cand=[];
for (const win of this.tiler.windows) {
if (win===src) continue;
const r=win.get_frame_rect();
if (dir==='left' && r.x<sRect.x) cand.push(win);
if (dir==='right'&& r.x>sRect.x) cand.push(win);
if (dir==='up' && r.y<sRect.y) cand.push(win);
if (dir==='down' && r.y>sRect.y) cand.push(win);
}
if (!cand.length) return null;
let best=null, min=Infinity;
for (const w of cand) {
const r=w.get_frame_rect();
const dev = (dir==='left'||dir==='right')
? Math.abs(sRect.y - r.y)
: Math.abs(sRect.x - r.x);
if (dev<min){min=dev; best=w;}
}
return best;
}
_onGrabEnd() {
const grabbed = this.tiler.grabbedWindow;
if (!grabbed) return;
const tgt = this._findTargetUnderPointer(grabbed);
if (tgt) {
const a = this.tiler.windows.indexOf(grabbed);
const b = this.tiler.windows.indexOf(tgt);
[this.tiler.windows[a], this.tiler.windows[b]] =
[this.tiler.windows[b], this.tiler.windows[a]];
}
this.tiler.queueTile();
this.tiler.grabbedWindow = null;
}
_findTargetUnderPointer(exclude) {
const [x,y] = getPointerXY();
const wins = global.get_window_actors()
.map(a=>a.meta_window)
.filter(w=>w && w!==exclude &&
this.tiler.windows.includes(w) && (()=>{const f=w.get_frame_rect();
return x>=f.x && x<f.x+f.width &&
y>=f.y && y<f.y+f.height;})());
if (wins.length) return wins[wins.length-1];
let best=null, max=0, sRect=exclude.get_frame_rect();
for (const w of this.tiler.windows) {
if (w===exclude) continue;
const r=w.get_frame_rect();
const ovX=Math.max(0, Math.min(sRect.x+sRect.width, r.x+r.width)-Math.max(sRect.x,r.x));
const ovY=Math.max(0, Math.min(sRect.y+sRect.height,r.y+r.height)-Math.max(sRect.y,r.y));
const area=ovX*ovY;
if (area>max){max=area; best=w;}
}
return best;
}
}
// ── TILER ────────────────────────────────────────────────
class Tiler {
constructor(extension) {
this._extension = extension;
this.settings = this._extension.getSettings();
this.windows = [];
this.grabbedWindow = null;
this._signalIds = new Map();
this._tileInProgress = false;
this._innerGap = this.settings.get_int('inner-gap');
this._outerGapVertical= this.settings.get_int('outer-gap-vertical');
this._outerGapHorizontal = this.settings.get_int('outer-gap-horizontal');
this._tilingDelay = TILING_DELAY_MS;
this._centeringDelay = CENTERING_DELAY_MS;
this._exceptions = [];
this._interactionHandler = new InteractionHandler(this);
this._tileTimeoutId = null;
this._centerTimeoutIds= [];
}
enable() {
this._loadExceptions();
this._workspaceManager = global.workspace_manager;
this._signalIds.set('workspace-changed', {
object: this._workspaceManager,
id: this._workspaceManager.connect('active-workspace-changed',
()=>this._onActiveWorkspaceChanged())
});
this._connectToWorkspace();
this._interactionHandler.enable();
this._signalIds.set('settings-changed', {
object: this.settings,
id: this.settings.connect('changed', ()=>this._onSettingsChanged())
});
}
disable() {
if (this._tileTimeoutId) {
GLib.source_remove(this._tileTimeoutId);
this._tileTimeoutId = null;
}
this._centerTimeoutIds.forEach(id=>GLib.source_remove(id));
this._centerTimeoutIds = [];
this._interactionHandler.disable();
this._disconnectFromWorkspace();
for (const [,sig] of this._signalIds) {
try { sig.object.disconnect(sig.id); } catch {}
}
this._signalIds.clear();
this.windows = [];
}
_onSettingsChanged() {
this._innerGap = this.settings.get_int('inner-gap');
this._outerGapVertical = this.settings.get_int('outer-gap-vertical');
this._outerGapHorizontal= this.settings.get_int('outer-gap-horizontal');
this.queueTile();
}
_loadExceptions() {
const file = Gio.File.new_for_path(this._extension.path + '/exceptions.txt');
if (!file.query_exists(null)) { this._exceptions=[]; return; }
const [ok,data] = file.load_contents(null);
if (!ok) { this._exceptions=[]; return; }
const txt = new TextDecoder('utf-8').decode(data);
this._exceptions = txt.split('\n')
.map(l=>l.trim())
.filter(l=>l && !l.startsWith('#'))
.map(l=>l.toLowerCase());
}
_isException(win) {
if (!win) return false;
const wmClass = (win.get_wm_class() || "").toLowerCase();
const appId = (win.get_gtk_application_id() || "").toLowerCase();
return this._exceptions.includes(wmClass) || this._exceptions.includes(appId);
}
_isTileable(win) {
return (
win &&
!win.minimized &&
!this._isException(win) &&
win.get_window_type() === Meta.WindowType.NORMAL
);
}
_centerWindow(win) {
const timeoutId = GLib.timeout_add(
GLib.PRIORITY_DEFAULT,
this._centeringDelay,
() => {
const index = this._centerTimeoutIds.indexOf(timeoutId);
if (index > -1) this._centerTimeoutIds.splice(index, 1);
if (!win || !win.get_display()) return GLib.SOURCE_REMOVE;
if (win.get_maximized())
win.unmaximize(Meta.MaximizeFlags.BOTH);
const monitorIndex = win.get_monitor();
const workspace = this._workspaceManager.get_active_workspace();
const workArea = workspace.get_work_area_for_monitor(
monitorIndex
);
const frame = win.get_frame_rect();
win.move_frame(
true,
workArea.x + Math.floor((workArea.width - frame.width) / 2),
workArea.y +
Math.floor((workArea.height - frame.height) / 2)
);
GLib.idle_add(GLib.PRIORITY_DEFAULT, () => {
if (win.get_display()) {
if (typeof win.set_keep_above === "function")
win.set_keep_above(true);
else if (typeof win.make_above === "function")
win.make_above();
}
return GLib.SOURCE_REMOVE;
});
return GLib.SOURCE_REMOVE;
}
);
this._centerTimeoutIds.push(timeoutId);
}
_onWindowMinimizedStateChanged() {
this.queueTile();
}
_onWindowAdded(workspace, win) {
if (this.windows.includes(win)) return;
if (this._isException(win)) {
this._centerWindow(win);
return;
}
if (this._isTileable(win)) {
if (this.settings.get_string("new-window-behavior") === "master") {
this.windows.unshift(win);
} else {
this.windows.push(win);
}
const id = win.get_id();
this._signalIds.set(`unmanaged-${id}`, {
object: win,
id: win.connect("unmanaged", () =>
this._onWindowRemoved(null, win)
),
});
this._signalIds.set(`size-changed-${id}`, {
object: win,
id: win.connect("size-changed", () => {
if (!this.grabbedWindow) this.queueTile();
}),
});
this._signalIds.set(`minimized-${id}`, {
object: win,
id: win.connect("notify::minimized", () =>
this._onWindowMinimizedStateChanged()
),
});
this.queueTile();
}
}
_onWindowRemoved(workspace, win) {
const index = this.windows.indexOf(win);
if (index > -1) this.windows.splice(index, 1);
["unmanaged", "size-changed", "minimized"].forEach((prefix) => {
const key = `${prefix}-${win.get_id()}`;
if (this._signalIds.has(key)) {
const { object, id } = this._signalIds.get(key);
try {
object.disconnect(id);
} catch (e) {}
this._signalIds.delete(key);
}
});
this.queueTile();
}
_onActiveWorkspaceChanged() {
this._disconnectFromWorkspace();
this._connectToWorkspace();
}
_connectToWorkspace() {
const workspace = this._workspaceManager.get_active_workspace();
workspace
.list_windows()
.forEach((win) => this._onWindowAdded(workspace, win));
this._signalIds.set("window-added", {
object: workspace,
id: workspace.connect("window-added", (ws, win) =>
this._onWindowAdded(ws, win)
),
});
this._signalIds.set("window-removed", {
object: workspace,
id: workspace.connect("window-removed", (ws, win) =>
this._onWindowRemoved(ws, win)
),
});
this.queueTile();
}
_disconnectFromWorkspace() {
this.windows.slice().forEach((win) => this._onWindowRemoved(null, win));
["window-added", "window-removed"].forEach((key) => {
if (this._signalIds.has(key)) {
const { object, id } = this._signalIds.get(key);
try {
object.disconnect(id);
} catch (e) {}
this._signalIds.delete(key);
}
});
}
queueTile() {
if (this._tileInProgress || this._tileTimeoutId) return;
this._tileInProgress = true;
this._tileTimeoutId = GLib.timeout_add(
GLib.PRIORITY_DEFAULT,
this._tilingDelay,
() => {
this._tileWindows();
this._tileInProgress = false;
this._tileTimeoutId = null;
return GLib.SOURCE_REMOVE;
}
);
}
tileNow() {
if (!this._tileInProgress) {
this._tileWindows();
}
}
_splitLayout(windows, area) {
if (windows.length === 0) return;
if (windows.length === 1) {
windows[0].move_resize_frame(
true,
area.x,
area.y,
area.width,
area.height
);
return;
}
const gap = Math.floor(this._innerGap / 2);
const primaryWindows = [windows[0]];
const secondaryWindows = windows.slice(1);
let primaryArea, secondaryArea;
if (area.width > area.height) {
const primaryWidth = Math.floor(area.width / 2) - gap;
primaryArea = {
x: area.x,
y: area.y,
width: primaryWidth,
height: area.height,
};
secondaryArea = {
x: area.x + primaryWidth + this._innerGap,
y: area.y,
width: area.width - primaryWidth - this._innerGap,
height: area.height,
};
} else {
const primaryHeight = Math.floor(area.height / 2) - gap;
primaryArea = {
x: area.x,
y: area.y,
width: area.width,
height: primaryHeight,
};
secondaryArea = {
x: area.x,
y: area.y + primaryHeight + this._innerGap,
width: area.width,
height: area.height - primaryHeight - this._innerGap,
};
}
this._splitLayout(primaryWindows, primaryArea);
this._splitLayout(secondaryWindows, secondaryArea);
}
_tileWindows() {
const windowsToTile = this.windows.filter((win) => !win.minimized);
if (windowsToTile.length === 0) return;
const monitor = Main.layoutManager.primaryMonitor;
const workspace = this._workspaceManager.get_active_workspace();
const workArea = workspace.get_work_area_for_monitor(monitor.index);
const innerArea = {
x: workArea.x + this._outerGapHorizontal,
y: workArea.y + this._outerGapVertical,
width: workArea.width - 2 * this._outerGapHorizontal,
height: workArea.height - 2 * this._outerGapVertical,
};
windowsToTile.forEach((win) => {
if (win.get_maximized()) win.unmaximize(Meta.MaximizeFlags.BOTH);
});
if (windowsToTile.length === 1) {
windowsToTile[0].move_resize_frame(
true,
innerArea.x,
innerArea.y,
innerArea.width,
innerArea.height
);
return;
}
const gap = Math.floor(this._innerGap / 2);
const masterWidth = Math.floor(innerArea.width / 2) - gap;
const master = windowsToTile[0];
master.move_resize_frame(
true,
innerArea.x,
innerArea.y,
masterWidth,
innerArea.height
);
const stackArea = {
x: innerArea.x + masterWidth + this._innerGap,
y: innerArea.y,
width: innerArea.width - masterWidth - this._innerGap,
height: innerArea.height,
};
this._splitLayout(windowsToTile.slice(1), stackArea);
}
}
// ── EXTENSIONWRAPPER ───────────────────────────────────
export default class InterimExtension extends Extension {
enable() {
this.tiler = new Tiler(this);
this.tiler.enable();
}
disable() {
if (this.tiler) {
this.tiler.disable();
this.tiler = null;
}
}
}
+681
View File
@@ -0,0 +1,681 @@
/////////////////////////////////////////////////////////////
// Simple-Tiling LEGACY (for GNOME Shell 3.38) //
// © 2025 domoel MIT //
/////////////////////////////////////////////////////////////
'use strict';
const Main = imports.ui.main;
const Meta = imports.gi.Meta;
const Shell = imports.gi.Shell;
const Gio = imports.gi.Gio;
const GLib = imports.gi.GLib;
const ExtensionUtils = imports.misc.extensionUtils;
const ByteArray = imports.byteArray;
const Me = ExtensionUtils.getCurrentExtension();
const SCHEMA_NAME = "org.gnome.shell.extensions.simple-tiling.domoel";
const WM_SCHEMA = "org.gnome.desktop.wm.keybindings";
const TILING_DELAY_MS = 20; // Change Tiling Window Delay
const CENTERING_DELAY_MS = 5; // Change Centered Window Delay
const KEYBINDINGS = {
'swap-master-window': (self) => self._swapWithMaster(),
'swap-left-window': (self) => self._swapInDirection('left'),
'swap-right-window': (self) => self._swapInDirection('right'),
'swap-up-window': (self) => self._swapInDirection('up'),
'swap-down-window': (self) => self._swapInDirection('down'),
'focus-left': (self) => self._focusInDirection('left'),
'focus-right': (self) => self._focusInDirection('right'),
'focus-up': (self) => self._focusInDirection('up'),
'focus-down': (self) => self._focusInDirection('down'),
};
// --- INTERACTIONHANDLER ---
class InteractionHandler {
constructor(tiler) {
this.tiler = tiler;
this._settings = ExtensionUtils.getSettings(SCHEMA_NAME);
this._wmSettings = new Gio.Settings({ schema: WM_SCHEMA });
this._wmKeysToDisable = [];
this._savedWmShortcuts = {};
this._grabOpIds = [];
this._settingsChangedId = null;
this._onSettingsChanged = this._onSettingsChanged.bind(this);
this._prepareWmShortcuts();
}
enable() {
if (this._wmKeysToDisable.length) {
this._wmKeysToDisable.forEach((key) =>
this._wmSettings.set_value(key, new GLib.Variant("as", []))
);
}
this._bindAllShortcuts();
this._settingsChangedId = this._settings.connect(
"changed",
this._onSettingsChanged
);
this._grabOpIds.push(
global.display.connect(
"grab-op-begin",
(display, screen, window) => {
if (this.tiler.windows.includes(window)) {
this.tiler.grabbedWindow = window;
}
}
)
);
this._grabOpIds.push(
global.display.connect("grab-op-end", this._onGrabEnd.bind(this))
);
}
disable() {
if (this._wmKeysToDisable.length) {
this._wmKeysToDisable.forEach((key) =>
this._wmSettings.set_value(key, this._savedWmShortcuts[key])
);
}
this._unbindAllShortcuts();
if (this._settingsChangedId) {
this._settings.disconnect(this._settingsChangedId);
this._settingsChangedId = null;
}
this._grabOpIds.forEach((id) => global.display.disconnect(id));
this._grabOpIds = [];
}
_bind(key, callback) {
Main.wm.addKeybinding(key, this._settings, Meta.KeyBindingFlags.NONE, Shell.ActionMode.NORMAL,
() => callback(this));
}
_bindAllShortcuts() {
for (const [key, handler] of Object.entries(KEYBINDINGS)) {
this._bind(key, handler);
}
}
_unbindAllShortcuts() {
for (const key in KEYBINDINGS) {
Main.wm.removeKeybinding(key);
}
}
_onSettingsChanged() {
this._unbindAllShortcuts();
this._bindAllShortcuts();
}
_prepareWmShortcuts() {
const schema = this._wmSettings.settings_schema;
const keys = [];
if (schema.has_key("toggle-tiled-left"))
keys.push("toggle-tiled-left", "toggle-tiled-right");
else if (schema.has_key("tile-left"))
keys.push("tile-left", "tile-right");
if (schema.has_key("toggle-maximized")) keys.push("toggle-maximized");
else {
if (schema.has_key("maximize")) keys.push("maximize");
if (schema.has_key("unmaximize")) keys.push("unmaximize");
}
if (keys.length) {
this._wmKeysToDisable = keys;
keys.forEach(
(key) => (this._savedWmShortcuts[key] = this._wmSettings.get_value(key))
);
}
}
_focusInDirection(direction) {
const sourceWindow = global.display.get_focus_window();
if (!sourceWindow || !this.tiler.windows.includes(sourceWindow)) return;
const targetWindow = this._findTargetInDirection(
sourceWindow,
direction
);
if (targetWindow) {
targetWindow.activate(global.get_current_time());
}
}
_swapWithMaster() {
const windows = this.tiler.windows;
if (windows.length < 2) return;
const focusedWindow = global.display.get_focus_window();
if (!focusedWindow || !windows.includes(focusedWindow)) return;
const focusedIndex = windows.indexOf(focusedWindow);
if (focusedIndex > 0) {
[windows[0], windows[focusedIndex]] = [
windows[focusedIndex],
windows[0],
];
} else if (focusedIndex === 0) {
[windows[0], windows[1]] = [windows[1], windows[0]];
}
this.tiler.tileNow();
if (windows.length > 0) windows[0].activate(global.get_current_time());
}
_swapInDirection(direction) {
const sourceWindow = global.display.get_focus_window();
if (!sourceWindow || !this.tiler.windows.includes(sourceWindow)) return;
let targetWindow = null;
const sourceIndex = this.tiler.windows.indexOf(sourceWindow);
if (
sourceIndex === 0 &&
direction === "right" &&
this.tiler.windows.length > 1
) {
targetWindow = this.tiler.windows[1];
} else {
targetWindow = this._findTargetInDirection(sourceWindow, direction);
}
if (!targetWindow) return;
const targetIndex = this.tiler.windows.indexOf(targetWindow);
[this.tiler.windows[sourceIndex], this.tiler.windows[targetIndex]] = [
this.tiler.windows[targetIndex],
this.tiler.windows[sourceIndex],
];
this.tiler.tileNow();
sourceWindow.activate(global.get_current_time());
}
_findTargetInDirection(source, direction) {
const sourceRect = source.get_frame_rect();
let candidates = [];
for (const win of this.tiler.windows) {
if (win === source) continue;
const targetRect = win.get_frame_rect();
switch (direction) {
case "left":
if (targetRect.x < sourceRect.x) candidates.push(win);
break;
case "right":
if (targetRect.x > sourceRect.x) candidates.push(win);
break;
case "up":
if (targetRect.y < sourceRect.y) candidates.push(win);
break;
case "down":
if (targetRect.y > sourceRect.y) candidates.push(win);
break;
}
}
if (candidates.length === 0) return null;
let bestTarget = null;
let minDeviation = Infinity;
for (const win of candidates) {
const targetRect = win.get_frame_rect();
let deviation;
if (direction === "left" || direction === "right") {
deviation = Math.abs(sourceRect.y - targetRect.y);
} else {
deviation = Math.abs(sourceRect.x - targetRect.x);
}
if (deviation < minDeviation) {
minDeviation = deviation;
bestTarget = win;
}
}
return bestTarget;
}
_onGrabEnd() {
const grabbedWindow = this.tiler.grabbedWindow;
if (!grabbedWindow) return;
const targetWindow = this._findTargetUnderPointer(grabbedWindow);
if (targetWindow) {
const sourceIndex = this.tiler.windows.indexOf(grabbedWindow);
const targetIndex = this.tiler.windows.indexOf(targetWindow);
[
this.tiler.windows[sourceIndex],
this.tiler.windows[targetIndex],
] = [
this.tiler.windows[targetIndex],
this.tiler.windows[sourceIndex],
];
}
this.tiler.queueTile();
this.tiler.grabbedWindow = null;
}
_findTargetUnderPointer(excludeWindow) {
let [pointerX, pointerY] = global.get_pointer();
let windows = global
.get_window_actors()
.map((actor) => actor.meta_window)
.filter((win) => {
if (
!win ||
win === excludeWindow ||
!this.tiler.windows.includes(win)
)
return false;
let frame = win.get_frame_rect();
return (
pointerX >= frame.x &&
pointerX < frame.x + frame.width &&
pointerY >= frame.y &&
pointerY < frame.y + frame.height
);
});
if (windows.length > 0) {
return windows[windows.length - 1];
}
let bestTarget = null;
let maxOverlap = 0;
const sourceFrame = excludeWindow.get_frame_rect();
for (const win of this.tiler.windows) {
if (win === excludeWindow) continue;
const targetFrame = win.get_frame_rect();
const overlapX = Math.max(
0,
Math.min(
sourceFrame.x + sourceFrame.width,
targetFrame.x + targetFrame.width
) - Math.max(sourceFrame.x, targetFrame.x)
);
const overlapY = Math.max(
0,
Math.min(
sourceFrame.y + sourceFrame.height,
targetFrame.y + targetFrame.height
) - Math.max(sourceFrame.y, targetFrame.y)
);
const overlapArea = overlapX * overlapY;
if (overlapArea > maxOverlap) {
maxOverlap = overlapArea;
bestTarget = win;
}
}
return bestTarget;
}
}
// --- TILER ---
class Tiler {
constructor() {
this.windows = [];
this.grabbedWindow = null;
this._settings = ExtensionUtils.getSettings(SCHEMA_NAME);
this._signalIds = new Map();
this._tileInProgress = false;
this._innerGap = this._settings.get_int("inner-gap");
this._outerGapVertical = this._settings.get_int("outer-gap-vertical");
this._outerGapHorizontal = this._settings.get_int("outer-gap-horizontal");
this._tilingDelay = TILING_DELAY_MS;
this._centeringDelay = CENTERING_DELAY_MS;
this._exceptions = [];
this._interactionHandler = new InteractionHandler(this);
this._tileTimeoutId = null;
this._centerTimeoutIds = [];
this._onWindowAdded = this._onWindowAdded.bind(this);
this._onWindowRemoved = this._onWindowRemoved.bind(this);
this._onActiveWorkspaceChanged = this._onActiveWorkspaceChanged.bind(
this
);
this._onWindowMinimizedStateChanged = this._onWindowMinimizedStateChanged.bind(
this
);
this._onSettingsChanged = this._onSettingsChanged.bind(this);
}
enable() {
this._loadExceptions();
const workspaceManager = global.workspace_manager;
this._signalIds.set("workspace-changed", {
object: workspaceManager,
id: workspaceManager.connect(
"active-workspace-changed",
this._onActiveWorkspaceChanged
),
});
this._connectToWorkspace();
this._interactionHandler.enable();
this._signalIds.set("settings-changed", {
object: this._settings,
id: this._settings.connect("changed", this._onSettingsChanged),
});
}
disable() {
if (this._tileTimeoutId) {
GLib.source_remove(this._tileTimeoutId);
this._tileTimeoutId = null;
}
this._centerTimeoutIds.forEach(id => GLib.source_remove(id));
this._centerTimeoutIds = [];
this._interactionHandler.disable();
this._disconnectFromWorkspace();
for (const [, signal] of this._signalIds) {
try {
signal.object.disconnect(signal.id);
} catch (e) {}
}
this._signalIds.clear();
this.windows = [];
}
_onSettingsChanged() {
this._innerGap = this._settings.get_int("inner-gap");
this._outerGapVertical = this._settings.get_int("outer-gap-vertical");
this._outerGapHorizontal = this._settings.get_int("outer-gap-horizontal");
this.queueTile();
}
_loadExceptions() {
const file = Gio.file_new_for_path(Me.path + "/exceptions.txt");
if (!file.query_exists(null)) {
this._exceptions = [];
return;
}
const [ok, data] = file.load_contents(null);
this._exceptions = ok
? ByteArray.toString(data)
.split("\n")
.map((l) => l.trim())
.filter((l) => l && !l.startsWith("#"))
.map((l) => l.toLowerCase())
: [];
}
_isException(win) {
if (!win) return false;
const wmClass = (win.get_wm_class() || "").toLowerCase();
const appId = (win.get_gtk_application_id() || "").toLowerCase();
return this._exceptions.includes(wmClass) || this._exceptions.includes(appId);
}
_isTileable(win) {
return (
win &&
!win.minimized &&
!this._isException(win) &&
win.get_window_type() === Meta.WindowType.NORMAL
);
}
_centerWindow(win) {
const timeoutId = GLib.timeout_add(GLib.PRIORITY_DEFAULT, this._centeringDelay, () => {
const index = this._centerTimeoutIds.indexOf(timeoutId);
if (index > -1) {
this._centerTimeoutIds.splice(index, 1);
}
if (!win || !win.get_display()) return GLib.SOURCE_REMOVE;
if (win.get_maximized()) {
win.unmaximize(Meta.MaximizeFlags.BOTH);
}
const monitorIndex = win.get_monitor();
const workArea = Main.layoutManager.getWorkAreaForMonitor(
monitorIndex
);
const frame = win.get_frame_rect();
win.move_frame(
true,
workArea.x + Math.floor((workArea.width - frame.width) / 2),
workArea.y + Math.floor((workArea.height - frame.height) / 2)
);
GLib.idle_add(GLib.PRIORITY_DEFAULT, () => {
if (win.get_display()) {
if (typeof win.set_keep_above === "function")
win.set_keep_above(true);
else if (typeof win.make_above === "function")
win.make_above();
}
return GLib.SOURCE_REMOVE;
});
return GLib.SOURCE_REMOVE;
});
this._centerTimeoutIds.push(timeoutId);
}
_onWindowMinimizedStateChanged() {
this.queueTile();
}
_onWindowAdded(workspace, win) {
if (this.windows.includes(win)) return;
if (this._isException(win)) {
this._centerWindow(win);
return;
}
if (this._isTileable(win)) {
if (this._settings.get_string("new-window-behavior") === "master") {
this.windows.unshift(win);
} else {
this.windows.push(win);
}
const id = win.get_id();
this._signalIds.set(`unmanaged-${id}`, {
object: win,
id: win.connect("unmanaged", () =>
this._onWindowRemoved(null, win)
),
});
this._signalIds.set(`size-changed-${id}`, {
object: win,
id: win.connect("size-changed", () => {
if (!this.grabbedWindow) this.queueTile();
}),
});
this._signalIds.set(`minimized-${id}`, {
object: win,
id: win.connect(
"notify::minimized",
this._onWindowMinimizedStateChanged
),
});
this.queueTile();
}
}
_onWindowRemoved(workspace, win) {
const index = this.windows.indexOf(win);
if (index > -1) {
this.windows.splice(index, 1);
}
["unmanaged", "size-changed", "minimized"].forEach((prefix) => {
const key = `${prefix}-${win.get_id()}`;
if (this._signalIds.has(key)) {
const { object, id } = this._signalIds.get(key);
try {
object.disconnect(id);
} catch (e) {}
this._signalIds.delete(key);
}
});
this.queueTile();
}
_onActiveWorkspaceChanged() {
this._disconnectFromWorkspace();
this._connectToWorkspace();
}
_connectToWorkspace() {
const workspace = global.workspace_manager.get_active_workspace();
workspace
.list_windows()
.forEach((win) => this._onWindowAdded(workspace, win));
this._signalIds.set("window-added", {
object: workspace,
id: workspace.connect("window-added", this._onWindowAdded),
});
this._signalIds.set("window-removed", {
object: workspace,
id: workspace.connect("window-removed", this._onWindowRemoved),
});
this.queueTile();
}
_disconnectFromWorkspace() {
this.windows.slice().forEach((win) => this._onWindowRemoved(null, win));
["window-added", "window-removed"].forEach((key) => {
if (this._signalIds.has(key)) {
const { object, id } = this._signalIds.get(key);
try {
object.disconnect(id);
} catch (e) {}
this._signalIds.delete(key);
}
});
}
queueTile() {
if (this._tileInProgress || this._tileTimeoutId) return;
this._tileInProgress = true;
this._tileTimeoutId = GLib.timeout_add(GLib.PRIORITY_DEFAULT, this._tilingDelay, () => {
this._tileWindows();
this._tileInProgress = false;
this._tileTimeoutId = null;
return GLib.SOURCE_REMOVE;
});
}
tileNow() {
if (!this._tileInProgress) {
this._tileWindows();
}
}
_splitLayout(windows, area) {
if (windows.length === 0) return;
if (windows.length === 1) {
windows[0].move_resize_frame(
true,
area.x,
area.y,
area.width,
area.height
);
return;
}
const gap = Math.floor(this._innerGap / 2);
const primaryWindows = [windows[0]];
const secondaryWindows = windows.slice(1);
let primaryArea, secondaryArea;
if (area.width > area.height) {
const primaryWidth = Math.floor(area.width / 2) - gap;
primaryArea = {
x: area.x,
y: area.y,
width: primaryWidth,
height: area.height,
};
secondaryArea = {
x: area.x + primaryWidth + this._innerGap,
y: area.y,
width: area.width - primaryWidth - this._innerGap,
height: area.height,
};
} else {
const primaryHeight = Math.floor(area.height / 2) - gap;
primaryArea = {
x: area.x,
y: area.y,
width: area.width,
height: primaryHeight,
};
secondaryArea = {
x: area.x,
y: area.y + primaryHeight + this._innerGap,
width: area.width,
height: area.height - primaryHeight - this._innerGap,
};
}
this._splitLayout(primaryWindows, primaryArea);
this._splitLayout(secondaryWindows, secondaryArea);
}
_tileWindows() {
const windowsToTile = this.windows.filter((win) => !win.minimized);
if (windowsToTile.length === 0) return;
const monitor = Main.layoutManager.primaryMonitor;
const workArea = Main.layoutManager.getWorkAreaForMonitor(
monitor.index
);
const innerArea = {
x: workArea.x + this._outerGapHorizontal,
y: workArea.y + this._outerGapVertical,
width: workArea.width - 2 * this._outerGapHorizontal,
height: workArea.height - 2 * this._outerGapVertical,
};
windowsToTile.forEach((win) => {
if (win.get_maximized()) win.unmaximize(Meta.MaximizeFlags.BOTH);
});
if (windowsToTile.length === 1) {
windowsToTile[0].move_resize_frame(
true,
innerArea.x,
innerArea.y,
innerArea.width,
innerArea.height
);
return;
}
const gap = Math.floor(this._innerGap / 2);
const masterWidth = Math.floor(innerArea.width / 2) - gap;
const master = windowsToTile[0];
master.move_resize_frame(
true,
innerArea.x,
innerArea.y,
masterWidth,
innerArea.height
);
const stackArea = {
x: innerArea.x + masterWidth + this._innerGap,
y: innerArea.y,
width: innerArea.width - masterWidth - this._innerGap,
height: innerArea.height,
};
this._splitLayout(windowsToTile.slice(1), stackArea);
}
}
// --- EXTENSION-WRAPPER (for legacy loader) ---
var LegacyExtension = class {
constructor(metadata) {
this.tiler = null;
}
enable() {
this.tiler = new Tiler();
this.tiler.enable();
}
disable() {
if (this.tiler) {
this.tiler.disable();
this.tiler = null;
}
}
};
function init(metadata) {
return new LegacyExtension(metadata);
}
-11
View File
@@ -1,11 +0,0 @@
{
"uuid": "simple-tiling@domoel",
"name": "Simple Tiling",
"description": "A Simple Tiling Extension for Gnome Shell 3.38.",
"version": 1,
"shell-version": [ "3.38" ],
"settings-schema": "org.gnome.shell.extensions.simple-tiling.domoel",
"preferences_ui": "prefs.js",
"url": "https://github.com/Domoel/Simple-Tiling",
"gettext-domain": "simple-tiling-domoel"
}
+13
View File
@@ -0,0 +1,13 @@
{
"uuid": "__UUID__",
"name": "Simple Tiling",
"description": "A Simple Tiling Extension for Gnome Shell.",
"version": __VERSION__,
"shell-version": [
"40"
],
"settings-schema": "org.gnome.shell.extensions.simple-tiling.domoel",
"preferences_ui": "prefs.js",
"url": "https://github.com/Domoel/Simple-Tiling",
"gettext-domain": "__UUID__"
}
+16
View File
@@ -0,0 +1,16 @@
{
"uuid": "__UUID__",
"name": "Simple Tiling",
"description": "A Simple Tiling Extension for Gnome Shell.",
"version": __VERSION__,
"shell-version": [
"41",
"42",
"43",
"44"
],
"settings-schema": "org.gnome.shell.extensions.simple-tiling.domoel",
"preferences_ui": "prefs.js",
"url": "https://github.com/Domoel/Simple-Tiling",
"gettext-domain": "__UUID__"
}
+13
View File
@@ -0,0 +1,13 @@
{
"uuid": "__UUID__",
"name": "Simple Tiling",
"description": "A Simple Tiling Extension for Gnome Shell.",
"version": __VERSION__,
"shell-version": [
"3.38"
],
"settings-schema": "org.gnome.shell.extensions.simple-tiling.domoel",
"preferences_ui": "prefs.js",
"url": "https://github.com/Domoel/Simple-Tiling",
"gettext-domain": "__UUID__"
}
+17
View File
@@ -0,0 +1,17 @@
{
"uuid": "__UUID__",
"name": "Simple Tiling",
"description": "A Simple Tiling Extension for Gnome Shell.",
"version": __VERSION__,
"shell-version": [
"45",
"46",
"47",
"48",
"49"
],
"settings-schema": "org.gnome.shell.extensions.simple-tiling.domoel",
"preferences_ui": "prefs.js",
"url": "https://github.com/Domoel/Simple-Tiling",
"gettext-domain": "__UUID__"
}
+625
View File
@@ -0,0 +1,625 @@
/////////////////////////////////////////////////////////////
// SimpleTiling  MODERN (GNOME Shell 45+) //
// © 2025domoel  MIT //
/////////////////////////////////////////////////////////////
// ── GLOBAL IMPORTS ────────────────────────────────────────
import Meta from 'gi://Meta';
import Shell from 'gi://Shell';
import Gio from 'gi://Gio';
import GLib from 'gi://GLib';
import Clutter from 'gi://Clutter';
import { Extension } from 'resource:///org/gnome/shell/extensions/extension.js';
import * as Main from 'resource:///org/gnome/shell/ui/main.js';
import * as Config from 'resource:///org/gnome/shell/misc/config.js';
// ── CONST ────────────────────────────────────────────
const WM_SCHEMA = 'org.gnome.desktop.wm.keybindings';
const TILING_DELAY_MS = 20; // Change Tiling Window Delay
const CENTERING_DELAY_MS = 5; // Change Centered Window Delay
const KEYBINDINGS = {
'swap-master-window': (self) => self._swapWithMaster(),
'swap-left-window': (self) => self._swapInDirection('left'),
'swap-right-window': (self) => self._swapInDirection('right'),
'swap-up-window': (self) => self._swapInDirection('up'),
'swap-down-window': (self) => self._swapInDirection('down'),
'focus-left': (self) => self._focusInDirection('left'),
'focus-right': (self) => self._focusInDirection('right'),
'focus-up': (self) => self._focusInDirection('up'),
'focus-down': (self) => self._focusInDirection('down'),
};
// ── VERSION CHECK ────────────────────────────────────────────
let shellVersion;
if (Shell.get_session) {
shellVersion = Shell.get_session().get_shell_version();
} else if (Config.PACKAGE_VERSION) {
shellVersion = Config.PACKAGE_VERSION;
} else {
shellVersion = global.shell_version;
}
const SHELL_MAJOR = parseInt(shellVersion.split('.')[0]);
// ── HELPERFUNCTION ────────────────────────────────────────
function getPointerXY() {
if (global.get_pointer) {
const [x, y] = global.get_pointer();
return [x, y];
}
const ev = Clutter.get_current_event();
if (ev) {
const coords = ev.get_coords();
if (Array.isArray(coords))
return coords;
}
const device = Clutter.get_default_backend()
.get_default_seat()
.get_pointer();
return device ? device.get_position() : [0, 0];
}
// ── INTERACTIONHANDLER ───────────────────────────────────
class InteractionHandler {
constructor(tiler) {
this.tiler = tiler;
this._settings = this.tiler.settings;
this._wmSettings = new Gio.Settings({ schema: WM_SCHEMA });
this._wmKeysToDisable = [];
this._savedWmShortcuts = {};
this._grabOpIds = [];
this._settingsChangedId = null;
}
enable() {
this._prepareWmShortcuts();
if (this._wmKeysToDisable.length)
this._wmKeysToDisable.forEach(k =>
this._wmSettings.set_value(k, new GLib.Variant('as', [])));
this._bindAllShortcuts();
this._settingsChangedId =
this._settings.connect('changed', () => this._onSettingsChanged());
this._grabOpIds.push(
global.display.connect('grab-op-begin',
(_, __, win) => { if (this.tiler.windows.includes(win))
this.tiler.grabbedWindow = win; })
);
this._grabOpIds.push(
global.display.connect('grab-op-end', () => this._onGrabEnd())
);
}
disable() {
if (this._wmKeysToDisable.length)
this._wmKeysToDisable.forEach(k =>
this._wmSettings.set_value(k, this._savedWmShortcuts[k]));
this._unbindAllShortcuts();
if (this._settingsChangedId) {
this._settings.disconnect(this._settingsChangedId);
this._settingsChangedId = null;
}
this._grabOpIds.forEach(id => global.display.disconnect(id));
this._grabOpIds = [];
}
_bind(key, handler) {
Main.wm.addKeybinding(
key,
this._settings,
Meta.KeyBindingFlags.NONE,
Shell.ActionMode.NORMAL,
(..._args) => handler(this)
);
}
_bindAllShortcuts() { for (const [k,h] of Object.entries(KEYBINDINGS)) this._bind(k, h); }
_unbindAllShortcuts(){ for (const k in KEYBINDINGS) Main.wm.removeKeybinding(k); }
_onSettingsChanged() {
this._unbindAllShortcuts();
this._bindAllShortcuts();
}
_prepareWmShortcuts() {
const schema = this._wmSettings.settings_schema;
if (!schema) return;
const keys = [];
const add = key => { if (schema.has_key(key)) keys.push(key); };
if (schema.has_key('toggle-tiled-left'))
keys.push('toggle-tiled-left', 'toggle-tiled-right');
else {
add('tile-left'); add('tile-right');
}
if (schema.has_key('toggle-maximized'))
keys.push('toggle-maximized');
else {
add('maximize'); add('unmaximize');
}
if (keys.length) {
this._wmKeysToDisable = keys;
keys.forEach(k => this._savedWmShortcuts[k] =
this._wmSettings.get_value(k));
}
}
_focusInDirection(direction) {
const src = global.display.get_focus_window();
if (!src || !this.tiler.windows.includes(src)) return;
const tgt = this._findTargetInDirection(src, direction);
if (tgt) tgt.activate(global.get_current_time());
}
_swapWithMaster() {
const w = this.tiler.windows;
if (w.length < 2) return;
const foc = global.display.get_focus_window();
if (!foc || !w.includes(foc)) return;
const idx = w.indexOf(foc);
if (idx > 0) [w[0], w[idx]] = [w[idx], w[0]];
else [w[0], w[1]] = [w[1], w[0]];
this.tiler.tileNow();
w[0]?.activate(global.get_current_time());
}
_swapInDirection(direction) {
const src = global.display.get_focus_window();
if (!src || !this.tiler.windows.includes(src)) return;
let tgt = null;
const idx = this.tiler.windows.indexOf(src);
if (idx === 0 && direction==='right' && this.tiler.windows.length>1)
tgt = this.tiler.windows[1];
else
tgt = this._findTargetInDirection(src, direction);
if (!tgt) return;
const tidx = this.tiler.windows.indexOf(tgt);
[this.tiler.windows[idx], this.tiler.windows[tidx]] =
[this.tiler.windows[tidx], this.tiler.windows[idx]];
this.tiler.tileNow();
src.activate(global.get_current_time());
}
_findTargetInDirection(src, dir) {
const sRect = src.get_frame_rect(), cand=[];
for (const win of this.tiler.windows) {
if (win===src) continue;
const r=win.get_frame_rect();
if (dir==='left' && r.x<sRect.x) cand.push(win);
if (dir==='right'&& r.x>sRect.x) cand.push(win);
if (dir==='up' && r.y<sRect.y) cand.push(win);
if (dir==='down' && r.y>sRect.y) cand.push(win);
}
if (!cand.length) return null;
let best=null, min=Infinity;
for (const w of cand) {
const r=w.get_frame_rect();
const dev = (dir==='left'||dir==='right')
? Math.abs(sRect.y - r.y)
: Math.abs(sRect.x - r.x);
if (dev<min){min=dev; best=w;}
}
return best;
}
_onGrabEnd() {
const grabbed = this.tiler.grabbedWindow;
if (!grabbed) return;
const tgt = this._findTargetUnderPointer(grabbed);
if (tgt) {
const a = this.tiler.windows.indexOf(grabbed);
const b = this.tiler.windows.indexOf(tgt);
[this.tiler.windows[a], this.tiler.windows[b]] =
[this.tiler.windows[b], this.tiler.windows[a]];
}
this.tiler.queueTile();
this.tiler.grabbedWindow = null;
}
_findTargetUnderPointer(exclude) {
const [x,y] = getPointerXY();
const wins = global.get_window_actors()
.map(a=>a.meta_window)
.filter(w=>w && w!==exclude &&
this.tiler.windows.includes(w) && (()=>{const f=w.get_frame_rect();
return x>=f.x && x<f.x+f.width &&
y>=f.y && y<f.y+f.height;})());
if (wins.length) return wins[wins.length-1];
let best=null, max=0, sRect=exclude.get_frame_rect();
for (const w of this.tiler.windows) {
if (w===exclude) continue;
const r=w.get_frame_rect();
const ovX=Math.max(0, Math.min(sRect.x+sRect.width, r.x+r.width)-Math.max(sRect.x,r.x));
const ovY=Math.max(0, Math.min(sRect.y+sRect.height,r.y+r.height)-Math.max(sRect.y,r.y));
const area=ovX*ovY;
if (area>max){max=area; best=w;}
}
return best;
}
}
// ── TILER ────────────────────────────────────────────────
class Tiler {
constructor(extension) {
this._extension = extension;
this.settings = this._extension.getSettings();
this.windows = [];
this.grabbedWindow = null;
this._signalIds = new Map();
this._tileInProgress = false;
this._innerGap = this.settings.get_int('inner-gap');
this._outerGapVertical= this.settings.get_int('outer-gap-vertical');
this._outerGapHorizontal = this.settings.get_int('outer-gap-horizontal');
this._tilingDelay = TILING_DELAY_MS;
this._centeringDelay = CENTERING_DELAY_MS;
this._exceptions = [];
this._interactionHandler = new InteractionHandler(this);
this._tileTimeoutId = null;
this._centerTimeoutIds= [];
}
enable() {
this._loadExceptions();
this._workspaceManager = global.workspace_manager;
this._signalIds.set('workspace-changed', {
object: this._workspaceManager,
id: this._workspaceManager.connect('active-workspace-changed',
()=>this._onActiveWorkspaceChanged())
});
this._connectToWorkspace();
this._interactionHandler.enable();
this._signalIds.set('settings-changed', {
object: this.settings,
id: this.settings.connect('changed', ()=>this._onSettingsChanged())
});
}
disable() {
if (this._tileTimeoutId) {
GLib.source_remove(this._tileTimeoutId);
this._tileTimeoutId = null;
}
this._centerTimeoutIds.forEach(id=>GLib.source_remove(id));
this._centerTimeoutIds = [];
this._interactionHandler.disable();
this._disconnectFromWorkspace();
for (const [,sig] of this._signalIds) {
try { sig.object.disconnect(sig.id); } catch {}
}
this._signalIds.clear();
this.windows = [];
}
_onSettingsChanged() {
this._innerGap = this.settings.get_int('inner-gap');
this._outerGapVertical = this.settings.get_int('outer-gap-vertical');
this._outerGapHorizontal= this.settings.get_int('outer-gap-horizontal');
this.queueTile();
}
_loadExceptions() {
const file = Gio.File.new_for_path(this._extension.path + '/exceptions.txt');
if (!file.query_exists(null)) { this._exceptions=[]; return; }
const [ok,data] = file.load_contents(null);
if (!ok) { this._exceptions=[]; return; }
const txt = new TextDecoder('utf-8').decode(data);
this._exceptions = txt.split('\n')
.map(l=>l.trim())
.filter(l=>l && !l.startsWith('#'))
.map(l=>l.toLowerCase());
}
_isException(win) {
if (!win) return false;
const wmClass = (win.get_wm_class() || "").toLowerCase();
const appId = (win.get_gtk_application_id() || "").toLowerCase();
return this._exceptions.includes(wmClass) || this._exceptions.includes(appId);
}
_isTileable(win) {
return (
win &&
!win.minimized &&
!this._isException(win) &&
win.get_window_type() === Meta.WindowType.NORMAL
);
}
_centerWindow(win) {
const timeoutId = GLib.timeout_add(
GLib.PRIORITY_DEFAULT,
this._centeringDelay,
() => {
const index = this._centerTimeoutIds.indexOf(timeoutId);
if (index > -1) this._centerTimeoutIds.splice(index, 1);
if (!win || !win.get_display()) return GLib.SOURCE_REMOVE;
if (SHELL_MAJOR < 49) {
if (win.get_maximized()) {
win.unmaximize(Meta.MaximizeFlags.BOTH);
}
} else {
if (win.is_maximized()) {
win.unmaximize();
}
}
const monitorIndex = win.get_monitor();
const workspace = this._workspaceManager.get_active_workspace();
const workArea = workspace.get_work_area_for_monitor(
monitorIndex
);
const frame = win.get_frame_rect();
win.move_frame(
true,
workArea.x + Math.floor((workArea.width - frame.width) / 2),
workArea.y +
Math.floor((workArea.height - frame.height) / 2)
);
GLib.idle_add(GLib.PRIORITY_DEFAULT, () => {
if (win.get_display()) {
if (typeof win.set_keep_above === "function")
win.set_keep_above(true);
else if (typeof win.make_above === "function")
win.make_above();
}
return GLib.SOURCE_REMOVE;
});
return GLib.SOURCE_REMOVE;
}
);
this._centerTimeoutIds.push(timeoutId);
}
_onWindowMinimizedStateChanged() {
this.queueTile();
}
_onWindowAdded(workspace, win) {
if (this.windows.includes(win)) return;
if (this._isException(win)) {
this._centerWindow(win);
return;
}
if (this._isTileable(win)) {
if (this.settings.get_string("new-window-behavior") === "master") {
this.windows.unshift(win);
} else {
this.windows.push(win);
}
const id = win.get_id();
this._signalIds.set(`unmanaged-${id}`, {
object: win,
id: win.connect("unmanaged", () =>
this._onWindowRemoved(null, win)
),
});
this._signalIds.set(`size-changed-${id}`, {
object: win,
id: win.connect("size-changed", () => {
if (!this.grabbedWindow) this.queueTile();
}),
});
this._signalIds.set(`minimized-${id}`, {
object: win,
id: win.connect("notify::minimized", () =>
this._onWindowMinimizedStateChanged()
),
});
this.queueTile();
}
}
_onWindowRemoved(workspace, win) {
const index = this.windows.indexOf(win);
if (index > -1) this.windows.splice(index, 1);
["unmanaged", "size-changed", "minimized"].forEach((prefix) => {
const key = `${prefix}-${win.get_id()}`;
if (this._signalIds.has(key)) {
const { object, id } = this._signalIds.get(key);
try {
object.disconnect(id);
} catch (e) {}
this._signalIds.delete(key);
}
});
this.queueTile();
}
_onActiveWorkspaceChanged() {
this._disconnectFromWorkspace();
this._connectToWorkspace();
}
_connectToWorkspace() {
const workspace = this._workspaceManager.get_active_workspace();
workspace
.list_windows()
.forEach((win) => this._onWindowAdded(workspace, win));
this._signalIds.set("window-added", {
object: workspace,
id: workspace.connect("window-added", (ws, win) =>
this._onWindowAdded(ws, win)
),
});
this._signalIds.set("window-removed", {
object: workspace,
id: workspace.connect("window-removed", (ws, win) =>
this._onWindowRemoved(ws, win)
),
});
this.queueTile();
}
_disconnectFromWorkspace() {
this.windows.slice().forEach((win) => this._onWindowRemoved(null, win));
["window-added", "window-removed"].forEach((key) => {
if (this._signalIds.has(key)) {
const { object, id } = this._signalIds.get(key);
try {
object.disconnect(id);
} catch (e) {}
this._signalIds.delete(key);
}
});
}
queueTile() {
if (this._tileInProgress || this._tileTimeoutId) return;
this._tileInProgress = true;
this._tileTimeoutId = GLib.timeout_add(
GLib.PRIORITY_DEFAULT,
this._tilingDelay,
() => {
this._tileWindows();
this._tileInProgress = false;
this._tileTimeoutId = null;
return GLib.SOURCE_REMOVE;
}
);
}
tileNow() {
if (!this._tileInProgress) {
this._tileWindows();
}
}
_splitLayout(windows, area) {
if (windows.length === 0) return;
if (windows.length === 1) {
windows[0].move_resize_frame(
true,
area.x,
area.y,
area.width,
area.height
);
return;
}
const gap = Math.floor(this._innerGap / 2);
const primaryWindows = [windows[0]];
const secondaryWindows = windows.slice(1);
let primaryArea, secondaryArea;
if (area.width > area.height) {
const primaryWidth = Math.floor(area.width / 2) - gap;
primaryArea = {
x: area.x,
y: area.y,
width: primaryWidth,
height: area.height,
};
secondaryArea = {
x: area.x + primaryWidth + this._innerGap,
y: area.y,
width: area.width - primaryWidth - this._innerGap,
height: area.height,
};
} else {
const primaryHeight = Math.floor(area.height / 2) - gap;
primaryArea = {
x: area.x,
y: area.y,
width: area.width,
height: primaryHeight,
};
secondaryArea = {
x: area.x,
y: area.y + primaryHeight + this._innerGap,
width: area.width,
height: area.height - primaryHeight - this._innerGap,
};
}
this._splitLayout(primaryWindows, primaryArea);
this._splitLayout(secondaryWindows, secondaryArea);
}
_tileWindows() {
const windowsToTile = this.windows.filter((win) => !win.minimized);
if (windowsToTile.length === 0) return;
const monitor = Main.layoutManager.primaryMonitor;
const workspace = this._workspaceManager.get_active_workspace();
const workArea = workspace.get_work_area_for_monitor(monitor.index);
const innerArea = {
x: workArea.x + this._outerGapHorizontal,
y: workArea.y + this._outerGapVertical,
width: workArea.width - 2 * this._outerGapHorizontal,
height: workArea.height - 2 * this._outerGapVertical,
};
windowsToTile.forEach((win) => {
if (SHELL_MAJOR < 49) {
if (win.get_maximized()) {
win.unmaximize(Meta.MaximizeFlags.BOTH);
}
} else {
if (win.is_maximized()) {
win.unmaximize();
}
}
});
if (windowsToTile.length === 1) {
windowsToTile[0].move_resize_frame(
true,
innerArea.x,
innerArea.y,
innerArea.width,
innerArea.height
);
return;
}
const gap = Math.floor(this._innerGap / 2);
const masterWidth = Math.floor(innerArea.width / 2) - gap;
const master = windowsToTile[0];
master.move_resize_frame(
true,
innerArea.x,
innerArea.y,
masterWidth,
innerArea.height
);
const stackArea = {
x: innerArea.x + masterWidth + this._innerGap,
y: innerArea.y,
width: innerArea.width - masterWidth - this._innerGap,
height: innerArea.height,
};
this._splitLayout(windowsToTile.slice(1), stackArea);
}
}
// ── EXTENSIONWRAPPER ───────────────────────────────────
export default class ModernExtension extends Extension {
enable() { this.tiler = new Tiler(this); this.tiler.enable(); }
disable() { this.tiler?.disable(); this.tiler = null; }
}
-108
View File
@@ -1,108 +0,0 @@
// Settings Menu for Simple-Tiling
'use strict';
const { Gtk, GObject } = imports.gi;
const ExtensionUtils = imports.misc.extensionUtils;
const COLUMN_ID = 0; // z.B. 'swap-master-window'
const COLUMN_DESC = 1; // z.B. 'Master-Fenster tauschen'
const COLUMN_KEY = 2; // Der Key-Code (eine Zahl)
const COLUMN_MODS = 3; // Die Modifier-Maske (eine Zahl)
function init() {}
function buildPrefsWidget() {
const settings = ExtensionUtils.getSettings('org.gnome.shell.extensions.simple-tiling.domoel');
const prefsWidget = new Gtk.Box({
orientation: Gtk.Orientation.VERTICAL,
margin: 20,
spacing: 12,
visible: true
});
const title = new Gtk.Label({
label: '<b>Tastenkürzel für Simple-Tiling</b>',
use_markup: true,
halign: Gtk.Align.START,
visible: true
});
prefsWidget.add(title);
let store = new Gtk.ListStore();
store.set_column_types([
GObject.TYPE_STRING, // COLUMN_ID
GObject.TYPE_STRING, // COLUMN_DESC
GObject.TYPE_INT, // COLUMN_KEY
GObject.TYPE_INT, // COLUMN_MODS
]);
addKeybinding(store, settings, 'swap-master-window', 'Master-Fenster tauschen');
addKeybinding(store, settings, 'swap-left-window', 'Fenster nach links tauschen');
addKeybinding(store, settings, 'swap-right-window', 'Fenster nach rechts tauschen');
addKeybinding(store, settings, 'swap-up-window', 'Fenster nach oben tauschen');
addKeybinding(store, settings, 'swap-down-window', 'Fenster nach unten tauschen');
let treeView = new Gtk.TreeView({
model: store,
headers_visible: false,
hexpand: true,
visible: true
});
let descRenderer = new Gtk.CellRendererText();
let descColumn = new Gtk.TreeViewColumn({ expand: true });
descColumn.pack_start(descRenderer, true);
descColumn.add_attribute(descRenderer, 'text', COLUMN_DESC);
treeView.append_column(descColumn);
let accelRenderer = new Gtk.CellRendererAccel({
'accel-mode': Gtk.CellRendererAccelMode.GTK,
'editable': true
});
let accelColumn = new Gtk.TreeViewColumn();
accelColumn.pack_end(accelRenderer, false);
accelColumn.add_attribute(accelRenderer, 'accel-key', COLUMN_KEY);
accelColumn.add_attribute(accelRenderer, 'accel-mods', COLUMN_MODS);
treeView.append_column(accelColumn);
prefsWidget.add(treeView);
accelRenderer.connect('accel-edited', (renderer, path_string, key, mods, hw_code) => {
let [ok, iter] = store.get_iter_from_string(path_string);
if (!ok) return;
store.set(iter, [COLUMN_KEY, COLUMN_MODS], [key, mods]);
let id = store.get_value(iter, COLUMN_ID);
let accelString = Gtk.accelerator_name(key, mods);
settings.set_strv(id, [accelString]);
});
accelRenderer.connect('accel-cleared', (renderer, path_string) => {
let [ok, iter] = store.get_iter_from_string(path_string);
if (!ok) return;
store.set(iter, [COLUMN_KEY, COLUMN_MODS], [0, 0]);
let id = store.get_value(iter, COLUMN_ID);
settings.set_strv(id, []);
});
return prefsWidget;
}
function addKeybinding(model, settings, id, description) {
let [key, mods] = [0, 0];
const strv = settings.get_strv(id);
if (strv && strv.length > 0 && strv[0]) {
[key, mods] = Gtk.accelerator_parse(strv[0]);
}
let iter = model.append();
model.set(iter,
[COLUMN_ID, COLUMN_DESC, COLUMN_KEY, COLUMN_MODS],
[id, description, key, mods]
);
}
+91
View File
@@ -0,0 +1,91 @@
//////////////////////////////////////////////////////////////////
// Simple-Tiling ENTERPRISE MENU (GNOME Shell 40 non-ESM) //
// © 2025 domoel MIT //
//////////////////////////////////////////////////////////////////
'use strict';
// ── GLOBAL IMPORTS ────────────────────────────────────────
const { Adw, Gio, Gtk, GLib } = imports.gi;
const ExtensionUtils = imports.misc.extensionUtils;
const _ = ExtensionUtils.gettext;
function init() {
}
function buildPrefsWidget() {
const settings = ExtensionUtils.getSettings();
const page = new Adw.PreferencesPage();
// ── WINDOW GAPS ────────────────────────────────────────────
const groupGaps = new Adw.PreferencesGroup({ title: 'Window Gaps' });
page.add(groupGaps);
const rowInnerGap = new Adw.SpinRow({
title: 'Inner Gap',
subtitle: 'The gap between windows in pixels.',
adjustment: new Gtk.Adjustment({ lower: 0, upper: 100, step_increment: 1 }),
});
groupGaps.add(rowInnerGap);
settings.bind('inner-gap', rowInnerGap, 'value', Gio.SettingsBindFlags.DEFAULT);
const rowOuterH = new Adw.SpinRow({
title: 'Outer Gap (horizontal)',
subtitle: 'Left / right screen edges (pixels)',
adjustment: new Gtk.Adjustment({ lower: 0, upper: 100, step_increment: 1 }),
});
groupGaps.add(rowOuterH);
settings.bind('outer-gap-horizontal', rowOuterH, 'value', Gio.SettingsBindFlags.DEFAULT);
const rowOuterV = new Adw.SpinRow({
title: 'Outer Gap (vertical)',
subtitle: 'Top / bottom screen edges (pixels)',
adjustment: new Gtk.Adjustment({ lower: 0, upper: 100, step_increment: 1 }),
});
groupGaps.add(rowOuterV);
settings.bind('outer-gap-vertical', rowOuterV, 'value', Gio.SettingsBindFlags.DEFAULT);
// ── WINDOW BEHAVIOR ────────────────────────────────────────────
const groupBehavior = new Adw.PreferencesGroup({ title: 'Window Behavior' });
page.add(groupBehavior);
const rowNewWindow = new Adw.ComboRow({
title: 'Open new windows as',
subtitle: 'Whether a new window starts as Master or Stack',
model: new Gtk.StringList({
strings: ['Stack Window (Default)', 'Master Window'],
}),
});
groupBehavior.add(rowNewWindow);
const currentBehavior = settings.get_string('new-window-behavior');
rowNewWindow.selected = currentBehavior === 'master' ? 1 : 0;
rowNewWindow.connect('notify::selected', () => {
const newVal = rowNewWindow.selected === 1 ? 'master' : 'stack';
settings.set_string('new-window-behavior', newVal);
});
// ── KEYBINDINGS ────────────────────────────────────────────
const groupKeys = new Adw.PreferencesGroup({ title: 'Keybindings' });
page.add(groupKeys);
const rowKeys = new Adw.ActionRow({
title: 'Configure Shortcuts',
subtitle: 'Adjust all shortcuts in GNOME Keyboard settings.',
});
groupKeys.add(rowKeys);
const btnOpenKeyboard = new Gtk.Button({ label: 'Open Keyboard Settings' });
btnOpenKeyboard.connect('clicked', () => {
const appInfo = Gio.AppInfo.create_from_commandline(
'gnome-control-center keyboard', null, Gio.AppInfoCreateFlags.NONE
);
appInfo.launch([], null);
});
rowKeys.add_suffix(btnOpenKeyboard);
rowKeys.set_activatable_widget(btnOpenKeyboard);
return page;
}
+90
View File
@@ -0,0 +1,90 @@
///////////////////////////////////////////////////////////////
// Simple-Tiling MODERN MENU (GNOME Shell 41-44) //
// © 2025 domoel MIT //
///////////////////////////////////////////////////////////////
'use strict';
import Adw from 'gi://Adw';
import Gio from 'gi://Gio';
import Gtk from 'gi://Gtk';
import GLib from 'gi://GLib';
import { ExtensionPreferences, gettext as _ } from 'resource:///org/gnome/Shell/Extensions/js/extensions/prefs.js';
export default class SimpleTilingPrefs extends ExtensionPreferences {
fillPreferencesWindow(window) {
const settings = this.getSettings();
const page = new Adw.PreferencesPage();
window.add(page);
// --- Group for Window Gaps ---
const groupGaps = new Adw.PreferencesGroup({ title: 'Window Gaps' });
page.add(groupGaps);
const rowInnerGap = new Adw.SpinRow({
title: 'Inner Gap',
subtitle: 'The gap between windows in pixels.',
adjustment: new Gtk.Adjustment({ lower: 0, upper: 100, step_increment: 1 }),
});
groupGaps.add(rowInnerGap);
settings.bind('inner-gap', rowInnerGap, 'value', Gio.SettingsBindFlags.DEFAULT);
const rowOuterH = new Adw.SpinRow({
title: 'Outer Gap (horizontal)',
subtitle: 'Left / right screen edges (pixels)',
adjustment: new Gtk.Adjustment({ lower: 0, upper: 100, step_increment: 1 }),
});
groupGaps.add(rowOuterH);
settings.bind('outer-gap-horizontal', rowOuterH, 'value', Gio.SettingsBindFlags.DEFAULT);
const rowOuterV = new Adw.SpinRow({
title: 'Outer Gap (vertical)',
subtitle: 'Top / bottom screen edges (pixels)',
adjustment: new Gtk.Adjustment({ lower: 0, upper: 100, step_increment: 1 }),
});
groupGaps.add(rowOuterV);
settings.bind('outer-gap-vertical', rowOuterV, 'value', Gio.SettingsBindFlags.DEFAULT);
// --- Group for Window Behavior ---
const groupBehavior = new Adw.PreferencesGroup({ title: 'Window Behavior' });
page.add(groupBehavior);
const rowNewWindow = new Adw.ComboRow({
title: 'Open new windows as',
subtitle: 'Whether a new window starts as Master or Stack',
model: new Gtk.StringList({
strings: ['Stack Window (Default)', 'Master Window'],
}),
});
groupBehavior.add(rowNewWindow);
const currentBehavior = settings.get_string('new-window-behavior');
rowNewWindow.selected = currentBehavior === 'master' ? 1 : 0;
rowNewWindow.connect('notify::selected', () => {
const newVal = rowNewWindow.selected === 1 ? 'master' : 'stack';
settings.set_string('new-window-behavior', newVal);
});
// --- Group for Keybindings ---
const groupKeys = new Adw.PreferencesGroup({ title: 'Keybindings' });
page.add(groupKeys);
const rowKeys = new Adw.ActionRow({
title: 'Configure Shortcuts',
subtitle: 'Adjust all shortcuts in GNOME Keyboard settings.',
});
groupKeys.add(rowKeys);
const btnOpenKeyboard = new Gtk.Button({ label: 'Open Keyboard Settings' });
btnOpenKeyboard.connect('clicked', () => {
const appInfo = Gio.AppInfo.create_from_commandline(
'gnome-control-center keyboard', null, Gio.AppInfoCreateFlags.NONE
);
appInfo.launch([], null);
});
rowKeys.add_suffix(btnOpenKeyboard);
rowKeys.set_activatable_widget(btnOpenKeyboard);
}
}
+227
View File
@@ -0,0 +1,227 @@
///////////////////////////////////////////////////////////////
// SimpleTiling  LEGACY MENU (GNOME Shell 3.38) //
// © 2025domoel  MIT //
/////////////////////////////////////////////////////////////
// ── GLOBAL IMPORTS ────────────────────────────────────────
"use strict";
const { Gtk, GObject, Gio } = imports.gi;
const ExtensionUtils = imports.misc.extensionUtils;
const SCHEMA_NAME = "org.gnome.shell.extensions.simple-tiling.domoel";
// ── DEFINITIONS ────────────────────────────────────────────
const COLUMN_ID = 0;
const COLUMN_DESC = 1;
const COLUMN_KEY = 2;
const COLUMN_MODS = 3;
function init() {}
function buildPrefsWidget() {
const settings = ExtensionUtils.getSettings(SCHEMA_NAME);
const prefsWidget = new Gtk.Box({
orientation: Gtk.Orientation.VERTICAL,
margin_top: 20,
margin_bottom: 20,
margin_start: 20,
margin_end: 20,
spacing: 18,
visible: true,
});
// ── KEYBINDINGS ────────────────────────────────────────────
const keysTitle = new Gtk.Label({
label: "<b>Keybindings</b>",
use_markup: true,
halign: Gtk.Align.START,
visible: true,
});
const keysFrame = new Gtk.Frame({
label_widget: keysTitle,
shadow_type: Gtk.ShadowType.NONE,
visible: true,
});
let keysBox = new Gtk.Box({
orientation: Gtk.Orientation.VERTICAL,
margin: 12,
spacing: 6,
visible: true,
});
keysFrame.add(keysBox);
let store = new Gtk.ListStore();
store.set_column_types([
GObject.TYPE_STRING,
GObject.TYPE_STRING,
GObject.TYPE_INT,
GObject.TYPE_INT,
]);
addKeybinding(store, settings, "swap-master-window", "Swap current window with master");
addKeybinding(store, settings, "swap-up-window", "Swap current window with window above");
addKeybinding(store, settings, "swap-down-window", "Swap current window with window below");
addKeybinding(store, settings, "swap-left-window", "Swap current window with window to the left");
addKeybinding(store, settings, "swap-right-window", "Swap current window with window to the right");
addKeybinding(store, settings, "focus-up", "Focus window above");
addKeybinding(store, settings, "focus-down", "Focus window below");
addKeybinding(store, settings, "focus-left", "Focus window to the left");
addKeybinding(store, settings, "focus-right", "Focus window to the right");
let treeView = new Gtk.TreeView({
model: store,
headers_visible: false,
hexpand: true,
visible: true,
});
keysBox.add(treeView);
let descRenderer = new Gtk.CellRendererText();
let descColumn = new Gtk.TreeViewColumn({ expand: true });
descColumn.pack_start(descRenderer, true);
descColumn.add_attribute(descRenderer, "text", COLUMN_DESC);
treeView.append_column(descColumn);
let accelRenderer = new Gtk.CellRendererAccel({
"accel-mode": Gtk.CellRendererAccelMode.GTK,
editable: true,
});
let accelColumn = new Gtk.TreeViewColumn();
accelColumn.pack_end(accelRenderer, false);
accelColumn.add_attribute(accelRenderer, "accel-key", COLUMN_KEY);
accelColumn.add_attribute(accelRenderer, "accel-mods", COLUMN_MODS);
treeView.append_column(accelColumn);
accelRenderer.connect("accel-edited", (r, path, key, mods) => {
let [ok, iter] = store.get_iter_from_string(path);
if (ok) {
store.set(iter, [COLUMN_KEY, COLUMN_MODS], [key, mods]);
settings.set_strv(store.get_value(iter, COLUMN_ID), [
Gtk.accelerator_name(key, mods),
]);
}
});
accelRenderer.connect("accel-cleared", (r, path) => {
let [ok, iter] = store.get_iter_from_string(path);
if (ok) {
store.set(iter, [COLUMN_KEY, COLUMN_MODS], [0, 0]);
settings.set_strv(store.get_value(iter, COLUMN_ID), []);
}
});
prefsWidget.add(keysFrame);
// ── WINDOW GAPS ────────────────────────────────────────────
const gapsTitle = new Gtk.Label({
label: "<b>Window Gaps</b>",
use_markup: true,
halign: Gtk.Align.START,
visible: true,
});
const gapsFrame = new Gtk.Frame({
label_widget: gapsTitle,
shadow_type: Gtk.ShadowType.NONE,
visible: true,
});
const gapsGrid = new Gtk.Grid({
margin: 12,
column_spacing: 12,
row_spacing: 12,
visible: true,
});
gapsFrame.add(gapsGrid);
addSpinButtonRow(gapsGrid, settings, "Inner Gap", "inner-gap", 0);
addSpinButtonRow(gapsGrid, settings, "Outer Gap (horizontal)", "outer-gap-horizontal", 1);
addSpinButtonRow(gapsGrid, settings, "Outer Gap (vertical)", "outer-gap-vertical", 2);
prefsWidget.add(gapsFrame);
// ── WINDOW BEHAVIOR ────────────────────────────────────────────
const behaviorTitle = new Gtk.Label({
label: "<b>Window Behavior</b>",
use_markup: true,
halign: Gtk.Align.START,
visible: true,
});
const behaviorFrame = new Gtk.Frame({
label_widget: behaviorTitle,
shadow_type: Gtk.ShadowType.NONE,
visible: true,
});
const behaviorGrid = new Gtk.Grid({
margin: 12,
column_spacing: 12,
row_spacing: 12,
visible: true,
});
behaviorFrame.add(behaviorGrid);
addComboBoxRow(
behaviorGrid,
settings,
"Open new windows as",
"new-window-behavior",
0
);
prefsWidget.add(behaviorFrame);
prefsWidget.show_all();
return prefsWidget;
}
function addKeybinding(model, settings, id, desc) {
let [key, mods] = [0, 0];
const strv = settings.get_strv(id);
if (strv && strv[0]) {
[key, mods] = Gtk.accelerator_parse(strv[0]);
}
let iter = model.append();
model.set(
iter,
[COLUMN_ID, COLUMN_DESC, COLUMN_KEY, COLUMN_MODS],
[id, desc, key, mods]
);
}
function addSpinButtonRow(grid, settings, desc, key, pos) {
const label = new Gtk.Label({
label: desc,
halign: Gtk.Align.START,
visible: true,
});
grid.attach(label, 0, pos, 1, 1);
const adj = new Gtk.Adjustment({ lower: 0, upper: 100, step_increment: 1 });
const spin = new Gtk.SpinButton({
adjustment: adj,
climb_rate: 1,
digits: 0,
halign: Gtk.Align.END,
visible: true,
});
settings.bind(key, spin, "value", Gio.SettingsBindFlags.DEFAULT);
grid.attach(spin, 1, pos, 1, 1);
}
function addComboBoxRow(grid, settings, desc, key, pos) {
const label = new Gtk.Label({
label: desc,
halign: Gtk.Align.START,
visible: true,
});
grid.attach(label, 0, pos, 1, 1);
const combo = new Gtk.ComboBoxText({
visible: true,
halign: Gtk.Align.END,
});
combo.append("stack", "Stack Window (Default)");
combo.append("master", "Master Window");
combo.set_active_id(settings.get_string(key));
combo.connect("changed", () => {
settings.set_string(key, combo.get_active_id());
});
grid.attach(combo, 1, pos, 1, 1);
}
+91
View File
@@ -0,0 +1,91 @@
///////////////////////////////////////////////////////////////
// Simple-Tiling MODERN MENU (GNOME Shell 45+) //
// © 2025 domoel MIT //
///////////////////////////////////////////////////////////////
// ── GLOBAL IMPORTS ────────────────────────────────────────
import Adw from 'gi://Adw';
import Gio from 'gi://Gio';
import Gtk from 'gi://Gtk';
import GLib from 'gi://GLib';
import { ExtensionPreferences, gettext as _ } from 'resource:///org/gnome/Shell/Extensions/js/extensions/prefs.js';
export default class SimpleTilingPrefs extends ExtensionPreferences {
fillPreferencesWindow(window) {
const settings = this.getSettings();
const page = new Adw.PreferencesPage();
window.add(page);
// ── WINDOW GAPS ────────────────────────────────────────────
const groupGaps = new Adw.PreferencesGroup({
title: 'Window Gaps',
description: 'Adjust spacing between windows and screen edges.'
});
page.add(groupGaps);
const rowInnerGap = new Adw.SpinRow({
title: 'Inner Gap',
subtitle: 'Space between tiled windows (pixels)',
adjustment: new Gtk.Adjustment({ lower: 0, upper: 100, step_increment: 1 }),
});
groupGaps.add(rowInnerGap);
settings.bind('inner-gap', rowInnerGap, 'value', Gio.SettingsBindFlags.DEFAULT);
const rowOuterH = new Adw.SpinRow({
title: 'Outer Gap (horizontal)',
subtitle: 'Left / right screen edges (pixels)',
adjustment: new Gtk.Adjustment({ lower: 0, upper: 100, step_increment: 1 }),
});
groupGaps.add(rowOuterH);
settings.bind('outer-gap-horizontal', rowOuterH, 'value', Gio.SettingsBindFlags.DEFAULT);
const rowOuterV = new Adw.SpinRow({
title: 'Outer Gap (vertical)',
subtitle: 'Top / bottom screen edges (pixels)',
adjustment: new Gtk.Adjustment({ lower: 0, upper: 100, step_increment: 1 }),
});
groupGaps.add(rowOuterV);
settings.bind('outer-gap-vertical', rowOuterV, 'value', Gio.SettingsBindFlags.DEFAULT);
// ── WINDOW BEHAVIOR ────────────────────────────────────────────
const groupBehavior = new Adw.PreferencesGroup({ title: 'Window Behavior' });
page.add(groupBehavior);
const rowNewWindow = new Adw.ComboRow({
title: 'Open new windows as',
subtitle: 'Whether a new window starts as Master or Stack',
model: new Gtk.StringList({
strings: ['Stack Window (Default)', 'Master Window'],
}),
});
groupBehavior.add(rowNewWindow);
const currentBehavior = settings.get_string('new-window-behavior');
rowNewWindow.selected = currentBehavior === 'master' ? 1 : 0;
rowNewWindow.connect('notify::selected', () => {
const newVal = rowNewWindow.selected === 1 ? 'master' : 'stack';
settings.set_string('new-window-behavior', newVal);
});
// ── KEYBINDINGS ────────────────────────────────────────────
const groupKeys = new Adw.PreferencesGroup({ title: 'Keybindings' });
page.add(groupKeys);
const rowKeys = new Adw.ActionRow({
title: 'Configure Shortcuts',
subtitle: 'Adjust all shortcuts in GNOME Keyboard settings.',
});
groupKeys.add(rowKeys);
const btnOpenKeyboard = new Gtk.Button({ label: 'Open Keyboard Settings' });
btnOpenKeyboard.connect('clicked', () => {
const appInfo = Gio.AppInfo.create_from_commandline(
'gnome-control-center keyboard', null, Gio.AppInfoCreateFlags.NONE
);
appInfo.launch([], null);
});
rowKeys.add_suffix(btnOpenKeyboard);
rowKeys.set_activatable_widget(btnOpenKeyboard);
}
}
Binary file not shown.
@@ -1,34 +1,63 @@
<?xml version="1.0" encoding="UTF-8"?>
<schemalist>
<schema id="org.gnome.shell.extensions.simple-tiling.domoel"
path="/org/gnome/shell/extensions/simple-tiling-domoel/">
<!-- Master ↔ Stack -->
<schema id="org.gnome.shell.extensions.simple-tiling.domoel" path="/org/gnome/shell/extensions/simple-tiling/domoel/">
<key name="swap-master-window" type="as">
<default>['&lt;Super&gt;Return']</default>
<summary>Tauscht Master-Fenster mit dem fokussierten Fenster</summary>
<default><![CDATA[['<Super>Return']]]></default>
<summary>Swap current window with master.</summary>
</key>
<!-- Richtungs-Swaps -->
<key name="swap-left-window" type="as">
<default>['&lt;Super&gt;Left']</default>
<summary>Tauscht mit linkem Nachbarfenster</summary>
</key>
<key name="swap-right-window" type="as">
<default>['&lt;Super&gt;Right']</default>
<summary>Tauscht mit rechtem Nachbarfenster</summary>
</key>
<key name="swap-up-window" type="as">
<default>['&lt;Super&gt;Up']</default>
<summary>Tauscht mit oberem Nachbarfenster</summary>
<default><![CDATA[['<Super>Up']]]></default>
<summary>Swap current window with window above.</summary>
</key>
<key name="swap-down-window" type="as">
<default>['&lt;Super&gt;Down']</default>
<summary>Tauscht mit unterem Nachbarfenster</summary>
<default><![CDATA[['<Super>Down']]]></default>
<summary>Swap current window with window below.</summary>
</key>
<key name="swap-left-window" type="as">
<default><![CDATA[['<Super>Left']]]></default>
<summary>Swap current window with window to the left.</summary>
</key>
<key name="swap-right-window" type="as">
<default><![CDATA[['<Super>Right']]]></default>
<summary>Swap current window with window to the right.</summary>
</key>
<key name="focus-up" type="as">
<default><![CDATA[['<Alt>Up']]]></default>
<summary>Focus window above.</summary>
</key>
<key name="focus-down" type="as">
<default><![CDATA[['<Alt>Down']]]></default>
<summary>Focus window below.</summary>
</key>
<key name="focus-left" type="as">
<default><![CDATA[['<Alt>Left']]]></default>
<summary>Focus window to the left.</summary>
</key>
<key name="focus-right" type="as">
<default><![CDATA[['<Alt>Right']]]></default>
<summary>Focus window to the right.</summary>
</key>
<key name="inner-gap" type="i">
<default>10</default>
<summary>The gap between windows in pixels.</summary>
</key>
<key name="outer-gap-horizontal" type="i">
<default>5</default>
<summary>The gap to the left and right screen edges.</summary>
</key>
<key name="outer-gap-vertical" type="i">
<default>5</default>
<summary>The gap to the top and bottom screen edges.</summary>
</key>
<key name="new-window-behavior" type="s">
<default>'stack'</default>
<summary>Behavior for newly opened windows.</summary>
<description>Determines if a new window is added as master or stack window.</description>
</key>
</schema>
</schemalist>