From 4a62513b17d915afcae80b1adfb1b0cdcf86f748 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 5 Feb 2023 08:44:04 +0100 Subject: Adding upstream version 20230205. Signed-off-by: Daniel Baumann --- CHANGELOG.txt | 30 + LICENSE.txt | 674 +++++++++ Makefile | 111 ++ VERSION.txt | 1 + disable-workspace-switcher/LICENSE | 674 --------- disable-workspace-switcher/README.md | 1 - .../extension.js | 21 - .../metadata.json | 11 - extensions/disable-workspace-switcher.mk | 51 + extensions/disable-workspace-switcher/LICENSE | 674 +++++++++ extensions/disable-workspace-switcher/README.md | 1 + .../extension.js | 21 + .../metadata.json | 11 + extensions/hibernate-status.mk | 55 + extensions/hibernate-status/.gitignore | 6 + extensions/hibernate-status/LICENSE | 340 +++++ extensions/hibernate-status/Makefile | 77 + extensions/hibernate-status/README.md | 41 + extensions/hibernate-status/buildforupload.sh | 2 + extensions/hibernate-status/confirmDialog.js | 193 +++ extensions/hibernate-status/extension.js | 248 ++++ .../cs/LC_MESSAGES/hibernate-status-button.po | 66 + .../de/LC_MESSAGES/hibernate-status-button.po | 72 + .../es/LC_MESSAGES/hibernate-status-button.po | 71 + .../fa/LC_MESSAGES/hibernate-status-button.po | 72 + .../fr/LC_MESSAGES/hibernate-status-button.po | 71 + .../it/LC_MESSAGES/hibernate-status-button.po | 71 + .../nl/LC_MESSAGES/hibernate-status-button.po | 68 + .../oc/LC_MESSAGES/hibernate-status-button.po | 71 + .../pl/LC_MESSAGES/hibernate-status-button.po | 71 + .../pt/LC_MESSAGES/hibernate-status-button.po | 71 + .../pt_BR/LC_MESSAGES/hibernate-status-button.po | 73 + .../ru/LC_MESSAGES/hibernate-status-button.po | 74 + .../uk/LC_MESSAGES/hibernate-status-button.po | 74 + .../zh_CN/LC_MESSAGES/hibernate-status-button.po | 59 + extensions/hibernate-status/metadata.json | 10 + extensions/hibernate-status/prefs.js | 105 ++ ....extensions.hibernate-status-button.gschema.xml | 8 + extensions/middleclickclose.mk | 57 + extensions/middleclickclose/.gitignore | 2 + extensions/middleclickclose/LICENSE | 339 +++++ extensions/middleclickclose/README.md | 23 + extensions/middleclickclose/buildforupload.sh | 5 + .../extension.js | 117 ++ .../locale/de/LC_MESSAGES/de_DE.mo | Bin 0 -> 1335 bytes .../locale/de/LC_MESSAGES/de_DE.po | 75 + .../locale/fr/LC_MESSAGES/fr.mo | Bin 0 -> 1366 bytes .../locale/fr/LC_MESSAGES/fr.po | 75 + .../locale/it/LC_MESSAGES/it.mo | Bin 0 -> 1401 bytes .../locale/it/LC_MESSAGES/it.po | 75 + .../locale/nl/nl.mo | Bin 0 -> 1286 bytes .../locale/nl/nl.po | 74 + .../locale/sk/LC_MESSAGES/sk.mo | Bin 0 -> 1387 bytes .../locale/sk/LC_MESSAGES/sk.po | 75 + .../metadata.json | 14 + .../prefs.js | 258 ++++ ...e.shell.extensions.middleclickclose.gschema.xml | 25 + .../middleclickclose/tweak-tool-screenshot.png | Bin 0 -> 73982 bytes extensions/multi-monitors-add-on.mk | 57 + extensions/multi-monitors-add-on/.project | 11 + extensions/multi-monitors-add-on/LICENSE | 340 +++++ extensions/multi-monitors-add-on/README.md | 33 + .../multi-monitors-add-on@spin83/convenience.js | 93 ++ .../multi-monitors-add-on@spin83/extension.js | 289 ++++ .../icons/multi-monitors-l-symbolic.svg | 392 ++++++ .../icons/multi-monitors-r-symbolic.svg | 393 ++++++ .../multi-monitors-add-on@spin83/indicator.js | 109 ++ .../locale/de/LC_MESSAGES/multi-monitors-add-on.mo | Bin 0 -> 1722 bytes .../locale/de/LC_MESSAGES/multi-monitors-add-on.po | 95 ++ .../locale/es/LC_MESSAGES/multi-monitors-add-on.mo | Bin 0 -> 1593 bytes .../locale/es/LC_MESSAGES/multi-monitors-add-on.po | 91 ++ .../locale/fr/LC_MESSAGES/multi-monitors-add-on.mo | Bin 0 -> 1701 bytes .../locale/fr/LC_MESSAGES/multi-monitors-add-on.po | 94 ++ .../locale/it/LC_MESSAGES/multi-monitors-add-on.mo | Bin 0 -> 1820 bytes .../locale/it/LC_MESSAGES/multi-monitors-add-on.po | 93 ++ .../locale/pl/LC_MESSAGES/multi-monitors-add-on.mo | Bin 0 -> 1743 bytes .../locale/pl/LC_MESSAGES/multi-monitors-add-on.po | 94 ++ .../pt_BR/LC_MESSAGES/multi-monitors-add-on.mo | Bin 0 -> 1759 bytes .../pt_BR/LC_MESSAGES/multi-monitors-add-on.po | 89 ++ .../multi-monitors-add-on@spin83/metadata.json | 10 + .../multi-monitors-add-on@spin83/mmcalendar.js | 412 ++++++ .../multi-monitors-add-on@spin83/mmlayout.js | 251 ++++ .../multi-monitors-add-on@spin83/mmoverview.js | 678 +++++++++ .../multi-monitors-add-on@spin83/mmpanel.js | 520 +++++++ .../multi-monitors-add-on.pot | 89 ++ .../multi-monitors-add-on@spin83/prefs.js | 289 ++++ .../schemas/gschemas.compiled | Bin 0 -> 788 bytes ...ll.extensions.multi-monitors-add-on.gschema.xml | 59 + .../multi-monitors-add-on@spin83/stylesheet.css | 29 + extensions/no-overview.mk | 58 + extensions/no-overview/LICENSE | 674 +++++++++ extensions/no-overview/README.md | 3 + extensions/no-overview/extension.js | 38 + extensions/vertical-workspaces.mk | 56 + extensions/vertical-workspaces/CHANGELOG.md | 147 ++ extensions/vertical-workspaces/LICENSE | 674 +++++++++ extensions/vertical-workspaces/Makefile | 90 ++ extensions/vertical-workspaces/README.md | 72 + extensions/vertical-workspaces/appDisplay.js | 944 +++++++++++++ extensions/vertical-workspaces/dash.js | 829 +++++++++++ extensions/vertical-workspaces/extension.js | 564 ++++++++ extensions/vertical-workspaces/iconGrid.js | 26 + extensions/vertical-workspaces/layout.js | 71 + extensions/vertical-workspaces/metadata.json | 13 + extensions/vertical-workspaces/optionsFactory.js | 552 ++++++++ extensions/vertical-workspaces/overview.js | 68 + extensions/vertical-workspaces/overviewControls.js | 1464 ++++++++++++++++++++ extensions/vertical-workspaces/panel.js | 178 +++ extensions/vertical-workspaces/prefs.js | 1183 ++++++++++++++++ .../recentFilesSearchProvider.js | 324 +++++ ...hell.extensions.vertical-workspaces.gschema.xml | 179 +++ .../vertical-workspaces/screenshots/screenshot.jpg | Bin 0 -> 416550 bytes .../screenshots/screenshot0.png | Bin 0 -> 1027234 bytes .../screenshots/screenshot1.png | Bin 0 -> 320234 bytes .../screenshots/screenshot2.png | Bin 0 -> 137011 bytes .../screenshots/screenshot3.png | Bin 0 -> 199479 bytes .../screenshots/screenshot4.png | Bin 0 -> 65092 bytes .../screenshots/screenshot5.png | Bin 0 -> 49185 bytes .../screenshots/vertical-workspaces.gif | Bin 0 -> 1213475 bytes extensions/vertical-workspaces/search.js | 52 + extensions/vertical-workspaces/settings.js | 310 +++++ extensions/vertical-workspaces/stylesheet.css | 167 +++ extensions/vertical-workspaces/swipeTracker.js | 79 ++ extensions/vertical-workspaces/util.js | 270 ++++ extensions/vertical-workspaces/windowManager.js | 208 +++ extensions/vertical-workspaces/windowPreview.js | 335 +++++ .../vertical-workspaces/windowSearchProvider.js | 358 +++++ extensions/vertical-workspaces/workspace.js | 146 ++ .../vertical-workspaces/workspaceAnimation.js | 179 +++ .../vertical-workspaces/workspaceSwitcherPopup.js | 55 + .../vertical-workspaces/workspaceThumbnail.js | 760 ++++++++++ extensions/vertical-workspaces/workspacesView.js | 864 ++++++++++++ hibernate-status/.gitignore | 6 - hibernate-status/LICENSE | 340 ----- hibernate-status/Makefile | 77 - hibernate-status/README.md | 41 - hibernate-status/buildforupload.sh | 2 - hibernate-status/confirmDialog.js | 193 --- hibernate-status/extension.js | 248 ---- .../cs/LC_MESSAGES/hibernate-status-button.po | 66 - .../de/LC_MESSAGES/hibernate-status-button.po | 72 - .../es/LC_MESSAGES/hibernate-status-button.po | 71 - .../fa/LC_MESSAGES/hibernate-status-button.po | 72 - .../fr/LC_MESSAGES/hibernate-status-button.po | 71 - .../it/LC_MESSAGES/hibernate-status-button.po | 71 - .../nl/LC_MESSAGES/hibernate-status-button.po | 68 - .../oc/LC_MESSAGES/hibernate-status-button.po | 71 - .../pl/LC_MESSAGES/hibernate-status-button.po | 71 - .../pt/LC_MESSAGES/hibernate-status-button.po | 71 - .../pt_BR/LC_MESSAGES/hibernate-status-button.po | 73 - .../ru/LC_MESSAGES/hibernate-status-button.po | 74 - .../uk/LC_MESSAGES/hibernate-status-button.po | 74 - .../zh_CN/LC_MESSAGES/hibernate-status-button.po | 59 - hibernate-status/metadata.json | 10 - hibernate-status/prefs.js | 105 -- ....extensions.hibernate-status-button.gschema.xml | 8 - multi-monitors-add-on/.project | 11 - multi-monitors-add-on/LICENSE | 340 ----- multi-monitors-add-on/README.md | 33 - .../multi-monitors-add-on@spin83/convenience.js | 93 -- .../multi-monitors-add-on@spin83/extension.js | 289 ---- .../icons/multi-monitors-l-symbolic.svg | 392 ------ .../icons/multi-monitors-r-symbolic.svg | 393 ------ .../multi-monitors-add-on@spin83/indicator.js | 109 -- .../locale/de/LC_MESSAGES/multi-monitors-add-on.mo | Bin 1722 -> 0 bytes .../locale/de/LC_MESSAGES/multi-monitors-add-on.po | 95 -- .../locale/es/LC_MESSAGES/multi-monitors-add-on.mo | Bin 1593 -> 0 bytes .../locale/es/LC_MESSAGES/multi-monitors-add-on.po | 91 -- .../locale/fr/LC_MESSAGES/multi-monitors-add-on.mo | Bin 1701 -> 0 bytes .../locale/fr/LC_MESSAGES/multi-monitors-add-on.po | 94 -- .../locale/it/LC_MESSAGES/multi-monitors-add-on.mo | Bin 1820 -> 0 bytes .../locale/it/LC_MESSAGES/multi-monitors-add-on.po | 93 -- .../locale/pl/LC_MESSAGES/multi-monitors-add-on.mo | Bin 1743 -> 0 bytes .../locale/pl/LC_MESSAGES/multi-monitors-add-on.po | 94 -- .../pt_BR/LC_MESSAGES/multi-monitors-add-on.mo | Bin 1759 -> 0 bytes .../pt_BR/LC_MESSAGES/multi-monitors-add-on.po | 89 -- .../multi-monitors-add-on@spin83/metadata.json | 10 - .../multi-monitors-add-on@spin83/mmcalendar.js | 412 ------ .../multi-monitors-add-on@spin83/mmlayout.js | 251 ---- .../multi-monitors-add-on@spin83/mmoverview.js | 678 --------- .../multi-monitors-add-on@spin83/mmpanel.js | 520 ------- .../multi-monitors-add-on.pot | 89 -- .../multi-monitors-add-on@spin83/prefs.js | 289 ---- .../schemas/gschemas.compiled | Bin 788 -> 0 bytes ...ll.extensions.multi-monitors-add-on.gschema.xml | 59 - .../multi-monitors-add-on@spin83/stylesheet.css | 29 - share/man/Makefile | 59 + share/man/gnome-shell-extensions-extra.7.rst | 77 + share/man/man.in | 19 + 189 files changed, 21612 insertions(+), 7274 deletions(-) create mode 100644 CHANGELOG.txt create mode 100644 LICENSE.txt create mode 100644 Makefile create mode 100644 VERSION.txt delete mode 100644 disable-workspace-switcher/LICENSE delete mode 100644 disable-workspace-switcher/README.md delete mode 100644 disable-workspace-switcher/disable-workspace-switcher@jbradaric.me/extension.js delete mode 100644 disable-workspace-switcher/disable-workspace-switcher@jbradaric.me/metadata.json create mode 100644 extensions/disable-workspace-switcher.mk create mode 100644 extensions/disable-workspace-switcher/LICENSE create mode 100644 extensions/disable-workspace-switcher/README.md create mode 100644 extensions/disable-workspace-switcher/disable-workspace-switcher@jbradaric.me/extension.js create mode 100644 extensions/disable-workspace-switcher/disable-workspace-switcher@jbradaric.me/metadata.json create mode 100644 extensions/hibernate-status.mk create mode 100644 extensions/hibernate-status/.gitignore create mode 100644 extensions/hibernate-status/LICENSE create mode 100644 extensions/hibernate-status/Makefile create mode 100644 extensions/hibernate-status/README.md create mode 100755 extensions/hibernate-status/buildforupload.sh create mode 100644 extensions/hibernate-status/confirmDialog.js create mode 100644 extensions/hibernate-status/extension.js create mode 100644 extensions/hibernate-status/locale/cs/LC_MESSAGES/hibernate-status-button.po create mode 100644 extensions/hibernate-status/locale/de/LC_MESSAGES/hibernate-status-button.po create mode 100644 extensions/hibernate-status/locale/es/LC_MESSAGES/hibernate-status-button.po create mode 100644 extensions/hibernate-status/locale/fa/LC_MESSAGES/hibernate-status-button.po create mode 100644 extensions/hibernate-status/locale/fr/LC_MESSAGES/hibernate-status-button.po create mode 100644 extensions/hibernate-status/locale/it/LC_MESSAGES/hibernate-status-button.po create mode 100644 extensions/hibernate-status/locale/nl/LC_MESSAGES/hibernate-status-button.po create mode 100644 extensions/hibernate-status/locale/oc/LC_MESSAGES/hibernate-status-button.po create mode 100644 extensions/hibernate-status/locale/pl/LC_MESSAGES/hibernate-status-button.po create mode 100644 extensions/hibernate-status/locale/pt/LC_MESSAGES/hibernate-status-button.po create mode 100644 extensions/hibernate-status/locale/pt_BR/LC_MESSAGES/hibernate-status-button.po create mode 100644 extensions/hibernate-status/locale/ru/LC_MESSAGES/hibernate-status-button.po create mode 100644 extensions/hibernate-status/locale/uk/LC_MESSAGES/hibernate-status-button.po create mode 100644 extensions/hibernate-status/locale/zh_CN/LC_MESSAGES/hibernate-status-button.po create mode 100644 extensions/hibernate-status/metadata.json create mode 100644 extensions/hibernate-status/prefs.js create mode 100644 extensions/hibernate-status/schemas/org.gnome.shell.extensions.hibernate-status-button.gschema.xml create mode 100644 extensions/middleclickclose.mk create mode 100644 extensions/middleclickclose/.gitignore create mode 100644 extensions/middleclickclose/LICENSE create mode 100644 extensions/middleclickclose/README.md create mode 100755 extensions/middleclickclose/buildforupload.sh create mode 100644 extensions/middleclickclose/middleclickclose@paolo.tranquilli.gmail.com/extension.js create mode 100644 extensions/middleclickclose/middleclickclose@paolo.tranquilli.gmail.com/locale/de/LC_MESSAGES/de_DE.mo create mode 100644 extensions/middleclickclose/middleclickclose@paolo.tranquilli.gmail.com/locale/de/LC_MESSAGES/de_DE.po create mode 100644 extensions/middleclickclose/middleclickclose@paolo.tranquilli.gmail.com/locale/fr/LC_MESSAGES/fr.mo create mode 100644 extensions/middleclickclose/middleclickclose@paolo.tranquilli.gmail.com/locale/fr/LC_MESSAGES/fr.po create mode 100644 extensions/middleclickclose/middleclickclose@paolo.tranquilli.gmail.com/locale/it/LC_MESSAGES/it.mo create mode 100644 extensions/middleclickclose/middleclickclose@paolo.tranquilli.gmail.com/locale/it/LC_MESSAGES/it.po create mode 100644 extensions/middleclickclose/middleclickclose@paolo.tranquilli.gmail.com/locale/nl/nl.mo create mode 100644 extensions/middleclickclose/middleclickclose@paolo.tranquilli.gmail.com/locale/nl/nl.po create mode 100644 extensions/middleclickclose/middleclickclose@paolo.tranquilli.gmail.com/locale/sk/LC_MESSAGES/sk.mo create mode 100644 extensions/middleclickclose/middleclickclose@paolo.tranquilli.gmail.com/locale/sk/LC_MESSAGES/sk.po create mode 100644 extensions/middleclickclose/middleclickclose@paolo.tranquilli.gmail.com/metadata.json create mode 100644 extensions/middleclickclose/middleclickclose@paolo.tranquilli.gmail.com/prefs.js create mode 100644 extensions/middleclickclose/middleclickclose@paolo.tranquilli.gmail.com/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml create mode 100644 extensions/middleclickclose/tweak-tool-screenshot.png create mode 100644 extensions/multi-monitors-add-on.mk create mode 100644 extensions/multi-monitors-add-on/.project create mode 100644 extensions/multi-monitors-add-on/LICENSE create mode 100644 extensions/multi-monitors-add-on/README.md create mode 100644 extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/convenience.js create mode 100644 extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/extension.js create mode 100644 extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/icons/multi-monitors-l-symbolic.svg create mode 100644 extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/icons/multi-monitors-r-symbolic.svg create mode 100644 extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/indicator.js create mode 100644 extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/locale/de/LC_MESSAGES/multi-monitors-add-on.mo create mode 100644 extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/locale/de/LC_MESSAGES/multi-monitors-add-on.po create mode 100644 extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/locale/es/LC_MESSAGES/multi-monitors-add-on.mo create mode 100644 extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/locale/es/LC_MESSAGES/multi-monitors-add-on.po create mode 100644 extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/locale/fr/LC_MESSAGES/multi-monitors-add-on.mo create mode 100644 extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/locale/fr/LC_MESSAGES/multi-monitors-add-on.po create mode 100644 extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/locale/it/LC_MESSAGES/multi-monitors-add-on.mo create mode 100644 extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/locale/it/LC_MESSAGES/multi-monitors-add-on.po create mode 100644 extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/locale/pl/LC_MESSAGES/multi-monitors-add-on.mo create mode 100644 extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/locale/pl/LC_MESSAGES/multi-monitors-add-on.po create mode 100644 extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/locale/pt_BR/LC_MESSAGES/multi-monitors-add-on.mo create mode 100644 extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/locale/pt_BR/LC_MESSAGES/multi-monitors-add-on.po create mode 100644 extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/metadata.json create mode 100644 extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/mmcalendar.js create mode 100644 extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/mmlayout.js create mode 100644 extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/mmoverview.js create mode 100644 extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/mmpanel.js create mode 100644 extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/multi-monitors-add-on.pot create mode 100644 extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/prefs.js create mode 100644 extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/schemas/gschemas.compiled create mode 100644 extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/schemas/org.gnome.shell.extensions.multi-monitors-add-on.gschema.xml create mode 100644 extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/stylesheet.css create mode 100644 extensions/no-overview.mk create mode 100644 extensions/no-overview/LICENSE create mode 100644 extensions/no-overview/README.md create mode 100644 extensions/no-overview/extension.js create mode 100644 extensions/vertical-workspaces.mk create mode 100644 extensions/vertical-workspaces/CHANGELOG.md create mode 100644 extensions/vertical-workspaces/LICENSE create mode 100644 extensions/vertical-workspaces/Makefile create mode 100644 extensions/vertical-workspaces/README.md create mode 100644 extensions/vertical-workspaces/appDisplay.js create mode 100644 extensions/vertical-workspaces/dash.js create mode 100644 extensions/vertical-workspaces/extension.js create mode 100644 extensions/vertical-workspaces/iconGrid.js create mode 100644 extensions/vertical-workspaces/layout.js create mode 100644 extensions/vertical-workspaces/metadata.json create mode 100644 extensions/vertical-workspaces/optionsFactory.js create mode 100644 extensions/vertical-workspaces/overview.js create mode 100644 extensions/vertical-workspaces/overviewControls.js create mode 100644 extensions/vertical-workspaces/panel.js create mode 100644 extensions/vertical-workspaces/prefs.js create mode 100644 extensions/vertical-workspaces/recentFilesSearchProvider.js create mode 100644 extensions/vertical-workspaces/schemas/org.gnome.shell.extensions.vertical-workspaces.gschema.xml create mode 100644 extensions/vertical-workspaces/screenshots/screenshot.jpg create mode 100644 extensions/vertical-workspaces/screenshots/screenshot0.png create mode 100644 extensions/vertical-workspaces/screenshots/screenshot1.png create mode 100644 extensions/vertical-workspaces/screenshots/screenshot2.png create mode 100644 extensions/vertical-workspaces/screenshots/screenshot3.png create mode 100644 extensions/vertical-workspaces/screenshots/screenshot4.png create mode 100644 extensions/vertical-workspaces/screenshots/screenshot5.png create mode 100644 extensions/vertical-workspaces/screenshots/vertical-workspaces.gif create mode 100644 extensions/vertical-workspaces/search.js create mode 100644 extensions/vertical-workspaces/settings.js create mode 100644 extensions/vertical-workspaces/stylesheet.css create mode 100644 extensions/vertical-workspaces/swipeTracker.js create mode 100644 extensions/vertical-workspaces/util.js create mode 100644 extensions/vertical-workspaces/windowManager.js create mode 100644 extensions/vertical-workspaces/windowPreview.js create mode 100644 extensions/vertical-workspaces/windowSearchProvider.js create mode 100644 extensions/vertical-workspaces/workspace.js create mode 100644 extensions/vertical-workspaces/workspaceAnimation.js create mode 100644 extensions/vertical-workspaces/workspaceSwitcherPopup.js create mode 100644 extensions/vertical-workspaces/workspaceThumbnail.js create mode 100644 extensions/vertical-workspaces/workspacesView.js delete mode 100644 hibernate-status/.gitignore delete mode 100644 hibernate-status/LICENSE delete mode 100644 hibernate-status/Makefile delete mode 100644 hibernate-status/README.md delete mode 100755 hibernate-status/buildforupload.sh delete mode 100644 hibernate-status/confirmDialog.js delete mode 100644 hibernate-status/extension.js delete mode 100644 hibernate-status/locale/cs/LC_MESSAGES/hibernate-status-button.po delete mode 100644 hibernate-status/locale/de/LC_MESSAGES/hibernate-status-button.po delete mode 100644 hibernate-status/locale/es/LC_MESSAGES/hibernate-status-button.po delete mode 100644 hibernate-status/locale/fa/LC_MESSAGES/hibernate-status-button.po delete mode 100644 hibernate-status/locale/fr/LC_MESSAGES/hibernate-status-button.po delete mode 100644 hibernate-status/locale/it/LC_MESSAGES/hibernate-status-button.po delete mode 100644 hibernate-status/locale/nl/LC_MESSAGES/hibernate-status-button.po delete mode 100644 hibernate-status/locale/oc/LC_MESSAGES/hibernate-status-button.po delete mode 100644 hibernate-status/locale/pl/LC_MESSAGES/hibernate-status-button.po delete mode 100644 hibernate-status/locale/pt/LC_MESSAGES/hibernate-status-button.po delete mode 100644 hibernate-status/locale/pt_BR/LC_MESSAGES/hibernate-status-button.po delete mode 100644 hibernate-status/locale/ru/LC_MESSAGES/hibernate-status-button.po delete mode 100644 hibernate-status/locale/uk/LC_MESSAGES/hibernate-status-button.po delete mode 100644 hibernate-status/locale/zh_CN/LC_MESSAGES/hibernate-status-button.po delete mode 100644 hibernate-status/metadata.json delete mode 100644 hibernate-status/prefs.js delete mode 100644 hibernate-status/schemas/org.gnome.shell.extensions.hibernate-status-button.gschema.xml delete mode 100644 multi-monitors-add-on/.project delete mode 100644 multi-monitors-add-on/LICENSE delete mode 100644 multi-monitors-add-on/README.md delete mode 100644 multi-monitors-add-on/multi-monitors-add-on@spin83/convenience.js delete mode 100644 multi-monitors-add-on/multi-monitors-add-on@spin83/extension.js delete mode 100644 multi-monitors-add-on/multi-monitors-add-on@spin83/icons/multi-monitors-l-symbolic.svg delete mode 100644 multi-monitors-add-on/multi-monitors-add-on@spin83/icons/multi-monitors-r-symbolic.svg delete mode 100644 multi-monitors-add-on/multi-monitors-add-on@spin83/indicator.js delete mode 100644 multi-monitors-add-on/multi-monitors-add-on@spin83/locale/de/LC_MESSAGES/multi-monitors-add-on.mo delete mode 100644 multi-monitors-add-on/multi-monitors-add-on@spin83/locale/de/LC_MESSAGES/multi-monitors-add-on.po delete mode 100644 multi-monitors-add-on/multi-monitors-add-on@spin83/locale/es/LC_MESSAGES/multi-monitors-add-on.mo delete mode 100644 multi-monitors-add-on/multi-monitors-add-on@spin83/locale/es/LC_MESSAGES/multi-monitors-add-on.po delete mode 100644 multi-monitors-add-on/multi-monitors-add-on@spin83/locale/fr/LC_MESSAGES/multi-monitors-add-on.mo delete mode 100644 multi-monitors-add-on/multi-monitors-add-on@spin83/locale/fr/LC_MESSAGES/multi-monitors-add-on.po delete mode 100644 multi-monitors-add-on/multi-monitors-add-on@spin83/locale/it/LC_MESSAGES/multi-monitors-add-on.mo delete mode 100644 multi-monitors-add-on/multi-monitors-add-on@spin83/locale/it/LC_MESSAGES/multi-monitors-add-on.po delete mode 100644 multi-monitors-add-on/multi-monitors-add-on@spin83/locale/pl/LC_MESSAGES/multi-monitors-add-on.mo delete mode 100644 multi-monitors-add-on/multi-monitors-add-on@spin83/locale/pl/LC_MESSAGES/multi-monitors-add-on.po delete mode 100644 multi-monitors-add-on/multi-monitors-add-on@spin83/locale/pt_BR/LC_MESSAGES/multi-monitors-add-on.mo delete mode 100644 multi-monitors-add-on/multi-monitors-add-on@spin83/locale/pt_BR/LC_MESSAGES/multi-monitors-add-on.po delete mode 100644 multi-monitors-add-on/multi-monitors-add-on@spin83/metadata.json delete mode 100644 multi-monitors-add-on/multi-monitors-add-on@spin83/mmcalendar.js delete mode 100644 multi-monitors-add-on/multi-monitors-add-on@spin83/mmlayout.js delete mode 100644 multi-monitors-add-on/multi-monitors-add-on@spin83/mmoverview.js delete mode 100644 multi-monitors-add-on/multi-monitors-add-on@spin83/mmpanel.js delete mode 100644 multi-monitors-add-on/multi-monitors-add-on@spin83/multi-monitors-add-on.pot delete mode 100644 multi-monitors-add-on/multi-monitors-add-on@spin83/prefs.js delete mode 100644 multi-monitors-add-on/multi-monitors-add-on@spin83/schemas/gschemas.compiled delete mode 100644 multi-monitors-add-on/multi-monitors-add-on@spin83/schemas/org.gnome.shell.extensions.multi-monitors-add-on.gschema.xml delete mode 100644 multi-monitors-add-on/multi-monitors-add-on@spin83/stylesheet.css create mode 100644 share/man/Makefile create mode 100644 share/man/gnome-shell-extensions-extra.7.rst create mode 100644 share/man/man.in diff --git a/CHANGELOG.txt b/CHANGELOG.txt new file mode 100644 index 0000000..ccac9c1 --- /dev/null +++ b/CHANGELOG.txt @@ -0,0 +1,30 @@ +2023-02-05 Daniel Baumann + + * Releasing version 20230205. + + [ Daniel Baumann ] + * Adding changelog. + * Adding license. + * Adding makefile. + * Adding manpage. + * Adding version. + * Moving extensions to subdirectory. + * Adding extension makefiles. + * Adding middleclickclose version 1.8.1 [f35350e]. + * Adding middleclickclose makefile. + * Adding middleclickclose entry in manpage. + * Adding no-overview version 12 [665d0e1]. + * Adding no-overview makefile. + * Adding no-overview entry in manpage. + * Adding vertical-workspaces version 23.5 [ba7d77f]. + * Adding vertical-workspaces makefile. + * Adding vertical-workspaces in manpage. + +2023-02-04 Daniel Baumann + + * Releasing version 20230204. + + [ Daniel Baumann ] + * Adding disable-workspace-switcher version 2 (8d94260). + * Adding hibernate-status version 20230113 (bfca991). + * Adding multi-monitors-add-on version 25 (515dfd0). diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..f288702 --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..ca57896 --- /dev/null +++ b/Makefile @@ -0,0 +1,111 @@ +# Progress Linux: gnome-shell-extensions-extra + +# Copyright (C) 2010-2023 Daniel Baumann +# +# SPDX-License-Identifier: GPL-3.0+ +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +SHELL := sh -e + +SOFTWARE = gnome-shell-extensions-extra +VERSION := $(shell cat VERSION.txt) + +extensions-%: + @cd extensions; \ + for EXTENSION in *.mk; \ + do \ + echo "################################################################################"; \ + echo "$${EXTENSION}: $$(echo ${@} | cut -d- -f2-)"; \ + echo "################################################################################"; \ + $(MAKE) -f $${EXTENSION} $$(echo ${@} | cut -d- -f2-); \ + done + +package-test: + +package-build: share/man/*.rst + $(MAKE) -C share/man + + sed -n '/^===/,$$p' share/man/$(SOFTWARE).7.rst > README.txt + +package-install: package-build + mkdir -p $(DESTDIR)/usr/share/doc/$(SOFTWARE) + cp -r CHANGELOG.txt LICENSE.txt README.txt $(DESTDIR)/usr/share/doc/$(SOFTWARE) + + for SECTION in $$(seq 1 8); \ + do \ + if ls share/man/*.$${SECTION} > /dev/null 2>&1; \ + then \ + mkdir -p $(DESTDIR)/usr/share/man/man$${SECTION}; \ + cp share/man/*.$${SECTION} $(DESTDIR)/usr/share/man/man$${SECTION}; \ + fi; \ + done + +package-uninstall: + for SECTION in $$(seq 1 8); \ + do \ + for FILE in share/man/*.$${SECTION}; \ + do \ + rm -f $(DESTDIR)/usr/share/man/man$${SECTION}/$$(basename $${FILE}); \ + done; \ + rmdir --ignore-fail-on-non-empty --parents $(DESTDIR)/usr/share/man/man$${SECTION} || true; \ + done + + rm -rf $(DESTDIR)/usr/share/doc/$(SOFTWARE) + rmdir --ignore-fail-on-non-empty --parents $(DESTDIR)/usr/share/doc || true + + rmdir --ignore-fail-on-non-empty --parents $(DESTDIR) || true + +package-clean: + $(MAKE) -C share/man clean + + rm -f README.txt + +all: build + +test: extensions-test package-test + +build: extensions-build package-build + +install: extensions-install package-install + +uninstall: extensions-uninstall package-uninstall + +clean: extensions-clean package-clean + +distclean: clean + rm -rf $(SOFTWARE)-$(VERSION) + +reinstall: uninstall install + +release: distclean + git commit -a -s -S -m 'Releasing version $(VERSION).' || true + git tag -s -m 'Tagging version $(VERSION).' v$(VERSION) || true + + mkdir -p $(SOFTWARE)-$(VERSION) + find . -mindepth 1 -maxdepth 1 -and -not -name ".git*" -and -not -name debian -and -not -name $(SOFTWARE)-$(VERSION) -exec cp \-a {} $(SOFTWARE)-$(VERSION) \; + + for FORMAT in xz lzip; \ + do \ + EXTENSION=$$(echo $${FORMAT} | cut -b-2); \ + tar --$${FORMAT} -cf ../$(SOFTWARE)-$(VERSION).tar.$${EXTENSION} $(SOFTWARE)-$(VERSION); \ + sha512sum ../$(SOFTWARE)-$(VERSION).tar.$${EXTENSION} > ../$(SOFTWARE)-$(VERSION).tar.$${EXTENSION}.sha512; \ + gpg --default-key 0x3E6CA28DAAF8DD14 --armor -b ../$(SOFTWARE)-$(VERSION).tar.$${EXTENSION}; \ + mv ../$(SOFTWARE)-$(VERSION).tar.$${EXTENSION}.asc ../$(SOFTWARE)-$(VERSION).tar.$${EXTENSION}.sig; \ + done + + rm -rf $(SOFTWARE)-$(VERSION) + +upload: + scp ../$(SOFTWARE)-$(VERSION).* get.progress-linux.org:/srv/get.progress-linux.org/packages/$(SOFTWARE)/upstream diff --git a/VERSION.txt b/VERSION.txt new file mode 100644 index 0000000..40ef8d3 --- /dev/null +++ b/VERSION.txt @@ -0,0 +1 @@ +20230205 diff --git a/disable-workspace-switcher/LICENSE b/disable-workspace-switcher/LICENSE deleted file mode 100644 index f288702..0000000 --- a/disable-workspace-switcher/LICENSE +++ /dev/null @@ -1,674 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - Copyright (C) - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. diff --git a/disable-workspace-switcher/README.md b/disable-workspace-switcher/README.md deleted file mode 100644 index bae853f..0000000 --- a/disable-workspace-switcher/README.md +++ /dev/null @@ -1 +0,0 @@ -GNOME Shell extension that disables the workspace switcher popup diff --git a/disable-workspace-switcher/disable-workspace-switcher@jbradaric.me/extension.js b/disable-workspace-switcher/disable-workspace-switcher@jbradaric.me/extension.js deleted file mode 100644 index e805c3b..0000000 --- a/disable-workspace-switcher/disable-workspace-switcher@jbradaric.me/extension.js +++ /dev/null @@ -1,21 +0,0 @@ -'use strict' - -const WorkspaceSwitcherPopup = imports.ui.workspaceSwitcherPopup.WorkspaceSwitcherPopup; - -class Extension { - constructor() { - this.originalWorkspaceSwitcherPopup_display = WorkspaceSwitcherPopup.prototype.display; - } - - enable() { - WorkspaceSwitcherPopup.prototype.display = () => {}; - } - - disable() { - WorkspaceSwitcherPopup.prototype.display = this.originalWorkspaceSwitcherPopup_display; - } -} - -function init() { - return new Extension(); -} diff --git a/disable-workspace-switcher/disable-workspace-switcher@jbradaric.me/metadata.json b/disable-workspace-switcher/disable-workspace-switcher@jbradaric.me/metadata.json deleted file mode 100644 index cfbf8e5..0000000 --- a/disable-workspace-switcher/disable-workspace-switcher@jbradaric.me/metadata.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "Disable Workspace Switcher", - "description": "Disable the workspace switcher popup.", - "version": 1, - "uuid": "disable-workspace-switcher@jbradaric.me", - "url": "https://github.com/jbradaric/disable-workspace-switcher", - "shell-version": [ - "42", - "43" - ] -} diff --git a/extensions/disable-workspace-switcher.mk b/extensions/disable-workspace-switcher.mk new file mode 100644 index 0000000..f522857 --- /dev/null +++ b/extensions/disable-workspace-switcher.mk @@ -0,0 +1,51 @@ +# Progress Linux: gnome-shell-extensions-extra + +# Copyright (C) 2010-2023 Daniel Baumann +# +# SPDX-License-Identifier: GPL-3.0+ +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Build-Depends: +# none + +SHELL := sh -e + +EXTENSION := disable-workspace-switcher +UUID := $(shell awk -F\" '/"uuid": / { print $$4 }' $(EXTENSION)/*@*/metadata.json) + +all: + +test: + +build: + +install: + mkdir -p $(DESTDIR)/usr/share/gnome-shell/extensions + cp -a $(EXTENSION)/$(UUID) $(DESTDIR)/usr/share/gnome-shell/extensions + +uninstall: + rm -rf $(DESTDIR)/usr/share/gnome-shell/extensions/$(UUID) + rmdir --ignore-fail-on-non-empty --parents $(DESTDIR) || true + +clean: + +distclean: + +reinstall: uninstall install + +upstream: + rm -rf $(EXTENSION) + git clone https://github.com/jbradaric/$(EXTENSION) + rm -rf $(EXTENSION)/.git diff --git a/extensions/disable-workspace-switcher/LICENSE b/extensions/disable-workspace-switcher/LICENSE new file mode 100644 index 0000000..f288702 --- /dev/null +++ b/extensions/disable-workspace-switcher/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/extensions/disable-workspace-switcher/README.md b/extensions/disable-workspace-switcher/README.md new file mode 100644 index 0000000..bae853f --- /dev/null +++ b/extensions/disable-workspace-switcher/README.md @@ -0,0 +1 @@ +GNOME Shell extension that disables the workspace switcher popup diff --git a/extensions/disable-workspace-switcher/disable-workspace-switcher@jbradaric.me/extension.js b/extensions/disable-workspace-switcher/disable-workspace-switcher@jbradaric.me/extension.js new file mode 100644 index 0000000..e805c3b --- /dev/null +++ b/extensions/disable-workspace-switcher/disable-workspace-switcher@jbradaric.me/extension.js @@ -0,0 +1,21 @@ +'use strict' + +const WorkspaceSwitcherPopup = imports.ui.workspaceSwitcherPopup.WorkspaceSwitcherPopup; + +class Extension { + constructor() { + this.originalWorkspaceSwitcherPopup_display = WorkspaceSwitcherPopup.prototype.display; + } + + enable() { + WorkspaceSwitcherPopup.prototype.display = () => {}; + } + + disable() { + WorkspaceSwitcherPopup.prototype.display = this.originalWorkspaceSwitcherPopup_display; + } +} + +function init() { + return new Extension(); +} diff --git a/extensions/disable-workspace-switcher/disable-workspace-switcher@jbradaric.me/metadata.json b/extensions/disable-workspace-switcher/disable-workspace-switcher@jbradaric.me/metadata.json new file mode 100644 index 0000000..cfbf8e5 --- /dev/null +++ b/extensions/disable-workspace-switcher/disable-workspace-switcher@jbradaric.me/metadata.json @@ -0,0 +1,11 @@ +{ + "name": "Disable Workspace Switcher", + "description": "Disable the workspace switcher popup.", + "version": 1, + "uuid": "disable-workspace-switcher@jbradaric.me", + "url": "https://github.com/jbradaric/disable-workspace-switcher", + "shell-version": [ + "42", + "43" + ] +} diff --git a/extensions/hibernate-status.mk b/extensions/hibernate-status.mk new file mode 100644 index 0000000..05651b5 --- /dev/null +++ b/extensions/hibernate-status.mk @@ -0,0 +1,55 @@ +# Progress Linux: gnome-shell-extensions-extra + +# Copyright (C) 2010-2023 Daniel Baumann +# +# SPDX-License-Identifier: GPL-3.0+ +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Build-Depends: +# libglib2.0-bin + +SHELL := sh -e + +EXTENSION := hibernate-status +UUID := $(shell awk -F\" '/"uuid": / { print $$4 }' $(EXTENSION)/metadata.json) + +all: + +test: + +build: + +install: + $(MAKE) -C $(EXTENSION) DESTDIR=$(DESTDIR) install + + # removing unused files + rm -f $(DESTDIR)/usr/share/gnome-shell/extensions/$(UUID)/LICENSE + rm -f $(DESTDIR)/usr/share/gnome-shell/extensions/$(UUID)/README.md + +uninstall: + rm -rf $(DESTDIR)/usr/share/gnome-shell/extensions/$(UUID) + rmdir --ignore-fail-on-non-empty --parents $(DESTDIR) || true + +clean: + $(MAKE) -C $(EXTENSION) clean + +distclean: + +reinstall: uninstall install + +upstream: + rm -rf $(EXTENSION) + git clone https://github.com/arelange/gnome-shell-extension-$(EXTENSION) $(EXTENSION) + rm -rf $(EXTENSION)/.git diff --git a/extensions/hibernate-status/.gitignore b/extensions/hibernate-status/.gitignore new file mode 100644 index 0000000..68270f9 --- /dev/null +++ b/extensions/hibernate-status/.gitignore @@ -0,0 +1,6 @@ +**/*.compiled +*.zip +.~ +*~ +*.mo +locale/hibernate-status-button.pot diff --git a/extensions/hibernate-status/LICENSE b/extensions/hibernate-status/LICENSE new file mode 100644 index 0000000..d6a9326 --- /dev/null +++ b/extensions/hibernate-status/LICENSE @@ -0,0 +1,340 @@ +GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + {description} + Copyright (C) {year} {fullname} + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + {signature of Ty Coon}, 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. + diff --git a/extensions/hibernate-status/Makefile b/extensions/hibernate-status/Makefile new file mode 100644 index 0000000..3378024 --- /dev/null +++ b/extensions/hibernate-status/Makefile @@ -0,0 +1,77 @@ +# Basic Makefile + +UUID = hibernate-status@dromi +BASE_MODULES = extension.js metadata.json confirmDialog.js LICENSE README.md +EXTRA_MODULES = prefs.js +TOLOCALIZE = confirmDialog.js prefs.js +PO_FILES := $(wildcard ./locale/*/*/*.po) +MO_FILES := $(PO_FILES:.po=.mo) + +ifeq ($(strip $(DESTDIR)),) + INSTALLTYPE = local + INSTALLBASE = $(HOME)/.local/share/gnome-shell/extensions +else + INSTALLTYPE = system + SHARE_PREFIX = $(DESTDIR)/usr/share + INSTALLBASE = $(SHARE_PREFIX)/gnome-shell/extensions +endif +INSTALLNAME = hibernate-status@dromi + +all: extension + +clean: + rm -f ./schemas/gschemas.compiled + rm -f ./**/*~ + rm -f ./locale/*/*/*.mo + rm -f ./locale/hibernate-status-button.pot + +extension: ./schemas/gschemas.compiled $(MO_FILES) + +./schemas/gschemas.compiled: ./schemas/org.gnome.shell.extensions.hibernate-status-button.gschema.xml + glib-compile-schemas ./schemas/ + +potfile: ./locale/hibernate-status-button.pot + +mergepo: potfile + for l in $(PO_FILES); do \ + msgmerge -U $$l ./locale/hibernate-status-button.pot; \ + done; + +./locale/hibernate-status-button.pot: $(TOLOCALIZE) + mkdir -p locale + xgettext -k --keyword=__ --keyword=N__ --add-comments='Translators:' -o locale/hibernate-status-button.pot --package-name "Hibernate Status Button" $(TOLOCALIZE) + +%.mo: %.po + msgfmt -c $< -o $@ + +install: install-local + +install-local: _build + rm -rf $(INSTALLBASE)/$(INSTALLNAME) + mkdir -p $(INSTALLBASE)/$(INSTALLNAME) + cp -r ./_build/* $(INSTALLBASE)/$(INSTALLNAME)/ +ifeq ($(INSTALLTYPE),system) + # system-wide settings and locale files + # rm -r $(INSTALLBASE)/$(INSTALLNAME)/schemas + rm -f $(INSTALLBASE)/$(INSTALLNAME)/schemas/*gschema.xml + rm -r $(INSTALLBASE)/$(INSTALLNAME)/locale + mkdir -p $(SHARE_PREFIX)/glib-2.0/schemas $(SHARE_PREFIX)/locale + cp -r ./schemas/*gschema.* $(SHARE_PREFIX)/glib-2.0/schemas + cp -r ./_build/locale/* $(SHARE_PREFIX)/locale +endif + -rm -fR _build + echo done + +zip-file: _build + cd _build ; zip -qr "$(UUID).zip" . -x '*.po' + mv _build/$(UUID).zip ./ + -rm -fR _build + +_build: all + -rm -fR ./_build + mkdir -p _build + cp $(BASE_MODULES) $(EXTRA_MODULES) _build + mkdir -p _build/schemas + cp schemas/*.xml _build/schemas/ + cp schemas/gschemas.compiled _build/schemas/ + cp -r locale/ _build/locale diff --git a/extensions/hibernate-status/README.md b/extensions/hibernate-status/README.md new file mode 100644 index 0000000..ff88abd --- /dev/null +++ b/extensions/hibernate-status/README.md @@ -0,0 +1,41 @@ +# gnome-shell-extension-hibernate-status + +Gnome Shell extension that adds a hibernate/hybrid suspend button in Status menu. + +Originally developed by [@arelange](https://github.com/arelange); now maintained by [@p91paul](https://github.com/p91paul). + +Supports GNOME 3.36. + +## FAQ + +### Hibernation does not work + +Try launching from your terminal + + systemctl hibernate + +If it doesn't work, it means hibernation is disabled on your system. Please see: + +https://askubuntu.com/questions/1034185/ubuntu-18-04-cant-resume-after-hibernate/1064114#1064114 + +or + +https://help.ubuntu.com/16.04/ubuntu-help/power-hibernate.html + +### Hibernation button does not show up, but systemctl hibernate works + +If you are running Ubuntu, try putting + + [Enable hibernate in upower] + Identity=unix-user:* + Action=org.freedesktop.upower.hibernate + ResultActive=yes + + [Enable hibernate in logind] + Identity=unix-user:* + Action=org.freedesktop.login1.hibernate;org.freedesktop.login1.handle-hibernate-key;org.freedesktop.login1;org.freedesktop.login1.hibernate-multiple-sessions;org.freedesktop.login1.hibernate-ignore-inhibit + ResultActive=yes + +into /etc/polkit-1/localauthority/10-vendor.d/com.ubuntu.desktop.pkla + +Otherwise check for similar settings for your distribution. Credit: https://github.com/arelange/gnome-shell-extension-hibernate-status/issues/41#issuecomment-565883599 diff --git a/extensions/hibernate-status/buildforupload.sh b/extensions/hibernate-status/buildforupload.sh new file mode 100755 index 0000000..d2c705c --- /dev/null +++ b/extensions/hibernate-status/buildforupload.sh @@ -0,0 +1,2 @@ +#!/bin/bash +make zip-file diff --git a/extensions/hibernate-status/confirmDialog.js b/extensions/hibernate-status/confirmDialog.js new file mode 100644 index 0000000..62069e2 --- /dev/null +++ b/extensions/hibernate-status/confirmDialog.js @@ -0,0 +1,193 @@ +const Gio = imports.gi.Gio; +const GLib = imports.gi.GLib; +const GObject = imports.gi.GObject; +const Mainloop = imports.mainloop; + +const LoginManager = imports.misc.loginManager; +const Main = imports.ui.main; +const StatusSystem = imports.ui.status.system; +const PopupMenu = imports.ui.popupMenu; +const ModalDialog = imports.ui.modalDialog; +const CheckBox = imports.ui.checkBox.CheckBox; +const St = imports.gi.St; +const Clutter = imports.gi.Clutter; +const ExtensionUtils = imports.misc.extensionUtils; + +// Use __ () and N__() for the extension gettext domain, and reuse +// the shell domain with the default _() and N_() +const Gettext = imports.gettext.domain('hibernate-status-button'); +const __ = Gettext.gettext; +const N__ = function(e) { return e }; + +ExtensionUtils.initTranslations('hibernate-status-button'); + +var HibernateDialogContent = { + subject: C_("title", __("Hibernate")), + description: __("Do you really want to hibernate the system?"), + confirmButtons: [{ + signal: 'Cancel', + label: C_("button", __("Cancel")), + key: Clutter.Escape + }, + { + signal: 'ConfirmedHibernate', + label: C_("button", __("Hibernate")), + default: true + }], + iconName: 'document-save-symbolic', + iconStyleClass: 'end-session-dialog-shutdown-icon', +}; + +var SystemdMissingDialogContent = { + subject: C_("title", __("Hibernate button: Systemd Missing")), + description: __("Systemd seems to be missing and is required."), + confirmButtons: [{ + signal: 'Cancel', + label: C_("button", __("Cancel")), + key: Clutter.Escape + }, + { + signal: 'DisableExtension', + label: C_("button", __("Disable Extension")), + default: true + }], + iconName: 'document-save-symbolic', + iconStyleClass: 'end-session-dialog-shutdown-icon', +}; + + +var HibernateFailedDialogContent = { + subject: C_("title", __("Hibernate button: Hibernate failed")), + description: __("Looks like hibernation failed.\n" + + "On some linux distributions hibernation is disabled\n" + + "because not all hardware supports it well;\n" + + "please check your distribution documentation\n" + + "on how to enable it."), + checkBox: __("You are wrong, don't check this anymore!"), + confirmButtons: [{ + signal: 'Cancel', + label: C_("button", __("Cancel")), + key: Clutter.Escape + }, + { + signal: 'DisableExtension', + label: C_("button", __("Disable Extension")), + default: true + }], + iconName: 'document-save-symbolic', + iconStyleClass: 'end-session-dialog-shutdown-icon', +}; + +const _DIALOG_ICON_SIZE = 32; + +function _setLabelText(label, text) { + if (text) { + label.set_text(text); + label.show(); + } else { + label.set_text(''); + label.hide(); + } +} + +var ConfirmDialog = GObject.registerClass({ + Signals: { 'ConfirmedHibernate': { param_types: [ GObject.TYPE_BOOLEAN ] }, + 'DisableExtension': { param_types: [ GObject.TYPE_BOOLEAN ] }, + 'Cancel': { param_types: [ GObject.TYPE_BOOLEAN ] } } +}, +class ConfirmDialog extends ModalDialog.ModalDialog { + _init(dialog) { + super._init({ + styleClass: 'end-session-dialog', + destroyOnClose: true + }); + + let mainContentLayout = new St.BoxLayout({ + vertical: false, + x_expand: true , + y_expand: false + }); + this.contentLayout.add(mainContentLayout); + + this._iconBin = new St.Bin({ + x_expand: true, + y_expand: false, + x_align: St.Align.END, + y_align: St.Align.START + }); + mainContentLayout.add(this._iconBin); + + let messageLayout = new St.BoxLayout({ + vertical: true, + y_align: St.Align.START + }); + mainContentLayout.add(messageLayout); + + this._subjectLabel = new St.Label({ + style_class: 'end-session-dialog-subject', + y_expand: false, + y_align: St.Align.START + }); + + messageLayout.add(this._subjectLabel); + + this._descriptionLabel = new St.Label({ + style_class: 'end-session-dialog-description', + y_expand: true, + y_align: St.Align.START + }); + + messageLayout.add(this._descriptionLabel); + + // fill dialog + + _setLabelText(this._descriptionLabel, dialog.description); + _setLabelText(this._subjectLabel, dialog.subject); + + if (dialog.iconName) { + this._iconBin.child = new St.Icon({ + icon_name: dialog.iconName, + icon_size: _DIALOG_ICON_SIZE, + style_class: dialog.iconStyleClass + }); + } + + if (dialog.checkBox) { + this._checkBox = new CheckBox(dialog.checkBox); + mainContentLayout.add(this._checkBox.actor); + } + + let buttons = []; + for (let i = 0; i < dialog.confirmButtons.length; i++) { + let signal = dialog.confirmButtons[i].signal; + let label = dialog.confirmButtons[i].label; + let keys = dialog.confirmButtons[i].key; + buttons.push({ + action: () => { + this.close(); + let signalId = this.connect('closed', + () => { + this.disconnect(signalId); + this._confirm(signal); + }); + }, + label: label, + key: keys + }); + }; + + this.setButtons(buttons); + + } + + _confirm(signal) { + var checked; + if (this._checkBox) + checked = this._checkBox.actor.get_checked() + this.emit(signal, checked); + } + + cancel() { + this.close(); + } +}); diff --git a/extensions/hibernate-status/extension.js b/extensions/hibernate-status/extension.js new file mode 100644 index 0000000..6e0b248 --- /dev/null +++ b/extensions/hibernate-status/extension.js @@ -0,0 +1,248 @@ +const Gio = imports.gi.Gio; +const GLib = imports.gi.GLib; +const Mainloop = imports.mainloop; + +const ExtensionUtils = imports.misc.extensionUtils; +const LoginManager = imports.misc.loginManager; +const Main = imports.ui.main; +const StatusSystem = imports.ui.status.system; +const PopupMenu = imports.ui.popupMenu; +const Me = imports.misc.extensionUtils.getCurrentExtension(); +const ExtensionSystem = imports.ui.extensionSystem; +const ConfirmDialog = Me.imports.confirmDialog; +const Prefs = new Me.imports.prefs.Prefs(); + + +// Use __ () and N__() for the extension gettext domain, and reuse +// the shell domain with the default _() and N_() +const Gettext = imports.gettext.domain('hibernate-status-button'); +const __ = Gettext.gettext; +const N__ = function(e) { return e }; +ExtensionUtils.initTranslations('hibernate-status-button'); + +const HIBERNATE_CHECK_TIMEOUT = 20000; + +class Extension { + _loginManagerCanHibernate(asyncCallback) { + if (this._loginManager._proxy) { + // systemd path + this._loginManager._proxy.call("CanHibernate", + null, + Gio.DBusCallFlags.NONE, + -1, null, function (proxy, asyncResult) { + let result, error; + + try { + result = proxy.call_finish(asyncResult).deep_unpack(); + } catch (e) { + error = e; + } + + if (error) + asyncCallback(false); + else + asyncCallback(result[0] != 'no'); + }); + } else { + Mainloop.idle_add(() => { + asyncCallback(false); + return false; + }); + } + } + + _loginManagerHibernate() { + if (Prefs.getHibernateWorksCheckEnabled()) { + this._hibernateStarted = new Date(); + GLib.timeout_add(GLib.PRIORITY_DEFAULT, HIBERNATE_CHECK_TIMEOUT, + () => this._checkDidHibernate()); + } + if (this._loginManager._proxy) { + // systemd path + this._loginManager._proxy.call("Hibernate", + GLib.Variant.new('(b)', [true]), + Gio.DBusCallFlags.NONE, + -1, null, null); + } else { + // Can't do in ConsoleKit + this._loginManager.emit('prepare-for-sleep', true); + this._loginManager.emit('prepare-for-sleep', false); + } + } + + _loginManagerCanHybridSleep(asyncCallback) { + if (this._loginManager._proxy) { + // systemd path + this._loginManager._proxy.call("CanHybridSleep", + null, + Gio.DBusCallFlags.NONE, + -1, null, function (proxy, asyncResult) { + let result, error; + + try { + result = proxy.call_finish(asyncResult).deep_unpack(); + } catch (e) { + error = e; + } + + if (error) + asyncCallback(false); + else + asyncCallback(result[0] != 'no'); + }); + } else { + Mainloop.idle_add(() => { + asyncCallback(false); + return false; + }); + } + } + + _loginManagerHybridSleep() { + if (this._loginManager._proxy) { + // systemd path + this._loginManager._proxy.call("HybridSleep", + GLib.Variant.new('(b)', [true]), + Gio.DBusCallFlags.NONE, + -1, null, null); + } else { + // Can't do in ConsoleKit + this._loginManager.emit('prepare-for-sleep', true); + this._loginManager.emit('prepare-for-sleep', false); + } + } + _updateHaveHibernate() { + this._loginManagerCanHibernate((result) => { + log(`have hibernate ${result}`); + this._haveHibernate = result; + this._updateHibernate(); + }); + } + + _updateHibernate() { + this._hibernateMenuItem.visible = this._haveHibernate && !Main.sessionMode.isLocked; + } + + _updateHaveHybridSleep() { + this._loginManagerCanHybridSleep((result) => { + this._haveHybridSleep = result; + this._updateHybridSleep(); + }); + } + + _updateHybridSleep() { + this._hybridSleepMenuItem.visible = this._haveHybridSleep && !Main.sessionMode.isLocked; + } + + _onHibernateClicked() { + this.systemMenu._systemItem.menu.itemActivated(); + this._dialog = new ConfirmDialog.ConfirmDialog(ConfirmDialog.HibernateDialogContent); + this._dialog.connect('ConfirmedHibernate', () => this._loginManagerHibernate()); + this._dialog.open(); + } + + _onHybridSleepClicked() { + this.systemMenu._systemItem.menu.itemActivated(); + this._loginManagerHybridSleep(); + } + + _disableExtension() { + let enabledExtensions = global.settings.get_strv(ExtensionSystem.ENABLED_EXTENSIONS_KEY); + enabledExtensions.splice(enabledExtensions.indexOf(Me.uuid), 1); + global.settings.set_strv(ExtensionSystem.ENABLED_EXTENSIONS_KEY, enabledExtensions); + } + + _cancelDisableExtension(notAgain) { + if (notAgain) + Prefs.setHibernateWorksCheckEnabled(false); + } + + _checkRequirements() { + if (!LoginManager.haveSystemd()) { + this._dialog = new ConfirmDialog.ConfirmDialog(ConfirmDialog.SystemdMissingDialogContent); + this._dialog.connect('DisableExtension', this._disableExtension); + this._dialog.open(); + } + } + + _checkDidHibernate() { + /* This function is called HIBERNATE_CHECK_TIMEOUT ms after + * hibernate started. If it is successful, at that point the GS + * process is already frozen; so when this function is actually + * called, way more than HIBERNATE_CHECK_TIMEOUT ms are passed*/ + if (new Date() - this._hibernateStarted > HIBERNATE_CHECK_TIMEOUT + 5000) { + // hibernate succeeded + return; + } + // hibernate failed + this._dialog = new ConfirmDialog.ConfirmDialog(ConfirmDialog.HibernateFailedDialogContent); + this._dialog.connect('DisableExtension', this._disableExtension); + this._dialog.connect('Cancel', this._cancelDisableExtension); + this._dialog.open(); + } + + enable() { + this._checkRequirements(); + this._loginManager = LoginManager.getLoginManager(); + this.systemMenu = Main.panel.statusArea.quickSettings._system; + + this._hibernateMenuItem = new PopupMenu.PopupMenuItem(__('Hibernate')); + this._hibernateMenuItemId = this._hibernateMenuItem.connect('activate', () => this._onHibernateClicked()); + + this._hybridSleepMenuItem = new PopupMenu.PopupMenuItem(__('Hybrid Sleep')); + this._hybridSleepMenuItemId = this._hybridSleepMenuItem.connect('activate', () => this._onHybridSleepClicked()); + + let afterSuspendPosition = this.systemMenu._systemItem.menu.numMenuItems - 5; + + this.systemMenu._systemItem.menu.addMenuItem(this._hybridSleepMenuItem, afterSuspendPosition); + this.systemMenu._systemItem.menu.addMenuItem(this._hibernateMenuItem, afterSuspendPosition); + + this._menuOpenStateChangedId = this.systemMenu._systemItem.menu.connect('open-state-changed', + (menu, open) => { + if (!open) + return; + this._updateHaveHibernate(); + this._updateHaveHybridSleep(); + }); + } + + disable() { + if (this._menuOpenStateChangedId) { + this.systemMenu._systemItem.menu.disconnect(this._menuOpenStateChangedId); + this._menuOpenStateChangedId = 0; + } + + if (this._hybridSleepMenuItemId) { + this._hybridSleepMenuItem.disconnect(this._hybridSleepMenuItemId); + this._hybridSleepMenuItemId = 0; + } + + if (this._hibernateMenuItemId) { + this._hibernateMenuItem.disconnect(this._hibernateMenuItemId); + this._hibernateMenuItemId = 0; + } + + if (this._hybridSleepMenuItem) { + this._hybridSleepMenuItem.destroy(); + this._hybridSleepMenuItem = 0; + } + + if (this._hibernateMenuItem) { + this._hibernateMenuItem.destroy(); + this._hibernateMenuItem = 0; + } + } +} + +let extension; +function init() { + extension = new Extension(); +} + +function enable() { + extension.enable(); +} + +function disable() { + extension.disable(); +} diff --git a/extensions/hibernate-status/locale/cs/LC_MESSAGES/hibernate-status-button.po b/extensions/hibernate-status/locale/cs/LC_MESSAGES/hibernate-status-button.po new file mode 100644 index 0000000..32e541d --- /dev/null +++ b/extensions/hibernate-status/locale/cs/LC_MESSAGES/hibernate-status-button.po @@ -0,0 +1,66 @@ +# Czech translation of hibernate-status-button +# Copyright (C) 2021 Vojtěch Perník +# This file is distributed under the same license as the hibernate-status-button package. +# Vojtěch Perník , 2021. +# +msgid "" +msgstr "" +"Project-Id-Version: Hibernate Status Button\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2021-04-11 18:31+0200\n" +"PO-Revision-Date: 2021-05-06 16:15+0200\n" +"Last-Translator: Vojtěch Perník \n" +"Language-Team: Czech\n" +"Language: cs\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: confirmDialog.js:23 confirmDialog.js:32 +msgid "Hibernate" +msgstr "Uspat na disk" + +#: confirmDialog.js:24 +msgid "Do you really want to hibernate the system?" +msgstr "Opravdu chcete systém uspat na disk?" + +#: confirmDialog.js:27 confirmDialog.js:44 confirmDialog.js:67 +msgid "Cancel" +msgstr "Zrušit" + +#: confirmDialog.js:40 +msgid "Hibernate button: Systemd Missing" +msgstr "Hibernate button: Systemd není nainstalován" + +#: confirmDialog.js:41 +msgid "Systemd seems to be missing and is required." +msgstr "Zdá se, že Systemd není nainstalován, ale je vyžadován." + +#: confirmDialog.js:49 confirmDialog.js:72 +msgid "Disable Extension" +msgstr "Zakázat rozšíření" + +#: confirmDialog.js:58 +msgid "Hibernate button: Hibernate failed" +msgstr "Hibernate button: Uspání na disk se nezdařilo" + +#: confirmDialog.js:59 +msgid "" +"Looks like hibernation failed.\n" +"On some linux distributions hibernation is disabled\n" +"because not all hardware supports it well;\n" +"please check your distribution documentation\n" +"on how to enable it." +msgstr "" +"Vypadá to, že se uspání na disk nezdařilo.\n" +"U některých linuxových distribucí je uspání na disk\n" +"zakázáno, protože ne všechny hardware ho podporují,\n" +"podívejte se prosím do dokumentace své distribuce, jak ji povolit." + +#: confirmDialog.js:64 +msgid "You are wrong, don't check this anymore!" +msgstr "Mýlíte se, už to nekontrolujte!" + +#: prefs.js:99 +msgid "This extension has no settings available" +msgstr "Toto rozšíření nemá k dispozici žádná nastavení" diff --git a/extensions/hibernate-status/locale/de/LC_MESSAGES/hibernate-status-button.po b/extensions/hibernate-status/locale/de/LC_MESSAGES/hibernate-status-button.po new file mode 100644 index 0000000..3fdb8c2 --- /dev/null +++ b/extensions/hibernate-status/locale/de/LC_MESSAGES/hibernate-status-button.po @@ -0,0 +1,72 @@ +# German translation of hibernate-status-button +# Copyright (C) 2022 Oskar Kirmis +# This file is distributed under the same license as the hibernate-status-button package. +# Oskar Kirmis , 2022. +# +msgid "" +msgstr "" +"Project-Id-Version: Hibernate Status Button\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2022-03-28 21:00+0200\n" +"PO-Revision-Date: 2022-10-22 21:30+0200\n" +"Last-Translator: Oskar Kirmis \n" +"Language-Team: German\n" +"Language: de\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 3.0.1\n" + +#: confirmDialog.js:23 confirmDialog.js:32 +msgid "Hibernate" +msgstr "Ruhezustand" + +#: extension.js:192 +msgid "Hybrid Sleep" +msgstr "Hybrider Standbymodus" + +#: confirmDialog.js:24 +msgid "Do you really want to hibernate the system?" +msgstr "Wollen Sie das System wirklich in den Ruhezustand versetzen?" + +#: confirmDialog.js:27 confirmDialog.js:44 confirmDialog.js:67 +msgid "Cancel" +msgstr "Abbrechen" + +#: confirmDialog.js:40 +msgid "Hibernate button: Systemd Missing" +msgstr "Hibernate button: Systemd fehlt" + +#: confirmDialog.js:41 +msgid "Systemd seems to be missing and is required." +msgstr "Systemd fehlt offenbar, wird jedoch benötigt." + +#: confirmDialog.js:49 confirmDialog.js:72 +msgid "Disable Extension" +msgstr "Erweiterung deaktivieren" + +#: confirmDialog.js:58 +msgid "Hibernate button: Hibernate failed" +msgstr "Hibernate button: Versetzen in den Ruhezustand fehlgeschlagen" + +#: confirmDialog.js:59 +msgid "" +"Looks like hibernation failed.\n" +"On some linux distributions hibernation is disabled\n" +"because not all hardware supports it well;\n" +"please check your distribution documentation\n" +"on how to enable it." +msgstr "" +"Offenbar konnte das System nicht in den Ruhezustand versetzt werden.\n" +"Auf manchen Linuxdistributionen ist der Ruhezustand deaktiviert\n" +"weil nicht jegliche Hardware dies unterstützt;\n" +"bitte schauen Sie in der Dokumentation Ihrer\n" +"Distribution nach, wie Sie ihn aktivieren können." + +#: confirmDialog.js:64 +msgid "You are wrong, don't check this anymore!" +msgstr "Das ist falsch, bitte nicht mehr prüfen!" + +#: prefs.js:99 +msgid "This extension has no settings available" +msgstr "Für diese Erweiterung gibt es keine Einstellungen" diff --git a/extensions/hibernate-status/locale/es/LC_MESSAGES/hibernate-status-button.po b/extensions/hibernate-status/locale/es/LC_MESSAGES/hibernate-status-button.po new file mode 100644 index 0000000..92c14bc --- /dev/null +++ b/extensions/hibernate-status/locale/es/LC_MESSAGES/hibernate-status-button.po @@ -0,0 +1,71 @@ +# Spanish translation of hibernate-status-button +# Copyright (C) 2022 slaythrax +# This file is distributed under the same license as the hibernate-status-button package. +# slaythrax , 2022. +# +msgid "" +msgstr "" +"Project-Id-Version: Hibernate Status Button\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2021-04-11 18:31+0200\n" +"PO-Revision-Date: 2022-10-22 21:30+0200\n" +"Last-Translator: slaythrax \n" +"Language-Team: Spanish \n" +"Language: es\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: confirmDialog.js:23 confirmDialog.js:32 +msgid "Hibernate" +msgstr "Hibernar" + +#: extension.js:192 +msgid "Hybrid Sleep" +msgstr "Suspensión Híbrida" + +#: confirmDialog.js:24 +msgid "Do you really want to hibernate the system?" +msgstr "Desea hibernar el sistema?" + +#: confirmDialog.js:27 confirmDialog.js:44 confirmDialog.js:67 +msgid "Cancel" +msgstr "Cancelar" + +#: confirmDialog.js:40 +msgid "Hibernate button: Systemd Missing" +msgstr "Systemd no está instalado" + +#: confirmDialog.js:41 +msgid "Systemd seems to be missing and is required." +msgstr "Parece que systemd no está instalado. Systemd es necesario" + +#: confirmDialog.js:49 confirmDialog.js:72 +msgid "Disable Extension" +msgstr "Deshabilitar extensión" + +#: confirmDialog.js:58 +msgid "Hibernate button: Hibernate failed" +msgstr "Hibernación fallida" + +#: confirmDialog.js:59 +msgid "" +"Looks like hibernation failed.\n" +"On some linux distributions hibernation is disabled\n" +"because not all hardware supports it well;\n" +"please check your distribution documentation\n" +"on how to enable it." +msgstr "" +"Parece que la hibernación falló\n" +"En algunas distribuciones de linux la hibernación se encuentra deshabilitada\n" +"pues no todo el hardware no la soporta correctamente;\n" +"verifique la documentación de su distribución\n" +"para habilitarla." + +#: confirmDialog.js:64 +msgid "You are wrong, don't check this anymore!" +msgstr "No es necesario hacer esta verificación de nuevo! " + +#: prefs.js:99 +msgid "This extension has no settings available" +msgstr "Esta extensión no tiene ajustes disponibles" diff --git a/extensions/hibernate-status/locale/fa/LC_MESSAGES/hibernate-status-button.po b/extensions/hibernate-status/locale/fa/LC_MESSAGES/hibernate-status-button.po new file mode 100644 index 0000000..e4edef0 --- /dev/null +++ b/extensions/hibernate-status/locale/fa/LC_MESSAGES/hibernate-status-button.po @@ -0,0 +1,72 @@ +# Persian translation of hibernate-status-button +# Copyright (C) 2021 MohammadSaleh Kamyab +# This file is distributed under the same license as the hibernate-status-button package. +# MohammadSaleh Kamyab , 2022. +# +msgid "" +msgstr "" +"Project-Id-Version: Hibernate Status Button\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2021-04-11 18:31+0200\n" +"PO-Revision-Date: 2022-06-21 13:06+0430\n" +"Last-Translator: MohammadSaleh Kamyab \n" +"Language-Team: \n" +"Language: fa\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n==0 || n==1);\n" +"X-Generator: Poedit 3.1\n" + +#: confirmDialog.js:23 confirmDialog.js:32 +msgid "Hibernate" +msgstr "خواب زمستانی" + +#: extension.js:192 +msgid "Hybrid Sleep" +msgstr "خواب ترکیبی" + +#: confirmDialog.js:24 +msgid "Do you really want to hibernate the system?" +msgstr "آیا مطمئنید که می‌خواهید سامانه را به خواب زمستانی ببرید؟" + +#: confirmDialog.js:27 confirmDialog.js:44 confirmDialog.js:67 +msgid "Cancel" +msgstr "لغو" + +#: confirmDialog.js:40 +msgid "Hibernate button: Systemd Missing" +msgstr "دکمهٔ خواب زمستانی: سیستم‌دی یافت نشد" + +#: confirmDialog.js:41 +msgid "Systemd seems to be missing and is required." +msgstr "به نظر می‌رسد سیستم‌دی که لازم است، وجود ندارد." + +#: confirmDialog.js:49 confirmDialog.js:72 +msgid "Disable Extension" +msgstr "از کار انداختن افزونه" + +#: confirmDialog.js:58 +msgid "Hibernate button: Hibernate failed" +msgstr "دکمهٔ خواب زمستانی: خواب زمستانی شکست خورد" + +#: confirmDialog.js:59 +msgid "" +"Looks like hibernation failed.\n" +"On some linux distributions hibernation is disabled\n" +"because not all hardware supports it well;\n" +"please check your distribution documentation\n" +"on how to enable it." +msgstr "" +"به نظر می‌رسد خواب زمستانی به شکست انجامید.\n" +"در بعضی از توزیع‌های گنو/لینوکسی، خواب زمستانی از کار انداخته شده است؛\n" +"زیرا تمامی سخت‌افزارها به‌خوبی از آن پشتیبانی نمی‌کنند.\n" +"لطفاً مستندات توزیع خود را در مورد چگونگی به کار انداختن آن، بررسی کنید." + +#: confirmDialog.js:64 +msgid "You are wrong, don't check this anymore!" +msgstr "اشتباه می‌کنید، دوباره بررسی نکنید!" + +#: prefs.js:99 +msgid "This extension has no settings available" +msgstr "این افزونه هیچ تنظیماتی ندارد" diff --git a/extensions/hibernate-status/locale/fr/LC_MESSAGES/hibernate-status-button.po b/extensions/hibernate-status/locale/fr/LC_MESSAGES/hibernate-status-button.po new file mode 100644 index 0000000..9dca80d --- /dev/null +++ b/extensions/hibernate-status/locale/fr/LC_MESSAGES/hibernate-status-button.po @@ -0,0 +1,71 @@ +# French translation of hibernate-status-button +# Copyright (C) 2021 Jérôme de Bretagne +# This file is distributed under the same license as the hibernate-status-button package. +# Jérôme de Bretagne , 2021. +# +msgid "" +msgstr "" +"Project-Id-Version: Hibernate Status Button\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2021-04-11 18:31+0200\n" +"PO-Revision-Date: 2021-11-13 19:34+0200\n" +"Last-Translator: Jérôme de Bretagne \n" +"Language-Team: French \n" +"Language: fr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: extension.js:189 confirmDialog.js:23 confirmDialog.js:32 +msgid "Hibernate" +msgstr "Mettre en veille prolongée" + +#: extension.js:192 +msgid "Hybrid Sleep" +msgstr "Mettre en veille hybride" + +#: confirmDialog.js:24 +msgid "Do you really want to hibernate the system?" +msgstr "Voulez-vous vraiment mettre l'appareil en veille prolongée ?" + +#: confirmDialog.js:27 confirmDialog.js:44 confirmDialog.js:67 +msgid "Cancel" +msgstr "Annuler" + +#: confirmDialog.js:40 +msgid "Hibernate button: Systemd Missing" +msgstr "Extension de mise en veille prolongée : systemd manquant" + +#: confirmDialog.js:41 +msgid "Systemd seems to be missing and is required." +msgstr "systemd ne semble pas installé et est nécessaire." + +#: confirmDialog.js:49 confirmDialog.js:72 +msgid "Disable Extension" +msgstr "Désactiver l'extension" + +#: confirmDialog.js:58 +msgid "Hibernate button: Hibernate failed" +msgstr "Extension de mise en veille prolongée : échec" + +#: confirmDialog.js:59 +msgid "" +"Looks like hibernation failed.\n" +"On some linux distributions hibernation is disabled\n" +"because not all hardware supports it well;\n" +"please check your distribution documentation\n" +"on how to enable it." +msgstr "" +"La mise en veille prolongée a échoué.\n" +"Sur certaines distributions Linux, la mise en veille prolongée est désactivée\n" +"car elle ne fonctionne pas correctement pour quelques appareils;\n" +"Veuillez vous reporter à la documentation de votre distribution\n" +"pour savoir comment l'activer." + +#: confirmDialog.js:64 +msgid "You are wrong, don't check this anymore!" +msgstr "Il n'est pas utile de cocher cette case !" + +#: prefs.js:99 +msgid "This extension has no settings available" +msgstr "Cette extension n'a pas de paramètres" diff --git a/extensions/hibernate-status/locale/it/LC_MESSAGES/hibernate-status-button.po b/extensions/hibernate-status/locale/it/LC_MESSAGES/hibernate-status-button.po new file mode 100644 index 0000000..a41e5ac --- /dev/null +++ b/extensions/hibernate-status/locale/it/LC_MESSAGES/hibernate-status-button.po @@ -0,0 +1,71 @@ +# Italian translation of hibernate-status-button +# Copyright (C) 2021 p91paul +# This file is distributed under the same license as the hibernate-status-button package. +# p91paul , 2021. +# +msgid "" +msgstr "" +"Project-Id-Version: Hibernate Status Button\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2021-04-11 18:31+0200\n" +"PO-Revision-Date: 2022-10-22 21:30+0200\n" +"Last-Translator: p91paul \n" +"Language-Team: Italian \n" +"Language: it\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: confirmDialog.js:23 confirmDialog.js:32 +msgid "Hibernate" +msgstr "Iberna" + +#: extension.js:192 +msgid "Hybrid Sleep" +msgstr "Sospensione ibrida" + +#: confirmDialog.js:24 +msgid "Do you really want to hibernate the system?" +msgstr "Vuoi davvero ibernare il sistema?" + +#: confirmDialog.js:27 confirmDialog.js:44 confirmDialog.js:67 +msgid "Cancel" +msgstr "Cancella" + +#: confirmDialog.js:40 +msgid "Hibernate button: Systemd Missing" +msgstr "Systemd non installato" + +#: confirmDialog.js:41 +msgid "Systemd seems to be missing and is required." +msgstr "Systemd non è installato ed è necessario" + +#: confirmDialog.js:49 confirmDialog.js:72 +msgid "Disable Extension" +msgstr "Disabilita estensione" + +#: confirmDialog.js:58 +msgid "Hibernate button: Hibernate failed" +msgstr "Ibernazione fallita" + +#: confirmDialog.js:59 +msgid "" +"Looks like hibernation failed.\n" +"On some linux distributions hibernation is disabled\n" +"because not all hardware supports it well;\n" +"please check your distribution documentation\n" +"on how to enable it." +msgstr "" +"Sembra che l'ibernazione sia fallita.\n" +"In alcune distribuzioni Linux l'ibernazione è disabilitata\n" +"perchè non ben supportata da tutte le tipologie di hardware;\n" +"Verifica la documentazione della tua distribuzione\n" +"per abilitarla." + +#: confirmDialog.js:64 +msgid "You are wrong, don't check this anymore!" +msgstr "Ti sbagli, va tutto bene, non fare più questa verifica" + +#: prefs.js:99 +msgid "This extension has no settings available" +msgstr "Questa estensione non ha impostazioni disponibili" diff --git a/extensions/hibernate-status/locale/nl/LC_MESSAGES/hibernate-status-button.po b/extensions/hibernate-status/locale/nl/LC_MESSAGES/hibernate-status-button.po new file mode 100644 index 0000000..6853171 --- /dev/null +++ b/extensions/hibernate-status/locale/nl/LC_MESSAGES/hibernate-status-button.po @@ -0,0 +1,68 @@ +# Nederlands translation of hibernate-status-button +# Copyright (C) 2021 tebaranowski +# This file is distributed under the same license as the hibernate-status-button package. +# tebaranowski , 2021. +# +msgid "" +msgstr "" +"Project-Id-Version: Hibernate Status Button\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2021-04-11 18:31+0200\n" +"PO-Revision-Date: 2021-09-13 17:56+0200\n" +"Last-Translator: Heimen Stoffels \n" +"Language-Team: Dutch \n" +"Language: nl\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : 2);\n" +"X-Generator: Poedit 3.0\n" + +#: confirmDialog.js:23 confirmDialog.js:32 +msgid "Hibernate" +msgstr "Slaapstand" + +#: confirmDialog.js:24 +msgid "Do you really want to hibernate the system?" +msgstr "Weet u zeker dat u het systeem in de slaapstand wilt zetten?" + +#: confirmDialog.js:27 confirmDialog.js:44 confirmDialog.js:67 +msgid "Cancel" +msgstr "Annuleren" + +#: confirmDialog.js:40 +msgid "Hibernate button: Systemd Missing" +msgstr "Slaapstandknop: Systemd ontbreekt" + +#: confirmDialog.js:41 +msgid "Systemd seems to be missing and is required." +msgstr "Systemd is vereist, maar niet aangetroffen." + +#: confirmDialog.js:49 confirmDialog.js:72 +msgid "Disable Extension" +msgstr "Uitbreiding uitschakelen" + +#: confirmDialog.js:58 +msgid "Hibernate button: Hibernate failed" +msgstr "Slaapstandknop: slaapstand mislukt" + +#: confirmDialog.js:59 +msgid "" +"Looks like hibernation failed.\n" +"On some linux distributions hibernation is disabled\n" +"because not all hardware supports it well;\n" +"please check your distribution documentation\n" +"on how to enable it." +msgstr "" +"Het lijkt er op dat de slaapstand niet kan worden ingeschakeld.\n" +"Op sommige distributies is de slaapstand niet beschikbaar.\n" +"Neem de documentatie van uw distributie door om te\n" +"zien of u de slaapstand kunt activeren." + +#: confirmDialog.js:64 +msgid "You are wrong, don't check this anymore!" +msgstr "Dit klopt niet - negeer deze controle!" + +#: prefs.js:99 +msgid "This extension has no settings available" +msgstr "Deze uitbreiding bevat geen voorkeurenscherm" diff --git a/extensions/hibernate-status/locale/oc/LC_MESSAGES/hibernate-status-button.po b/extensions/hibernate-status/locale/oc/LC_MESSAGES/hibernate-status-button.po new file mode 100644 index 0000000..25debf8 --- /dev/null +++ b/extensions/hibernate-status/locale/oc/LC_MESSAGES/hibernate-status-button.po @@ -0,0 +1,71 @@ +# Occitan translation of hibernate-status-button +# Copyright (C) 2022 Quentin +# This file is distributed under the same license as the hibernate-status-button package. +# Quentin +# +msgid "" +msgstr "" +"Project-Id-Version: Hibernate Status Button\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2021-04-11 18:31+0200\n" +"PO-Revision-Date: 2023-01-11 17:19+0200\n" +"Last-Translator: Quentin PAGÈS <>\n" +"Language-Team: Occitan\n" +"Language: oc\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: extension.js:189 confirmDialog.js:23 confirmDialog.js:32 +msgid "Hibernate" +msgstr "Metre en velha perlongada" + +#: extension.js:192 +msgid "Hybrid Sleep" +msgstr "Metre en velha ibrida" + +#: confirmDialog.js:24 +msgid "Do you really want to hibernate the system?" +msgstr "Volètz vertadièrament metre l'aparelh en velha perlongada ?" + +#: confirmDialog.js:27 confirmDialog.js:44 confirmDialog.js:67 +msgid "Cancel" +msgstr "Anullar" + +#: confirmDialog.js:40 +msgid "Hibernate button: Systemd Missing" +msgstr "Extension de mesa en velha perlongada : systemd mancant" + +#: confirmDialog.js:41 +msgid "Systemd seems to be missing and is required." +msgstr "systemd sembla pas installat e es necessari." + +#: confirmDialog.js:49 confirmDialog.js:72 +msgid "Disable Extension" +msgstr "Desactivar l'extension" + +#: confirmDialog.js:58 +msgid "Hibernate button: Hibernate failed" +msgstr "Extension de mesa en velha perlongada : fracàs" + +#: confirmDialog.js:59 +msgid "" +"Looks like hibernation failed.\n" +"On some linux distributions hibernation is disabled\n" +"because not all hardware supports it well;\n" +"please check your distribution documentation\n" +"on how to enable it." +msgstr "" +"La mesa en velha perlongada a fracassat.\n" +"Amb d'unas distribucions Linux, la mesa en velha perlongada es desactivada\n" +"pr'amor que fonciona pas coma cal amb d'unes aparelhs ;\n" +"Mercés de consultar la documentacion de la distribucion\n" +"per saber cossí l'activar." + +#: confirmDialog.js:64 +msgid "You are wrong, don't check this anymore!" +msgstr "Es pas necessari de marcar aquesta casa !" + +#: prefs.js:99 +msgid "This extension has no settings available" +msgstr "Aquesta extension a pas cap de paramètres" diff --git a/extensions/hibernate-status/locale/pl/LC_MESSAGES/hibernate-status-button.po b/extensions/hibernate-status/locale/pl/LC_MESSAGES/hibernate-status-button.po new file mode 100644 index 0000000..57b735c --- /dev/null +++ b/extensions/hibernate-status/locale/pl/LC_MESSAGES/hibernate-status-button.po @@ -0,0 +1,71 @@ +# Polish translation of hibernate-status-button +# Copyright (C) 2022 tebaranowski +# This file is distributed under the same license as the hibernate-status-button package. +# tebaranowski , 2022. +# +msgid "" +msgstr "" +"Project-Id-Version: Hibernate Status Button\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2021-04-11 18:31+0200\n" +"PO-Revision-Date: 2022-11-01 20:31+0200\n" +"Last-Translator: tebaranowski \n" +"Language-Team: Polish \n" +"Language: pl\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: confirmDialog.js:23 confirmDialog.js:32 +msgid "Hibernate" +msgstr "Hibernacja" + +#: extension.js:192 +msgid "Hybrid Sleep" +msgstr "Uśpienie hybrydowe" + +#: confirmDialog.js:24 +msgid "Do you really want to hibernate the system?" +msgstr "Czy na pewno chcesz zahibernować system?" + +#: confirmDialog.js:27 confirmDialog.js:44 confirmDialog.js:67 +msgid "Cancel" +msgstr "Anuluj" + +#: confirmDialog.js:40 +msgid "Hibernate button: Systemd Missing" +msgstr "Nie odnaleziono systemd" + +#: confirmDialog.js:41 +msgid "Systemd seems to be missing and is required." +msgstr "Brak zainstalowanego systemd, wymaganego do hibernacji" + +#: confirmDialog.js:49 confirmDialog.js:72 +msgid "Disable Extension" +msgstr "Wyłącz rozszerzenie" + +#: confirmDialog.js:58 +msgid "Hibernate button: Hibernate failed" +msgstr "Hibernacja nie powiodła się" + +#: confirmDialog.js:59 +msgid "" +"Looks like hibernation failed.\n" +"On some linux distributions hibernation is disabled\n" +"because not all hardware supports it well;\n" +"please check your distribution documentation\n" +"on how to enable it." +msgstr "" +"Wygląda na to, że hibernacja się nie powiodła.\n" +"W niektórych dystrybucjach Linuksa hibernacja jest wyłączona,\n" +"ponieważ nie każdy sprzęt poprawnie ją obsługuje.\n" +"Sprawdź jak ją włączyć w dokumentacji swojej\n" +"dystrybucji." + +#: confirmDialog.js:64 +msgid "You are wrong, don't check this anymore!" +msgstr "Nie sprawdzaj tego ponownie!" + +#: prefs.js:99 +msgid "This extension has no settings available" +msgstr "To rozszerzenie nie posiada możliwości zmiany ustawień" diff --git a/extensions/hibernate-status/locale/pt/LC_MESSAGES/hibernate-status-button.po b/extensions/hibernate-status/locale/pt/LC_MESSAGES/hibernate-status-button.po new file mode 100644 index 0000000..143129c --- /dev/null +++ b/extensions/hibernate-status/locale/pt/LC_MESSAGES/hibernate-status-button.po @@ -0,0 +1,71 @@ +# Portuguese translation of hibernate-status-button +# Copyright (C) 2021 p91paul +# This file is distributed under the same license as the hibernate-status-button package. +# mantonelli , 2021. +# +msgid "" +msgstr "" +"Project-Id-Version: Hibernate Status Button\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2021-04-11 18:31+0200\n" +"PO-Revision-Date: 2022-10-22 21:30+0200\n" +"Last-Translator: mantonelli \n" +"Language-Team: Portuguese \n" +"Language: it\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: confirmDialog.js:23 confirmDialog.js:32 +msgid "Hibernate" +msgstr "Hibernar" + +#: extension.js:192 +msgid "Hybrid Sleep" +msgstr "Suspensão Híbrida" + +#: confirmDialog.js:24 +msgid "Do you really want to hibernate the system?" +msgstr "Deseja realmente hibernar o sistema?" + +#: confirmDialog.js:27 confirmDialog.js:44 confirmDialog.js:67 +msgid "Cancel" +msgstr "Cancelar" + +#: confirmDialog.js:40 +msgid "Hibernate button: Systemd Missing" +msgstr "Systemd não está instalado" + +#: confirmDialog.js:41 +msgid "Systemd seems to be missing and is required." +msgstr "Systemd não está instalado e é necessário" + +#: confirmDialog.js:49 confirmDialog.js:72 +msgid "Disable Extension" +msgstr "Desabilitar extensão" + +#: confirmDialog.js:58 +msgid "Hibernate button: Hibernate failed" +msgstr "Hibernação falhou" + +#: confirmDialog.js:59 +msgid "" +"Looks like hibernation failed.\n" +"On some linux distributions hibernation is disabled\n" +"because not all hardware supports it well;\n" +"please check your distribution documentation\n" +"on how to enable it." +msgstr "" +"Parece que a hibernação falhou.\n" +"Em algumas distribuições Linux a hibernação é desabilitada\n" +"já que nem todo hardware oferece suporte adequado à ela;\n" +"Confira a documentação de sua distribuição\n" +"para aprender como habilitá-la." + +#: confirmDialog.js:64 +msgid "You are wrong, don't check this anymore!" +msgstr "Você errou! Não selecione isso novamente!" + +#: prefs.js:99 +msgid "This extension has no settings available" +msgstr "Essa extensão não possui configurações disponíveis" diff --git a/extensions/hibernate-status/locale/pt_BR/LC_MESSAGES/hibernate-status-button.po b/extensions/hibernate-status/locale/pt_BR/LC_MESSAGES/hibernate-status-button.po new file mode 100644 index 0000000..326481a --- /dev/null +++ b/extensions/hibernate-status/locale/pt_BR/LC_MESSAGES/hibernate-status-button.po @@ -0,0 +1,73 @@ +# Portuguese translation of hibernate-status-button +# Copyright (C) 2021 p91paul +# This file is distributed under the same license as the hibernate-status-button package. +# mantonelli , 2021. +# +msgid "" +msgstr "" +"Project-Id-Version: Hibernate Status Button\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2021-04-11 18:31+0200\n" +"PO-Revision-Date: 2022-10-22 21:30+0200\n" +"Last-Translator: Fabrício Müller \n" +"Language-Team: Brazilian Portuguese \n" +"Language: pt_BR\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Poedit 3.0.1\n" + +#: confirmDialog.js:23 confirmDialog.js:32 +msgid "Hibernate" +msgstr "Hibernar" + +#: extension.js:192 +msgid "Hybrid Sleep" +msgstr "Suspensão Híbrida" + +#: confirmDialog.js:24 +msgid "Do you really want to hibernate the system?" +msgstr "Deseja realmente hibernar o sistema?" + +#: confirmDialog.js:27 confirmDialog.js:44 confirmDialog.js:67 +msgid "Cancel" +msgstr "Cancelar" + +#: confirmDialog.js:40 +msgid "Hibernate button: Systemd Missing" +msgstr "Systemd não está instalado" + +#: confirmDialog.js:41 +msgid "Systemd seems to be missing and is required." +msgstr "Systemd não está instalado e é necessário." + +#: confirmDialog.js:49 confirmDialog.js:72 +msgid "Disable Extension" +msgstr "Desabilitar extensão" + +#: confirmDialog.js:58 +msgid "Hibernate button: Hibernate failed" +msgstr "Hibernação falhou" + +#: confirmDialog.js:59 +msgid "" +"Looks like hibernation failed.\n" +"On some linux distributions hibernation is disabled\n" +"because not all hardware supports it well;\n" +"please check your distribution documentation\n" +"on how to enable it." +msgstr "" +"Parece que a hibernação falhou.\n" +"Em algumas distribuições Linux a hibernação é desabilitada\n" +"já que nem todo hardware oferece suporte adequado à ela;\n" +"Confira a documentação de sua distribuição\n" +"para aprender como habilitá-la." + +#: confirmDialog.js:64 +msgid "You are wrong, don't check this anymore!" +msgstr "Você errou! Não selecione isso novamente!" + +#: prefs.js:99 +msgid "This extension has no settings available" +msgstr "Essa extensão não possui configurações disponíveis" diff --git a/extensions/hibernate-status/locale/ru/LC_MESSAGES/hibernate-status-button.po b/extensions/hibernate-status/locale/ru/LC_MESSAGES/hibernate-status-button.po new file mode 100644 index 0000000..c279315 --- /dev/null +++ b/extensions/hibernate-status/locale/ru/LC_MESSAGES/hibernate-status-button.po @@ -0,0 +1,74 @@ +# Russian translation of hibernate-status-button +# Copyright (C) 2021 Serhii Riznychenko +# This file is distributed under the same license as the hibernate-status-button package. +# Serhii Riznychenko, 2021. +# +msgid "" +msgstr "" +"Project-Id-Version: Hibernate Status Button\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2021-04-11 18:31+0200\n" +"PO-Revision-Date: 2021-11-11 02:00+0200\n" +"Last-Translator: Serhii Riznychenko\n" +"Language-Team: Russian\n" +"Language: ru\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : 2);\n" +"X-Generator: Poedit 3.0\n" +"X-Poedit-Basepath: .\n" + +#: extension.js:189 confirmDialog.js:23 confirmDialog.js:32 +msgid "Hibernate" +msgstr "Спящий режим" + +#: extension.js:192 +msgid "Hybrid Sleep" +msgstr "Гибридный сон" + +#: confirmDialog.js:24 +msgid "Do you really want to hibernate the system?" +msgstr "Вы действительно хотите перевести систему в спящий режим?" + +#: confirmDialog.js:27 confirmDialog.js:44 confirmDialog.js:67 +msgid "Cancel" +msgstr "Отмена" + +#: confirmDialog.js:40 +msgid "Hibernate button: Systemd Missing" +msgstr "Не обнаружено systemd" + +#: confirmDialog.js:41 +msgid "Systemd seems to be missing and is required." +msgstr "Кажется отсутствует systemd, необходимый для режима сна." + +#: confirmDialog.js:49 confirmDialog.js:72 +msgid "Disable Extension" +msgstr "Отключить расширение" + +#: confirmDialog.js:58 +msgid "Hibernate button: Hibernate failed" +msgstr "Не удалось перевести систему в сон" + +#: confirmDialog.js:59 +msgid "" +"Looks like hibernation failed.\n" +"On some linux distributions hibernation is disabled\n" +"because not all hardware supports it well;\n" +"please check your distribution documentation\n" +"on how to enable it." +msgstr "" +"Попытка перевести систему в сон завершилась неудачей.\n" +"На некоторых дистрибутивах режим сна отключен\n" +"так как не каждое оборудование имеет поддержку,\n" +"пожалуйста обратитесь к документации своего дистрибутива\n" +"чтобы узнать как его включить." + +#: confirmDialog.js:64 +msgid "You are wrong, don't check this anymore!" +msgstr "Вы ошиблись, пожалуйста не трогайте это!" + +#: prefs.js:99 +msgid "This extension has no settings available" +msgstr "Это расширение не содержит параметров" diff --git a/extensions/hibernate-status/locale/uk/LC_MESSAGES/hibernate-status-button.po b/extensions/hibernate-status/locale/uk/LC_MESSAGES/hibernate-status-button.po new file mode 100644 index 0000000..68c6b8c --- /dev/null +++ b/extensions/hibernate-status/locale/uk/LC_MESSAGES/hibernate-status-button.po @@ -0,0 +1,74 @@ +# Ukrainian translation of hibernate-status-button +# Copyright (C) 2021 Serhii Riznychenko +# This file is distributed under the same license as the hibernate-status-button package. +# Serhii Riznychenko, 2021. +# +msgid "" +msgstr "" +"Project-Id-Version: Hibernate Status Button\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2021-04-11 18:31+0200\n" +"PO-Revision-Date: 2021-11-11 02:00+0200\n" +"Last-Translator: Serhii Riznychenko\n" +"Language-Team: Ukraine\n" +"Language: uk\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : 2);\n" +"X-Generator: Poedit 3.0\n" +"X-Poedit-Basepath: .\n" + +#: extension.js:189 confirmDialog.js:23 confirmDialog.js:32 +msgid "Hibernate" +msgstr "Перейти в сон" + +#: extension.js:192 +msgid "Hybrid Sleep" +msgstr "Перейти в гібридний сон" + +#: confirmDialog.js:24 +msgid "Do you really want to hibernate the system?" +msgstr "Ви дійсно хочете перевести систему в режим сну?" + +#: confirmDialog.js:27 confirmDialog.js:44 confirmDialog.js:67 +msgid "Cancel" +msgstr "Відміна" + +#: confirmDialog.js:40 +msgid "Hibernate button: Systemd Missing" +msgstr "Не виявлено systemd" + +#: confirmDialog.js:41 +msgid "Systemd seems to be missing and is required." +msgstr "Здається відсутній systemd, необхідний режиму сну." + +#: confirmDialog.js:49 confirmDialog.js:72 +msgid "Disable Extension" +msgstr "Вимкнути розширення" + +#: confirmDialog.js:58 +msgid "Hibernate button: Hibernate failed" +msgstr "Не вдалося перевести систему в сон" + +#: confirmDialog.js:59 +msgid "" +"Looks like hibernation failed.\n" +"On some linux distributions hibernation is disabled\n" +"because not all hardware supports it well;\n" +"please check your distribution documentation\n" +"on how to enable it." +msgstr "" +"Спроба перевести систему в сон завершилася невдачею.\n" +"На деяких дистрибутивах режим сну вимкнено\n" +"оскільки не кожне обладнання має його підтримку,\n" +"Будь ласка, зверніться до документації свого дистрибутива\n" +"щоб дізнатися, як його включити." + +#: confirmDialog.js:64 +msgid "You are wrong, don't check this anymore!" +msgstr "Ви помилилися, будь ласка, не чіпайте це!" + +#: prefs.js:99 +msgid "This extension has no settings available" +msgstr "Це розширення не містить параметрів" diff --git a/extensions/hibernate-status/locale/zh_CN/LC_MESSAGES/hibernate-status-button.po b/extensions/hibernate-status/locale/zh_CN/LC_MESSAGES/hibernate-status-button.po new file mode 100644 index 0000000..be1a6b1 --- /dev/null +++ b/extensions/hibernate-status/locale/zh_CN/LC_MESSAGES/hibernate-status-button.po @@ -0,0 +1,59 @@ +# Simplified Chinese translation of hibernate-status-button +# Copyright (C) 2019 zhmars +# This file is distributed under the same license as the hibernate-status-button package. +# zhmars <1403122061@qq.com>, 2019. +# +msgid "" +msgstr "" +"Project-Id-Version: Hibernate Status Button\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2019-11-22 00:08+0800\n" +"PO-Revision-Date: 2019-11-21 20:00+0800\n" +"Last-Translator: zhmars <1403122061@qq.com>\n" +"Language-Team: Chinese (Simplified) <>\n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: confirmDialog.js:23 confirmDialog.js:32 +msgid "Hibernate" +msgstr "休眠" + +#: confirmDialog.js:24 +msgid "Do you really want to hibernate the system?" +msgstr "确定要休眠系统吗?" + +#: confirmDialog.js:27 confirmDialog.js:44 confirmDialog.js:67 +msgid "Cancel" +msgstr "取消" + +#: confirmDialog.js:40 +msgid "Hibernate button: Systemd Missing" +msgstr "无法找到 Systemd" + +#: confirmDialog.js:41 +msgid "Systemd seems to be missing and is required." +msgstr "本功能依赖 Systemd,但目前无法找到。" + +#: confirmDialog.js:49 confirmDialog.js:72 +msgid "Disable Extension" +msgstr "禁用扩展" + +#: confirmDialog.js:58 +msgid "Hibernate button: Hibernate failed" +msgstr "休眠失败" + +#: confirmDialog.js:59 +msgid "" +"Looks like hibernation failed.\n" +"On some linux distributions hibernation is disabled\n" +"because not all hardware supports it well;\n" +"please check your distribution documentation\n" +"on how to enable it." +msgstr "休眠好像失败了。由于不是所有硬件都对该功能支持良好," +"某些发行版默认禁用了休眠,关于如何启用请查阅你所用的发行版文档" + +#: confirmDialog.js:64 +msgid "You are wrong, don't check this anymore!" +msgstr "忽略本项检查" diff --git a/extensions/hibernate-status/metadata.json b/extensions/hibernate-status/metadata.json new file mode 100644 index 0000000..94098fe --- /dev/null +++ b/extensions/hibernate-status/metadata.json @@ -0,0 +1,10 @@ +{ + "uuid": "hibernate-status@dromi", + "name": "Hibernate Status Button", + "url": "https://github.com/arelange/gnome-shell-extension-hibernate-status", + "description": "Adds a Hibernate button in Status menu. Using Alt modifier, you can also select Hybrid Sleep instead.", + "shell-version": [ + "43" + ], + "gettext-domain": "hibernate-status-button" +} diff --git a/extensions/hibernate-status/prefs.js b/extensions/hibernate-status/prefs.js new file mode 100644 index 0000000..cdcd50e --- /dev/null +++ b/extensions/hibernate-status/prefs.js @@ -0,0 +1,105 @@ +const Gio = imports.gi.Gio; +const Gtk = imports.gi.Gtk; +const Me = imports.misc.extensionUtils.getCurrentExtension(); +// Use __() and N__() for the extension gettext domain, and reuse +// the shell domain with the default _() and N_() +const Gettext = imports.gettext.domain('hibernate-status-button'); +const __ = Gettext.gettext; +const N__ = function(e) { return e }; +const ExtensionUtils = imports.misc.extensionUtils; + +var Prefs = class Prefs { + /** + * Creates a new Settings-object to access the settings of this extension. + * @private + */ + constructor() { + this.KEY_HIBERNATE_WORKS_CHECK = "hibernate-works-check"; + this._schemaName = "org.gnome.shell.extensions.hibernate-status-button"; + + let schemaDir = Me.dir.get_child('schemas').get_path(); + + let schemaSource = Gio.SettingsSchemaSource.new_from_directory( + schemaDir, Gio.SettingsSchemaSource.get_default(), false + ); + let schema = schemaSource.lookup(this._schemaName, false); + + this._setting = new Gio.Settings({ + settings_schema: schema + }); + } + /** + *

Binds the given 'callback'-function to the "changed"-signal on the given + * key.

+ *

The 'callback'-function is passed an argument which holds the new + * value of 'key'. The argument is of type "GLib.Variant". Given that the + * receiver knows the internal type, use one of the get_XX()-methods to get + * it's actual value.

+ * @see http://www.roojs.com/seed/gir-1.2-gtk-3.0/gjs/GLib.Variant.html + * @param key the key to watch for changes. + * @param callback the callback-function to call. + */ + bindKey(key, callback) { + // Validate: + if (key === undefined || key === null || typeof key !== "string") { + throw TypeError("The 'key' should be a string. Got: '" + key + "'"); + } + if (callback === undefined || callback === null || typeof callback !== "function") { + throw TypeError("'callback' needs to be a function. Got: " + callback); + } + // Bind: + this._setting.connect("changed::" + key, function (source, key) { + callback(source.get_value(key)); + }); + } + /** + * Get if check for working hibernation is enabled. The user might + * choose to disable it if we happen to be wrong. + * + * @returns bool true if we need to check if hibernation works. + */ + getHibernateWorksCheckEnabled() { + return this._setting.get_boolean(this.KEY_HIBERNATE_WORKS_CHECK); + } + /** + * Set if check for working hibernation is enabled. The user might + * choose to disable it if we happen to be wrong. + * + * @returns bool true if we need to check if hibernation works. + */ + setHibernateWorksCheckEnabled(enabled) { + let key = this.KEY_HIBERNATE_WORKS_CHECK; + if (this._setting.is_writable(key)) { + if (this._setting.set_boolean(key, enabled)) { + Gio.Settings.sync(); + } else { + throw this._errorSet(key); + } + } else { + throw this._errorWritable(key); + } + } + _errorWritable(key) { + return "The key '" + key + "' is not writable."; + } + _errorSet(key) { + return "Couldn't set the key '" + key + "'"; + } +} + +// These "preferences" aren't user accessible so define +// init() and buildPrefsWidget() to empty functions +function init() { + ExtensionUtils.initTranslations('hibernate-status-button'); +} +function buildPrefsWidget() { + let frame = new Gtk.Box({orientation: Gtk.Orientation.VERTICAL, + 'margin-top': 10, + 'margin-end': 10, + 'margin-bottom': 10, + 'margin-start': 10}); + let setting_label = new Gtk.Label({label: __("This extension has no settings available"), + xalign: 0 }); + frame.append(setting_label); + return frame; +} diff --git a/extensions/hibernate-status/schemas/org.gnome.shell.extensions.hibernate-status-button.gschema.xml b/extensions/hibernate-status/schemas/org.gnome.shell.extensions.hibernate-status-button.gschema.xml new file mode 100644 index 0000000..f29ec1c --- /dev/null +++ b/extensions/hibernate-status/schemas/org.gnome.shell.extensions.hibernate-status-button.gschema.xml @@ -0,0 +1,8 @@ + + + + + true + + + diff --git a/extensions/middleclickclose.mk b/extensions/middleclickclose.mk new file mode 100644 index 0000000..d484427 --- /dev/null +++ b/extensions/middleclickclose.mk @@ -0,0 +1,57 @@ +# Progress Linux: gnome-shell-extensions-extra + +# Copyright (C) 2010-2023 Daniel Baumann +# +# SPDX-License-Identifier: GPL-3.0+ +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Build-Depends: +# gettext libglib2.0-bin + +SHELL := sh -e + +EXTENSION := middleclickclose +UUID := $(shell awk -F\" '/"uuid": / { print $$4 }' $(EXTENSION)/*@*/metadata.json) + +all: + +test: + +build: + for TRANSLATION in $(EXTENSION)/$(UUID)/locale/*/*/*.mo; \ + do \ + msgfmt -cv -o $${TRANSLATION} $$(dirname $${TRANSLATION})/$$(basename $${TRANSLATION} .mo).po; \ + done + + glib-compile-schemas --strict --targetdir=$(EXTENSION)/$(UUID)/schemas/ $(EXTENSION)/$(UUID)/schemas + +install: build + mkdir -p $(DESTDIR)/usr/share/gnome-shell/extensions + cp -a $(EXTENSION)/$(UUID) $(DESTDIR)/usr/share/gnome-shell/extensions + +uninstall: + rm -rf $(DESTDIR)/usr/share/gnome-shell/extensions/$(UUID) + rmdir --ignore-fail-on-non-empty --parents $(DESTDIR) || true + +clean: + +distclean: + +reinstall: uninstall install + +upstream: + rm -rf $(EXTENSION) + git clone https://github.com/p91paul/$(EXTENSION) + rm -rf $(EXTENSION)/.git diff --git a/extensions/middleclickclose/.gitignore b/extensions/middleclickclose/.gitignore new file mode 100644 index 0000000..4df7101 --- /dev/null +++ b/extensions/middleclickclose/.gitignore @@ -0,0 +1,2 @@ +middleclickclose@paolo.tranquilli.gmail.com.zip +gschemas.compiled diff --git a/extensions/middleclickclose/LICENSE b/extensions/middleclickclose/LICENSE new file mode 100644 index 0000000..22fbe5d --- /dev/null +++ b/extensions/middleclickclose/LICENSE @@ -0,0 +1,339 @@ +GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + {description} + Copyright (C) {year} {fullname} + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + {signature of Ty Coon}, 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. \ No newline at end of file diff --git a/extensions/middleclickclose/README.md b/extensions/middleclickclose/README.md new file mode 100644 index 0000000..60e0c82 --- /dev/null +++ b/extensions/middleclickclose/README.md @@ -0,0 +1,23 @@ +Middleclickclose +================ + +Gnome shell extension for closing apps in overview with a middle click + +All credit goes to Paolo Tranquilli (http://cs.unibo.it/~tranquil/en/hacking.html), I've merely copied its code here to provide Gnome Shell 3.10+ compatibility + +This extension is installable from https://extensions.gnome.org/extension/352/middle-click-to-close-in-overview/. + +Otherwise you may + +* download a [zip](https://github.com/p91paul/middleclickclose/archive/master.zip) of this extension +* extract it +* copy folder middleclickclose@paolo.tranquilli.gmail.com in $HOME/.local/share/gnome-shell/extensions +* run the following command + + ``` + glib-compile-schemas $HOME/.local/share/gnome-shell/extensions/middleclickclose@paolo.tranquilli.gmail.com/schemas +``` + +* reload gnome-shell (Alt-F2, r, Enter) +* activate it through Gnome Tweak Tool. +![](tweak-tool-screenshot.png) diff --git a/extensions/middleclickclose/buildforupload.sh b/extensions/middleclickclose/buildforupload.sh new file mode 100755 index 0000000..be665d6 --- /dev/null +++ b/extensions/middleclickclose/buildforupload.sh @@ -0,0 +1,5 @@ +#!/bin/bash +rm -rf middleclickclose@paolo.tranquilli.gmail.com.zip +cd middleclickclose@paolo.tranquilli.gmail.com/ +glib-compile-schemas schemas +zip -r ../middleclickclose@paolo.tranquilli.gmail.com.zip * -x '*.po' diff --git a/extensions/middleclickclose/middleclickclose@paolo.tranquilli.gmail.com/extension.js b/extensions/middleclickclose/middleclickclose@paolo.tranquilli.gmail.com/extension.js new file mode 100644 index 0000000..17c5174 --- /dev/null +++ b/extensions/middleclickclose/middleclickclose@paolo.tranquilli.gmail.com/extension.js @@ -0,0 +1,117 @@ +/* This extension is a derived work of the Gnome Shell. +* +* Copyright (c) 2013 Paolo Tranquilli +* +* This extension is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This extension is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this extension; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +const CLOSE_BUTTON = 'close-button'; +const REARRANGE_DELAY = 'rearrange-delay'; + + +const St = imports.gi.St; +const Main = imports.ui.main; +const Workspace = imports.ui.workspace +const WindowPreview = imports.ui.windowPreview.WindowPreview +const Mainloop = imports.mainloop; +const ExtensionUtils = imports.misc.extensionUtils; + +const Me = ExtensionUtils.getCurrentExtension(); + +var Init = class Init { + + _connectSettings() { + this._settingsSignals = []; + this._settingsSignals.push(this._settings.connect('changed::'+CLOSE_BUTTON, this._setCloseButton.bind(this))); + this._settingsSignals.push(this._settings.connect('changed::'+REARRANGE_DELAY, this._setRearrangeDelay.bind(this))); + } + + _disconnectSettings() { + while(this._settingsSignals.length > 0) { + this._settings.disconnect(this._settingsSignals.pop()); + } + } + + _setCloseButton() { + this._closeButton = this._settings.get_enum(CLOSE_BUTTON) + 1; + } + + _setRearrangeDelay() { + this._rearrangeDelay = this._settings.get_int(REARRANGE_DELAY); + } + + enable() { + this._oldActivate = WindowPreview.prototype._activate; + this._oldDoRemoveWindow = Workspace.Workspace.prototype._doRemoveWindow; + this._oldAddWindowClone = Workspace.Workspace.prototype._addWindowClone; + this._settings = ExtensionUtils.getSettings(); + this._oldDelay = Workspace.WINDOW_REPOSITIONING_DELAY; + this._setCloseButton(); + this._setRearrangeDelay(); + // I'll go with a closure, not sure how to do it otherwise + let init = this; + + // my handling logic + const onClicked = function(action, actor) { + this._selected = true; + if (action.get_button() == init._closeButton) { + this._deleteAll(); + } else { + init._oldActivate.apply(this); + } + }; + + // override _addWindowClone to add my event handler + Workspace.Workspace.prototype._addWindowClone = function(metaWindow) { + let clone = init._oldAddWindowClone.apply(this, [metaWindow]); + clone.get_actions()[0].connect('clicked', onClicked.bind(clone)); + return clone; + } + + // override WindowClone's _activate + WindowPreview.prototype._activate = () => {}; + + // override Workspace's _doRemoveWindow in order to put into it the + // parameteriseable rearrangement delay. Rather than copy the code from + // workspace.js, we reuse it but remove the scheduled rearrangement task + // (as its 750ms delay is hard-coded...) + Workspace.WINDOW_REPOSITIONING_DELAY = Math.max(init._rearrangeDelay,1); + + this._connectSettings(); + } + + disable() { + WindowPreview.prototype._activate = this._oldActivate; + Workspace.Workspace.prototype._doRemoveWindow = this._oldDoRemoveWindow; + Workspace.WINDOW_REPOSITIONING_DELAY = this._oldDelay; + Workspace.Workspace.prototype._addWindowClone = this._oldAddWindowClone; + this._disconnectSettings(); + } +} + +function init() { + ExtensionUtils.initTranslations(); +} + +let _init; +function enable() { + _init = new Init(); + _init.enable(); +} + +function disable() { + _init?.disable(); + _init = null; +} diff --git a/extensions/middleclickclose/middleclickclose@paolo.tranquilli.gmail.com/locale/de/LC_MESSAGES/de_DE.mo b/extensions/middleclickclose/middleclickclose@paolo.tranquilli.gmail.com/locale/de/LC_MESSAGES/de_DE.mo new file mode 100644 index 0000000..33687cb Binary files /dev/null and b/extensions/middleclickclose/middleclickclose@paolo.tranquilli.gmail.com/locale/de/LC_MESSAGES/de_DE.mo differ diff --git a/extensions/middleclickclose/middleclickclose@paolo.tranquilli.gmail.com/locale/de/LC_MESSAGES/de_DE.po b/extensions/middleclickclose/middleclickclose@paolo.tranquilli.gmail.com/locale/de/LC_MESSAGES/de_DE.po new file mode 100644 index 0000000..aed9f54 --- /dev/null +++ b/extensions/middleclickclose/middleclickclose@paolo.tranquilli.gmail.com/locale/de/LC_MESSAGES/de_DE.po @@ -0,0 +1,75 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# Onno Giesmann , 2019. +# +msgid "" +msgstr "" +"Project-Id-Version: gnome-shell-extensions-middleclickclose\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-12-30 07:06+0100\n" +"PO-Revision-Date: 2019-06-17 20:44+0200\n" +"Language-Team: German <--->\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Gtranslator 3.32.1\n" +"Last-Translator: Onno Giesmann \n" +"Plural-Forms: nplurals=2; plural=(n != 1)\n" +"Language: de\n" + +#: ../../../prefs.js:33 +msgid "Mouse button to close" +msgstr "Maustaste zum Schließen" + +#: ../../../prefs.js:34 +msgid "Which mouse button triggers closing in overview." +msgstr "Gibt an, welche Maustaste das Schließen in der Übersicht auslöst." + +#: ../../../prefs.js:36 +msgid "Left" +msgstr "Linke" + +#: ../../../prefs.js:37 +msgid "Middle" +msgstr "Mittlere" + +#: ../../../prefs.js:38 +msgid "Right" +msgstr "Rechte" + +#: ../../../prefs.js:39 +msgid "Button 4" +msgstr "Taste 4" + +#: ../../../prefs.js:40 +msgid "Button 5" +msgstr "Taste 5" + +#: ../../../prefs.js:41 +msgid "Button 6" +msgstr "Taste 6" + +#: ../../../prefs.js:42 +msgid "Button 7" +msgstr "Taste 7" + +#: ../../../prefs.js:43 +msgid "Button 8" +msgstr "Taste 8" + +#: ../../../prefs.js:44 +msgid "Button 9" +msgstr "Taste 9" + +#: ../../../prefs.js:50 +msgid "Rearrange delay" +msgstr "Verzögerung bis zur Neuanordnung" + +#: ../../../prefs.js:51 +msgid "" +"How much time must pass with the pointer not moving for windows in overview " +"to rearrange after one was closed." +msgstr "" +"Gibt die Zeit an, die bei stillstehender Maus vergehen muss, bevor sich die " +"Fenster in der Übersicht neu anordnen, nachdem ein Fenster geschlossen wurde." diff --git a/extensions/middleclickclose/middleclickclose@paolo.tranquilli.gmail.com/locale/fr/LC_MESSAGES/fr.mo b/extensions/middleclickclose/middleclickclose@paolo.tranquilli.gmail.com/locale/fr/LC_MESSAGES/fr.mo new file mode 100644 index 0000000..eaedef4 Binary files /dev/null and b/extensions/middleclickclose/middleclickclose@paolo.tranquilli.gmail.com/locale/fr/LC_MESSAGES/fr.mo differ diff --git a/extensions/middleclickclose/middleclickclose@paolo.tranquilli.gmail.com/locale/fr/LC_MESSAGES/fr.po b/extensions/middleclickclose/middleclickclose@paolo.tranquilli.gmail.com/locale/fr/LC_MESSAGES/fr.po new file mode 100644 index 0000000..b842115 --- /dev/null +++ b/extensions/middleclickclose/middleclickclose@paolo.tranquilli.gmail.com/locale/fr/LC_MESSAGES/fr.po @@ -0,0 +1,75 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: gnome-shell-extensions-middleclickclose\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-12-30 07:06+0100\n" +"PO-Revision-Date: 2015-12-30 07:08+0100\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 1.8.5\n" +"Last-Translator: DAEM Q.\n" +"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" +"Language: fr\n" + +#: ../../../prefs.js:33 +msgid "Mouse button to close" +msgstr "Bouton de souris pour fermer la fenêtre" + +#: ../../../prefs.js:34 +msgid "Which mouse button triggers closing in overview." +msgstr "Le bouton de la souris qui déclenche la fermeture d'une fenêtre dans la Vue d'ensemble." + +#: ../../../prefs.js:36 +msgid "Left" +msgstr "Gauche" + +#: ../../../prefs.js:37 +msgid "Middle" +msgstr "Milieu" + +#: ../../../prefs.js:38 +msgid "Right" +msgstr "Droit" + +#: ../../../prefs.js:39 +msgid "Button 4" +msgstr "Bouton 4" + +#: ../../../prefs.js:40 +msgid "Button 5" +msgstr "Bouton 5" + +#: ../../../prefs.js:41 +msgid "Button 6" +msgstr "Bouton 6" + +#: ../../../prefs.js:42 +msgid "Button 7" +msgstr "Bouton 7" + +#: ../../../prefs.js:43 +msgid "Button 8" +msgstr "Bouton 8" + +#: ../../../prefs.js:44 +msgid "Button 9" +msgstr "Bouton 9" + +#: ../../../prefs.js:50 +msgid "Rearrange delay" +msgstr "Délai avant réarrangement" + +#: ../../../prefs.js:51 +msgid "" +"How much time must pass with the pointer not moving for windows in overview " +"to rearrange after one was closed." +msgstr "" +"Temps qu'il doit se passer sans que le pointeur de la souris ne bouge dans la Vue d'ensemble " +"avant réarrangement des fenêtres." diff --git a/extensions/middleclickclose/middleclickclose@paolo.tranquilli.gmail.com/locale/it/LC_MESSAGES/it.mo b/extensions/middleclickclose/middleclickclose@paolo.tranquilli.gmail.com/locale/it/LC_MESSAGES/it.mo new file mode 100644 index 0000000..dbe500d Binary files /dev/null and b/extensions/middleclickclose/middleclickclose@paolo.tranquilli.gmail.com/locale/it/LC_MESSAGES/it.mo differ diff --git a/extensions/middleclickclose/middleclickclose@paolo.tranquilli.gmail.com/locale/it/LC_MESSAGES/it.po b/extensions/middleclickclose/middleclickclose@paolo.tranquilli.gmail.com/locale/it/LC_MESSAGES/it.po new file mode 100644 index 0000000..bcc71c4 --- /dev/null +++ b/extensions/middleclickclose/middleclickclose@paolo.tranquilli.gmail.com/locale/it/LC_MESSAGES/it.po @@ -0,0 +1,75 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: gnome-shell-extensions-middleclickclose\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-12-30 07:06+0100\n" +"PO-Revision-Date: 2017-04-21 10:06+0200\n" +"Language-Team: Jimmy Scionti \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 1.8.7.1\n" +"Last-Translator: Jimmy Scionti \n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"Language: it\n" + +#: ../../../prefs.js:33 +msgid "Mouse button to close" +msgstr "Pulsante del mouse per chiudere la finestra" + +#: ../../../prefs.js:34 +msgid "Which mouse button triggers closing in overview." +msgstr "Seleziona quale pulsante del mouse premere per chiudere una finestra." + +#: ../../../prefs.js:36 +msgid "Left" +msgstr "Sinistro" + +#: ../../../prefs.js:37 +msgid "Middle" +msgstr "Centrale" + +#: ../../../prefs.js:38 +msgid "Right" +msgstr "Destro" + +#: ../../../prefs.js:39 +msgid "Button 4" +msgstr "Pulsante 4" + +#: ../../../prefs.js:40 +msgid "Button 5" +msgstr "Pulsante 5" + +#: ../../../prefs.js:41 +msgid "Button 6" +msgstr "Pulsante 6" + +#: ../../../prefs.js:42 +msgid "Button 7" +msgstr "Pulsante 7" + +#: ../../../prefs.js:43 +msgid "Button 8" +msgstr "Pulsante 8" + +#: ../../../prefs.js:44 +msgid "Button 9" +msgstr "Pulsante 9" + +#: ../../../prefs.js:50 +msgid "Rearrange delay" +msgstr "Ritardo del riordinamento" + +#: ../../../prefs.js:51 +msgid "" +"How much time must pass with the pointer not moving for windows in overview to rearrange " +"after one was closed." +msgstr "" +"Seleziona il tempo di attesa tra la chiusura di una finestra e il riordinamento delle altre " +"finestre nell'anteprima." diff --git a/extensions/middleclickclose/middleclickclose@paolo.tranquilli.gmail.com/locale/nl/nl.mo b/extensions/middleclickclose/middleclickclose@paolo.tranquilli.gmail.com/locale/nl/nl.mo new file mode 100644 index 0000000..1b5cf7a Binary files /dev/null and b/extensions/middleclickclose/middleclickclose@paolo.tranquilli.gmail.com/locale/nl/nl.mo differ diff --git a/extensions/middleclickclose/middleclickclose@paolo.tranquilli.gmail.com/locale/nl/nl.po b/extensions/middleclickclose/middleclickclose@paolo.tranquilli.gmail.com/locale/nl/nl.po new file mode 100644 index 0000000..62fc210 --- /dev/null +++ b/extensions/middleclickclose/middleclickclose@paolo.tranquilli.gmail.com/locale/nl/nl.po @@ -0,0 +1,74 @@ +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# +# Heimen Stoffels , 2019. +msgid "" +msgstr "" +"Project-Id-Version: gnome-shell-extensions-middleclickclose\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-12-30 07:06+0100\n" +"PO-Revision-Date: 2019-09-15 20:17+0200\n" +"Language-Team: Dutch \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 2.2.1\n" +"Last-Translator: Heimen Stoffels \n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"Language: it\n" + +#: ../../../prefs.js:33 +msgid "Mouse button to close" +msgstr "Muisknop om vensters mee te sluiten" + +#: ../../../prefs.js:34 +msgid "Which mouse button triggers closing in overview." +msgstr "Met welke muisknop je vensters kunt sluiten op het overzicht." + +#: ../../../prefs.js:36 +msgid "Left" +msgstr "Links" + +#: ../../../prefs.js:37 +msgid "Middle" +msgstr "Scrollwiel" + +#: ../../../prefs.js:38 +msgid "Right" +msgstr "Rechts" + +#: ../../../prefs.js:39 +msgid "Button 4" +msgstr "Knop 4" + +#: ../../../prefs.js:40 +msgid "Button 5" +msgstr "Knop 5" + +#: ../../../prefs.js:41 +msgid "Button 6" +msgstr "Knop 6" + +#: ../../../prefs.js:42 +msgid "Button 7" +msgstr "Knop 7" + +#: ../../../prefs.js:43 +msgid "Button 8" +msgstr "Knop 8" + +#: ../../../prefs.js:44 +msgid "Button 9" +msgstr "Knop 9" + +#: ../../../prefs.js:50 +msgid "Rearrange delay" +msgstr "Vertraging bij herschikken" + +#: ../../../prefs.js:51 +msgid "" +"How much time must pass with the pointer not moving for windows in " +"overview to rearrange after one was closed." +msgstr "" +"Hoeveel tijd er moet verstrijken na het sluiten van een venster voordat " +"vensters worden herschikt." diff --git a/extensions/middleclickclose/middleclickclose@paolo.tranquilli.gmail.com/locale/sk/LC_MESSAGES/sk.mo b/extensions/middleclickclose/middleclickclose@paolo.tranquilli.gmail.com/locale/sk/LC_MESSAGES/sk.mo new file mode 100644 index 0000000..4ceacc9 Binary files /dev/null and b/extensions/middleclickclose/middleclickclose@paolo.tranquilli.gmail.com/locale/sk/LC_MESSAGES/sk.mo differ diff --git a/extensions/middleclickclose/middleclickclose@paolo.tranquilli.gmail.com/locale/sk/LC_MESSAGES/sk.po b/extensions/middleclickclose/middleclickclose@paolo.tranquilli.gmail.com/locale/sk/LC_MESSAGES/sk.po new file mode 100644 index 0000000..801f9bc --- /dev/null +++ b/extensions/middleclickclose/middleclickclose@paolo.tranquilli.gmail.com/locale/sk/LC_MESSAGES/sk.po @@ -0,0 +1,75 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: gnome-shell-extensions-middleclickclose\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-10-30 07:06+0100\n" +"PO-Revision-Date: 2015-10-30 07:08+0100\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 1.8.5\n" +"Last-Translator: Juraj Fiala \n" +"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" +"Language: sk\n" + +#: ../../../prefs.js:33 +msgid "Mouse button to close" +msgstr "Tlačidlo myši na zavretie" + +#: ../../../prefs.js:34 +msgid "Which mouse button triggers closing in overview." +msgstr "Ktoré tlačidlo myši spustí zavretie v prehľade aktivít." + +#: ../../../prefs.js:36 +msgid "Left" +msgstr "Ľavé" + +#: ../../../prefs.js:37 +msgid "Middle" +msgstr "Stredné" + +#: ../../../prefs.js:38 +msgid "Right" +msgstr "Pravé" + +#: ../../../prefs.js:39 +msgid "Button 4" +msgstr "Tlačidlo 4" + +#: ../../../prefs.js:40 +msgid "Button 5" +msgstr "Tlačidlo 5" + +#: ../../../prefs.js:41 +msgid "Button 6" +msgstr "Tlačidlo 6" + +#: ../../../prefs.js:42 +msgid "Button 7" +msgstr "Tlačidlo 7" + +#: ../../../prefs.js:43 +msgid "Button 8" +msgstr "Tlačidlo 8" + +#: ../../../prefs.js:44 +msgid "Button 9" +msgstr "Tlačidlo 9" + +#: ../../../prefs.js:50 +msgid "Rearrange delay" +msgstr "Oneskorenie preskúpenia" + +#: ../../../prefs.js:51 +msgid "" +"How much time must pass with the pointer not moving for windows in overview " +"to rearrange after one was closed." +msgstr "" +"Koľko času musí prejsť od posledného pohnutia kurzora myši aby sa okná v " +"prehľade znovu usporiadali po tom ako bolo jedno zavreté." diff --git a/extensions/middleclickclose/middleclickclose@paolo.tranquilli.gmail.com/metadata.json b/extensions/middleclickclose/middleclickclose@paolo.tranquilli.gmail.com/metadata.json new file mode 100644 index 0000000..ea89661 --- /dev/null +++ b/extensions/middleclickclose/middleclickclose@paolo.tranquilli.gmail.com/metadata.json @@ -0,0 +1,14 @@ +{ + "shell-version": [ + "42", + "43" + ], + "settings-schema": "org.gnome.shell.extensions.middleclickclose", + "gettext-domain": "org.gnome.shell.extensions.middleclickclose", + "uuid": "middleclickclose@paolo.tranquilli.gmail.com", + "name": "Quick Close in Overview", + "description": "Close windows with a button click (the middle one by default) when in overview mode", + "url": "https://github.com/p91paul/middleclickclose", + "original-authors": [ "Paolo Tranquilli" ], + "locale": "/usr/local/share/locale" +} diff --git a/extensions/middleclickclose/middleclickclose@paolo.tranquilli.gmail.com/prefs.js b/extensions/middleclickclose/middleclickclose@paolo.tranquilli.gmail.com/prefs.js new file mode 100644 index 0000000..c90e8cd --- /dev/null +++ b/extensions/middleclickclose/middleclickclose@paolo.tranquilli.gmail.com/prefs.js @@ -0,0 +1,258 @@ +/* -*- mode: js2; js2-basic-offset: 4; indent-tabs-mode: nil -*- */ +/** + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +**/ +const Gtk = imports.gi.Gtk; +const GObject = imports.gi.GObject; + +const Gettext = imports.gettext.domain('gnome-shell-extensions-middleclickclose'); +const _ = Gettext.gettext; + +const Me = imports.misc.extensionUtils.getCurrentExtension(); +const ExtensionUtils = imports.misc.extensionUtils; + +let gsettings; +let settings; +function init() { + ExtensionUtils.initTranslations(); + gsettings = ExtensionUtils.getSettings(); + settings = { + close_button: { + type: "e", + label: _("Mouse button to close"), + help: _("Which mouse button triggers closing in overview."), + list: [ + { nick: "left", name: _("Left"), id: 0 }, + { nick: "middle", name: _("Middle"), id: 1 }, + { nick: "right", name: _("Right"), id: 2 }, + { nick: "button 4", name: _("Button 4"), id: 3 }, + { nick: "button 5", name: _("Button 5"), id: 4 }, + { nick: "button 6", name: _("Button 6"), id: 5 }, + { nick: "button 7", name: _("Button 7"), id: 6 }, + { nick: "button 8", name: _("Button 8"), id: 7 }, + { nick: "button 9", name: _("Button 9"), id: 8 } + ], + default: 'middle' + }, + rearrange_delay: { + type: "i", + label: _("Rearrange delay"), + help: _("How much time must pass with the pointer not moving for windows in overview to rearrange after one was closed."), + step: 50, + default: 750 + } + }; +} + +function buildPrefsWidget() { + let frame = new Gtk.Box({orientation: Gtk.Orientation.VERTICAL, + 'margin-top': 10, + 'margin-end': 10, + 'margin-bottom': 10, + 'margin-start': 10}); + let vbox = new Gtk.Box({orientation: Gtk.Orientation.VERTICAL, + 'margin-top': 10, + 'margin-end': 20, + 'margin-bottom': 20, + 'margin-start': 20}); + for (setting in settings) { + hbox = buildHbox(settings, setting); + vbox.append(hbox); + } + + frame.append(vbox); + + return frame; +} + + +function buildHbox(settings, setting) { + let hbox; + + if (settings[setting].type == 's') + hbox = createStringSetting(settings, setting); + if (settings[setting].type == "i") + hbox = createIntSetting(settings, setting); + if (settings[setting].type == "b") + hbox = createBoolSetting(settings, setting); + if (settings[setting].type == "r") + hbox = createRangeSetting(settings, setting); + if (settings[setting].type == "e") + hbox = createEnumSetting(settings, setting); + + return hbox; +} + +function createEnumSetting(settings, setting) { + + let hbox = new Gtk.Box({orientation: Gtk.Orientation.HORIZONTAL, + 'margin-top': 5, + spacing: 10}); + + let setting_label = new Gtk.Label({label: settings[setting].label, + xalign: 0 }); + + let model = new Gtk.ListStore(); + model.set_column_types([GObject.TYPE_INT, GObject.TYPE_STRING]); + let setting_enum = new Gtk.ComboBox({model: model}); + setting_enum.get_style_context().add_class('raised'); + let renderer = new Gtk.CellRendererText(); + setting_enum.pack_start(renderer, true); + setting_enum.add_attribute(renderer, 'text', 1); + + for (let i=0; i + + + + + + + + + + + + + + + 'middle' + Which mouse button is used to quick-close + + + 750 + Rearrangement delay after close + Time in milliseconds it take for the scaled windows to rearrange themselves after any type of close action. + + + diff --git a/extensions/middleclickclose/tweak-tool-screenshot.png b/extensions/middleclickclose/tweak-tool-screenshot.png new file mode 100644 index 0000000..995ee94 Binary files /dev/null and b/extensions/middleclickclose/tweak-tool-screenshot.png differ diff --git a/extensions/multi-monitors-add-on.mk b/extensions/multi-monitors-add-on.mk new file mode 100644 index 0000000..e3658ff --- /dev/null +++ b/extensions/multi-monitors-add-on.mk @@ -0,0 +1,57 @@ +# Progress Linux: gnome-shell-extensions-extra + +# Copyright (C) 2010-2023 Daniel Baumann +# +# SPDX-License-Identifier: GPL-3.0+ +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Build-Depends: +# gettext libglib2.0-bin + +SHELL := sh -e + +EXTENSION := multi-monitors-add-on +UUID := $(shell awk -F\" '/"uuid": / { print $$4 }' $(EXTENSION)/*@*/metadata.json) + +all: + +test: + +build: + for TRANSLATION in $(EXTENSION)/$(UUID)/locale/*; \ + do \ + msgfmt -cv -o $${TRANSLATION}/LC_MESSAGES/$(EXTENSION).mo $${TRANSLATION}/LC_MESSAGES/$(EXTENSION).po; \ + done + + glib-compile-schemas --strict --targetdir=$(EXTENSION)/$(UUID)/schemas/ $(EXTENSION)/$(UUID)/schemas + +install: build + mkdir -p $(DESTDIR)/usr/share/gnome-shell/extensions + cp -a $(EXTENSION)/$(UUID) $(DESTDIR)/usr/share/gnome-shell/extensions + +uninstall: + rm -rf $(DESTDIR)/usr/share/gnome-shell/extensions/$(UUID) + rmdir --ignore-fail-on-non-empty --parents $(DESTDIR) || true + +clean: + +distclean: + +reinstall: uninstall install + +upstream: + rm -rf $(EXTENSION) + git clone https://github.com/realh/$(EXTENSION) + rm -rf $(EXTENSION)/.git diff --git a/extensions/multi-monitors-add-on/.project b/extensions/multi-monitors-add-on/.project new file mode 100644 index 0000000..58f94f4 --- /dev/null +++ b/extensions/multi-monitors-add-on/.project @@ -0,0 +1,11 @@ + + + multi-monitors-add-on + + + + + + + + diff --git a/extensions/multi-monitors-add-on/LICENSE b/extensions/multi-monitors-add-on/LICENSE new file mode 100644 index 0000000..d6a9326 --- /dev/null +++ b/extensions/multi-monitors-add-on/LICENSE @@ -0,0 +1,340 @@ +GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + {description} + Copyright (C) {year} {fullname} + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + {signature of Ty Coon}, 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. + diff --git a/extensions/multi-monitors-add-on/README.md b/extensions/multi-monitors-add-on/README.md new file mode 100644 index 0000000..4aaa45a --- /dev/null +++ b/extensions/multi-monitors-add-on/README.md @@ -0,0 +1,33 @@ +Multi Monitors Add-On +===================== + +Extension inspired by https://github.com/darkxst/multiple-monitor-panels +and rewritten from scratch for gnome-shell version 3.10.4. Adds panels +and thumbnails for additional monitors. Settings changes are applied +in dynamic fashion, no restart needed. + +Versions +======== + +* Branch [master](https://github.com/realh/multi-monitors-add-on/tree/master) contains extension for GNOME 42 +* Branch [gnome-3-32_3-36](https://github.com/spin83/multi-monitors-add-on/tree/gnome-3-32_3-36) contains extension for GNOME 3.32, 3.34 and 3.36 +* Branch [gnome-3-24_3-30](https://github.com/spin83/multi-monitors-add-on/tree/gnome-3-24_3-30) contains extension for GNOME 3.24, 3.26, 3.28 and 3.30 +* Branch [gnome-3-20_3-22](https://github.com/spin83/multi-monitors-add-on/tree/gnome-3-20_3-22) contains extension for GNOME 3.20 and 3.22 +* Branch [gnome-3-16_3-18](https://github.com/spin83/multi-monitors-add-on/tree/gnome-3-16_3-18) contains extension for GNOME 3.16 and 3.18 +* Branch [gnome-3-14](https://github.com/spin83/multi-monitors-add-on/tree/gnome-3-14) contains extension for GNOME 3.14 +* Branch [gnome-3-10](https://github.com/spin83/multi-monitors-add-on/tree/gnome-3-10) contains extension for GNOME 3.10 + +Installation from git +===================== + + git clone git://github.com/realh/multi-monitors-add-on.git + cd multi-monitors-add-on + cp -r multi-monitors-add-on@spin83 ~/.local/share/gnome-shell/extensions/ + +Restart the shell and then enable the extension. + +License +======= + +Multi Monitors Add-On extension is distributed under the terms of the +GNU General Public License, version 2 or later. See the LICENSE file for details. diff --git a/extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/convenience.js b/extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/convenience.js new file mode 100644 index 0000000..bbc8608 --- /dev/null +++ b/extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/convenience.js @@ -0,0 +1,93 @@ +/* -*- mode: js; js-basic-offset: 4; indent-tabs-mode: nil -*- */ +/* + Copyright (c) 2011-2012, Giovanni Campagna + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the GNOME nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +const Gettext = imports.gettext; +const Gio = imports.gi.Gio; + +const Config = imports.misc.config; +const ExtensionUtils = imports.misc.extensionUtils; + +/** + * initTranslations: + * @domain: (optional): the gettext domain to use + * + * Initialize Gettext to load translations from extensionsdir/locale. + * If @domain is not provided, it will be taken from metadata['gettext-domain'] + */ +function initTranslations(domain) { + let extension = ExtensionUtils.getCurrentExtension(); + + domain = domain || extension.metadata['gettext-domain']; + + // check if this extension was built with "make zip-file", and thus + // has the locale files in a subfolder + // otherwise assume that extension has been installed in the + // same prefix as gnome-shell + let localeDir = extension.dir.get_child('locale'); + if (localeDir.query_exists(null)) + Gettext.bindtextdomain(domain, localeDir.get_path()); + else + Gettext.bindtextdomain(domain, Config.LOCALEDIR); +} + +/** + * getSettings: + * @schema: (optional): the GSettings schema id + * + * Builds and return a GSettings schema for @schema, using schema files + * in extensionsdir/schemas. If @schema is not provided, it is taken from + * metadata['settings-schema']. + */ +function getSettings(schema) { + let extension = ExtensionUtils.getCurrentExtension(); + + schema = schema || extension.metadata['settings-schema']; + + const GioSSS = Gio.SettingsSchemaSource; + + // check if this extension was built with "make zip-file", and thus + // has the schema files in a subfolder + // otherwise assume that extension has been installed in the + // same prefix as gnome-shell (and therefore schemas are available + // in the standard folders) + let schemaDir = extension.dir.get_child('schemas'); + let schemaSource; + if (schemaDir.query_exists(null)) + schemaSource = GioSSS.new_from_directory(schemaDir.get_path(), + GioSSS.get_default(), + false); + else + schemaSource = GioSSS.get_default(); + + let schemaObj = schemaSource.lookup(schema, true); + if (!schemaObj) + throw new Error('Schema ' + schema + ' could not be found for extension ' + + extension.metadata.uuid + '. Please check your installation.'); + + return new Gio.Settings({ settings_schema: schemaObj }); +} + diff --git a/extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/extension.js b/extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/extension.js new file mode 100644 index 0000000..092d828 --- /dev/null +++ b/extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/extension.js @@ -0,0 +1,289 @@ +/* +Copyright (C) 2014 spin83 + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, visit https://www.gnu.org/licenses/. +*/ + +const { Clutter, Gio } = imports.gi; + +const Main = imports.ui.main; +var { ANIMATION_TIME } = imports.ui.overview; + +const Config = imports.misc.config; +const GNOME_SHELL_VERSION = Config.PACKAGE_VERSION.split('.'); + +const ExtensionUtils = imports.misc.extensionUtils; +const MultiMonitors = ExtensionUtils.getCurrentExtension(); +const Convenience = MultiMonitors.imports.convenience; + +const MMLayout = MultiMonitors.imports.mmlayout; +const MMOverview = MultiMonitors.imports.mmoverview; +const MMIndicator = MultiMonitors.imports.indicator; + +const OVERRIDE_SCHEMA = 'org.gnome.shell.overrides'; +const MUTTER_SCHEMA = 'org.gnome.mutter'; +const WORKSPACES_ONLY_ON_PRIMARY_ID = 'workspaces-only-on-primary'; + +const SHOW_INDICATOR_ID = 'show-indicator'; +const THUMBNAILS_SLIDER_POSITION_ID = 'thumbnails-slider-position'; + +function copyClass (s, d) { +// global.log(s.name +" > "+ d.name); + if (!s) throw Error(`copyClass s undefined for d ${d.name}`) + let propertyNames = Reflect.ownKeys(s.prototype); + for (let pName of propertyNames.values()) { + +// global.log(" ) "+pName.toString()); + if (typeof pName === "symbol") continue; + if (d.prototype.hasOwnProperty(pName)) continue; + if (pName === "prototype") continue; + if (pName === "constructor") continue; +// global.log(pName); + let pDesc = Reflect.getOwnPropertyDescriptor(s.prototype, pName); +// global.log(typeof pDesc); + if (typeof pDesc !== 'object') continue; + Reflect.defineProperty(d.prototype, pName, pDesc); + } +}; + +function gnomeShellVersion() { + return GNOME_SHELL_VERSION; +} + +class MultiMonitorsAddOn { + + constructor() { + this._settings = Convenience.getSettings(); + this._ov_settings = new Gio.Settings({ schema: OVERRIDE_SCHEMA }); + this._mu_settings = new Gio.Settings({ schema: MUTTER_SCHEMA }); + + this.mmIndicator = null; + Main.mmOverview = null; + Main.mmLayoutManager = null; + + this._mmMonitors = 0; + this.syncWorkspacesActualGeometry = null; + } + + _showIndicator() { + if(this._settings.get_boolean(SHOW_INDICATOR_ID)) { + if(!this.mmIndicator) { + this.mmIndicator = Main.panel.addToStatusArea('MultiMonitorsAddOn', new MMIndicator.MultiMonitorsIndicator()); + } + } + else { + this._hideIndicator(); + } + } + + _hideIndicator() { + if(this.mmIndicator) { + this.mmIndicator.destroy(); + this.mmIndicator = null; + } + } + + _showThumbnailsSlider() { + if (this._settings.get_string(THUMBNAILS_SLIDER_POSITION_ID) === 'none') { + this._hideThumbnailsSlider(); + return; + } + + if(this._ov_settings.get_boolean(WORKSPACES_ONLY_ON_PRIMARY_ID)) + this._ov_settings.set_boolean(WORKSPACES_ONLY_ON_PRIMARY_ID, false); + if(this._mu_settings.get_boolean(WORKSPACES_ONLY_ON_PRIMARY_ID)) + this._mu_settings.set_boolean(WORKSPACES_ONLY_ON_PRIMARY_ID, false); + + if (Main.mmOverview) + return; + + Main.mmOverview = []; + for (let idx = 0; idx < Main.layoutManager.monitors.length; idx++) { + if (idx != Main.layoutManager.primaryIndex) { + Main.mmOverview[idx] = new MMOverview.MultiMonitorsOverview(idx); + } + } + + this.syncWorkspacesActualGeometry = Main.overview.searchController._workspacesDisplay._syncWorkspacesActualGeometry; + Main.overview.searchController._workspacesDisplay._syncWorkspacesActualGeometry = function() { + if (this._inWindowFade) + return; + + const primaryView = this._getPrimaryView(); + if (primaryView) { + primaryView.ease({ + ...this._actualGeometry, + duration: Main.overview.animationInProgress ? ANIMATION_TIME : 0, + mode: Clutter.AnimationMode.EASE_OUT_QUAD, + }); + } + + for (let idx = 0; idx < Main.mmOverview.length; idx++) { + if (!Main.mmOverview[idx]) + continue; + if (!Main.mmOverview[idx]._overview) + continue; + const mmView = Main.mmOverview[idx]._overview._controls._workspacesViews; + if (!mmView) + continue; + + const mmGeometry = Main.mmOverview[idx].getWorkspacesActualGeometry(); + mmView.ease({ + ...mmGeometry, + duration: Main.overview.animationInProgress ? ANIMATION_TIME : 0, + mode: Clutter.AnimationMode.EASE_OUT_QUAD, + }); + } + } + } + + _hideThumbnailsSlider() { + if (!Main.mmOverview) + return; + + for (let idx = 0; idx < Main.mmOverview.length; idx++) { + if (Main.mmOverview[idx]) + Main.mmOverview[idx].destroy(); + } + Main.mmOverview = null; + Main.overview.searchController._workspacesDisplay._syncWorkspacesActualGeometry = this.syncWorkspacesActualGeometry; + } + + _relayout() { + if(this._mmMonitors!=Main.layoutManager.monitors.length){ + this._mmMonitors = Main.layoutManager.monitors.length; + global.log("pi:"+Main.layoutManager.primaryIndex); + for (let i = 0; i < Main.layoutManager.monitors.length; i++) { + let monitor = Main.layoutManager.monitors[i]; + global.log("i:"+i+" x:"+monitor.x+" y:"+monitor.y+" w:"+monitor.width+" h:"+monitor.height); + } + this._hideThumbnailsSlider(); + this._showThumbnailsSlider(); + } + } + + _switchOffThumbnails() { + if (this._ov_settings.get_boolean(WORKSPACES_ONLY_ON_PRIMARY_ID) || this._mu_settings.get_boolean(WORKSPACES_ONLY_ON_PRIMARY_ID)) { + this._settings.set_string(THUMBNAILS_SLIDER_POSITION_ID, 'none'); + } + } + + enable(version) { + global.log("Enable Multi Monitors Add-On ("+version+")...") + + if(Main.panel.statusArea.MultiMonitorsAddOn) + disable(); + + this._mmMonitors = 0; + + this._switchOffThumbnailsOvId = this._ov_settings.connect('changed::'+WORKSPACES_ONLY_ON_PRIMARY_ID, + this._switchOffThumbnails.bind(this)); + this._switchOffThumbnailsMuId = this._mu_settings.connect('changed::'+WORKSPACES_ONLY_ON_PRIMARY_ID, + this._switchOffThumbnails.bind(this)); + + this._showIndicatorId = this._settings.connect('changed::'+SHOW_INDICATOR_ID, this._showIndicator.bind(this)); + this._showIndicator(); + + Main.mmLayoutManager = new MMLayout.MultiMonitorsLayoutManager(); + this._showPanelId = this._settings.connect('changed::'+MMLayout.SHOW_PANEL_ID, Main.mmLayoutManager.showPanel.bind(Main.mmLayoutManager)); + Main.mmLayoutManager.showPanel(); + + this._thumbnailsSliderPositionId = this._settings.connect('changed::'+THUMBNAILS_SLIDER_POSITION_ID, this._showThumbnailsSlider.bind(this)); + this._relayoutId = Main.layoutManager.connect('monitors-changed', this._relayout.bind(this)); + this._relayout(); + } + + disable() { + Main.layoutManager.disconnect(this._relayoutId); + this._ov_settings.disconnect(this._switchOffThumbnailsOvId); + this._mu_settings.disconnect(this._switchOffThumbnailsMuId); + + this._settings.disconnect(this._showPanelId); + this._settings.disconnect(this._thumbnailsSliderPositionId); + this._settings.disconnect(this._showIndicatorId); + + + this._hideIndicator(); + + Main.mmLayoutManager.hidePanel(); + Main.mmLayoutManager = null; + + this._hideThumbnailsSlider(); + this._mmMonitors = 0; + + global.log("Disable Multi Monitors Add-On ...") + } +} + +var multiMonitorsAddOn = null; +var version = null; + +function init() { + Convenience.initTranslations(); + + // fix bug in panel: Destroy function many time added to this same indicator. + Main.panel._ensureIndicator = function(role) { + let indicator = this.statusArea[role]; + if (indicator) { + indicator.container.show(); + return null; + } + else { + let constructor = PANEL_ITEM_IMPLEMENTATIONS[role]; + if (!constructor) { + // This icon is not implemented (this is a bug) + return null; + } + indicator = new constructor(this); + this.statusArea[role] = indicator; + } + return indicator; + }; + + const metaVersion = MultiMonitors.metadata['version']; + if (Number.isFinite(metaVersion)) { + version = 'v'+Math.trunc(metaVersion); + switch(Math.round((metaVersion%1)*10)) { + case 0: + break; + case 1: + version += '+bugfix'; + break; + case 2: + version += '+develop'; + break; + default: + version += '+modified'; + break; + } + } + else + version = metaVersion; +} + +function enable() { + if (multiMonitorsAddOn !== null) + return; + + multiMonitorsAddOn = new MultiMonitorsAddOn(); + multiMonitorsAddOn.enable(version); +} + +function disable() { + if (multiMonitorsAddOn == null) + return; + + multiMonitorsAddOn.disable(); + multiMonitorsAddOn = null; +} diff --git a/extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/icons/multi-monitors-l-symbolic.svg b/extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/icons/multi-monitors-l-symbolic.svg new file mode 100644 index 0000000..6341c21 --- /dev/null +++ b/extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/icons/multi-monitors-l-symbolic.svg @@ -0,0 +1,392 @@ + + + + + + + + image/svg+xml + + Gnome Symbolic Icon Theme + + + + + + + + Gnome Symbolic Icon Theme + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/icons/multi-monitors-r-symbolic.svg b/extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/icons/multi-monitors-r-symbolic.svg new file mode 100644 index 0000000..6bf4651 --- /dev/null +++ b/extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/icons/multi-monitors-r-symbolic.svg @@ -0,0 +1,393 @@ + + + + + + + + image/svg+xml + + Gnome Symbolic Icon Theme + + + + + + + + Gnome Symbolic Icon Theme + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/indicator.js b/extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/indicator.js new file mode 100644 index 0000000..8b500ee --- /dev/null +++ b/extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/indicator.js @@ -0,0 +1,109 @@ +/* +Copyright (C) 2014 spin83 + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, visit https://www.gnu.org/licenses/. +*/ + +const { St, Gio, GLib, GObject } = imports.gi; + +const Util = imports.misc.util; +const Main = imports.ui.main; +const PanelMenu = imports.ui.panelMenu; + +const Gettext = imports.gettext.domain('multi-monitors-add-on'); +const _ = Gettext.gettext; +const CE = imports.misc.extensionUtils.getCurrentExtension(); +const MultiMonitors = CE.imports.extension; +const Convenience = CE.imports.convenience; +const extensionPath = CE.path; + +var MultiMonitorsIndicator = (() => { + let MultiMonitorsIndicator = class MultiMonitorsIndicator extends PanelMenu.Button { + _init() { + super._init(0.0, "MultiMonitorsAddOn", false); + + Convenience.initTranslations(); + + this.text = null; + this._mmStatusIcon = new St.BoxLayout({ style_class: 'multimonitor-status-indicators-box' }); + this._mmStatusIcon.hide(); + this.add_child(this._mmStatusIcon); + this._leftRightIcon = true; + this.menu.addAction(_("Preferences"), this._onPreferences.bind(this)); + this._viewMonitorsId = Main.layoutManager.connect('monitors-changed', this._viewMonitors.bind(this)); + this._viewMonitors(); + } + + _onDestroy() { + Main.layoutManager.disconnect(this._viewMonitorsId); + super._onDestroy(); + } + + _syncIndicatorsVisible() { + this._mmStatusIcon.visible = this._mmStatusIcon.get_children().some(a => a.visible); + } + + _icon_name (icon, iconName) { + icon.set_gicon(Gio.icon_new_for_string(extensionPath+"/icons/"+iconName+".svg")); + } + + _viewMonitors() { + let monitors = this._mmStatusIcon.get_children(); + + let monitorChange = Main.layoutManager.monitors.length - monitors.length; + if(monitorChange>0){ + global.log("Add Monitors ..."); + for(let idx = 0; idx, YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: Multi Monitors Add On Gnome Shell Extension\n" +"Report-Msgid-Bugs-To: https://github.com/spin83/multi-monitors-add-on/" +"issues\n" +"POT-Creation-Date: 2019-10-04 04:44-0300\n" +"PO-Revision-Date: 2015-01-23 22:30+0100\n" +"Last-Translator: Jonatan Zeidler \n" +"Language-Team: German \n" +"Language: de\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 1.5.4\n" +"X-Poedit-SourceCharset: UTF-8\n" + +#: indicator.js:46 +msgid "Preferences" +msgstr "Einstellungen" + +#: indicator.js:115 +msgid "Multi Monitors Add-On" +msgstr "Multimonitor-Erweiterung" + +#: mmoverview.js:642 +msgid "Overview" +msgstr "" + +#. Translators: If there is no suitable word for "Activities" +#. in your language, you can use the word for "Overview". +#: mmpanel.js:333 +msgid "Activities" +msgstr "" + +#: mmpanel.js:414 +msgid "Top Bar" +msgstr "" + +#: prefs.js:62 +msgid "Show Multi Monitors indicator on Top Panel." +msgstr "Multimonitor-Indikator in der oberen Leiste anzeigen" + +#: prefs.js:63 +msgid "Show Panel on additional monitors." +msgstr "Leiste auf zusätzlichen Monitoren anzeigen" + +#: prefs.js:64 +msgid "Show Thumbnails-Slider on additional monitors." +msgstr "Arbeitsflächenübersicht auf zusätzlichen Monitoren anzeigen" + +#: prefs.js:65 +msgid "Show Activities-Button on additional monitors." +msgstr "Aktivitäten-Schaltfläche auf zusätzlichen Monitoren anzeigen" + +#: prefs.js:66 +msgid "Show AppMenu-Button on additional monitors." +msgstr "Anwendungsmenü auf zusätzlichen Monitoren anzeigen" + +#: prefs.js:67 +msgid "Show DateTime-Button on additional monitors." +msgstr "Datum-Zeit auf zusätzlichen Monitoren anzeigen." + +#: prefs.js:71 +msgid "Enable hot corners." +msgstr "" + +#: prefs.js:77 +msgid "A list of indicators for transfer to additional monitors." +msgstr "" +"Eine Liste von Indikatoren, die auf die zusätzlichen Monitore verschoben " +"werden sollen" + +#: prefs.js:124 +msgid "Select indicator" +msgstr "Indikator auswählen" + +#: prefs.js:127 +msgid "Add" +msgstr "Hinzufügen" + +#: prefs.js:141 +msgid "Indicators on Top Panel" +msgstr "Indikatoren in der oberen Leiste" + +#: prefs.js:170 +msgid "Monitor index:" +msgstr "Monitorindex:" + +#~ msgid "Test" +#~ msgstr "Test" diff --git a/extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/locale/es/LC_MESSAGES/multi-monitors-add-on.mo b/extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/locale/es/LC_MESSAGES/multi-monitors-add-on.mo new file mode 100644 index 0000000..0cd6a92 Binary files /dev/null and b/extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/locale/es/LC_MESSAGES/multi-monitors-add-on.mo differ diff --git a/extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/locale/es/LC_MESSAGES/multi-monitors-add-on.po b/extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/locale/es/LC_MESSAGES/multi-monitors-add-on.po new file mode 100644 index 0000000..6c51dca --- /dev/null +++ b/extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/locale/es/LC_MESSAGES/multi-monitors-add-on.po @@ -0,0 +1,91 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# Alonso Lara , 2017. +# +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: https://github.com/spin83/multi-monitors-add-on/" +"issues\n" +"POT-Creation-Date: 2019-10-04 04:44-0300\n" +"PO-Revision-Date: 2017-03-04 23:59+0100\n" +"Last-Translator: Alonso Lara \n" +"Language-Team: Spanish \n" +"Language: es\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: indicator.js:46 +msgid "Preferences" +msgstr "Preferencias" + +#: indicator.js:115 +msgid "Multi Monitors Add-On" +msgstr "Accesorio de monitores múltiples" + +#: mmoverview.js:642 +msgid "Overview" +msgstr "" + +#. Translators: If there is no suitable word for "Activities" +#. in your language, you can use the word for "Overview". +#: mmpanel.js:333 +msgid "Activities" +msgstr "" + +#: mmpanel.js:414 +msgid "Top Bar" +msgstr "" + +#: prefs.js:62 +msgid "Show Multi Monitors indicator on Top Panel." +msgstr "Mostrar indicador de monitores múltiples en el panel." + +#: prefs.js:63 +msgid "Show Panel on additional monitors." +msgstr "Mostrar el panel en monitores adicionales." + +#: prefs.js:64 +msgid "Show Thumbnails-Slider on additional monitors." +msgstr "Mostrar las miniaturas en los monitores adicionales." + +#: prefs.js:65 +msgid "Show Activities-Button on additional monitors." +msgstr "Mostrar las actividades en los monitores adicionales." + +#: prefs.js:66 +msgid "Show AppMenu-Button on additional monitors." +msgstr "Mostrar el menú de aplicaciones en los monitores adicionales." + +#: prefs.js:67 +msgid "Show DateTime-Button on additional monitors." +msgstr "Mostrar la fecha en los monitores adicionales." + +#: prefs.js:71 +msgid "Enable hot corners." +msgstr "" + +#: prefs.js:77 +msgid "A list of indicators for transfer to additional monitors." +msgstr "Un listado de indicadores para transferir a monitores adicionales." + +#: prefs.js:124 +msgid "Select indicator" +msgstr "Seleccione indicador" + +#: prefs.js:127 +msgid "Add" +msgstr "Añadir" + +#: prefs.js:141 +msgid "Indicators on Top Panel" +msgstr "Indicadores en el panel" + +#: prefs.js:170 +msgid "Monitor index:" +msgstr "Monitor número:" + +#~ msgid "Test" +#~ msgstr "Prueba" diff --git a/extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/locale/fr/LC_MESSAGES/multi-monitors-add-on.mo b/extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/locale/fr/LC_MESSAGES/multi-monitors-add-on.mo new file mode 100644 index 0000000..2aefbb2 Binary files /dev/null and b/extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/locale/fr/LC_MESSAGES/multi-monitors-add-on.mo differ diff --git a/extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/locale/fr/LC_MESSAGES/multi-monitors-add-on.po b/extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/locale/fr/LC_MESSAGES/multi-monitors-add-on.po new file mode 100644 index 0000000..3b207cc --- /dev/null +++ b/extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/locale/fr/LC_MESSAGES/multi-monitors-add-on.po @@ -0,0 +1,94 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: Multi Monitors Add On Gnome Shell Extension\n" +"Report-Msgid-Bugs-To: https://github.com/spin83/multi-monitors-add-on/" +"issues\n" +"POT-Creation-Date: 2019-10-04 04:44-0300\n" +"PO-Revision-Date: 2015-12-26 22:30+0100\n" +"Last-Translator: Quentin Daem\n" +"Language-Team: Language: fr_FR\n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 1.5.4\n" +"X-Poedit-SourceCharset: UTF-8\n" + +#: indicator.js:46 +msgid "Preferences" +msgstr "Préférences" + +#: indicator.js:115 +msgid "Multi Monitors Add-On" +msgstr "Multi Moniteurs Add-On" + +#: mmoverview.js:642 +msgid "Overview" +msgstr "" + +#. Translators: If there is no suitable word for "Activities" +#. in your language, you can use the word for "Overview". +#: mmpanel.js:333 +msgid "Activities" +msgstr "" + +#: mmpanel.js:414 +msgid "Top Bar" +msgstr "" + +#: prefs.js:62 +msgid "Show Multi Monitors indicator on Top Panel." +msgstr "Afficher l'icone Multi Moniteurs sur la barre du haut" + +#: prefs.js:63 +msgid "Show Panel on additional monitors." +msgstr "Afficher Menu sur les moniteurs secondaires" + +#: prefs.js:64 +msgid "Show Thumbnails-Slider on additional monitors." +msgstr "" +"Afficher le dock listant les espaces de travail sur les moniteurs secondaires" + +#: prefs.js:65 +msgid "Show Activities-Button on additional monitors." +msgstr "Afficher le bouton Activités sur les moniteurs secondaires" + +#: prefs.js:66 +msgid "Show AppMenu-Button on additional monitors." +msgstr "Afficher le bouton du menu Applications sur les moniteurs secondaires" + +#: prefs.js:67 +msgid "Show DateTime-Button on additional monitors." +msgstr "Afficher le bouton Date-Heure sur les moniteurs secondaires." + +#: prefs.js:71 +msgid "Enable hot corners." +msgstr "" + +#: prefs.js:77 +msgid "A list of indicators for transfer to additional monitors." +msgstr "Une liste d'indicateurs pour transfert vers les moniteurs secondaires " + +#: prefs.js:124 +msgid "Select indicator" +msgstr "Selectionner indicateur" + +#: prefs.js:127 +msgid "Add" +msgstr "Ajouter" + +#: prefs.js:141 +msgid "Indicators on Top Panel" +msgstr "Indicateur dans le panneau du haut" + +#: prefs.js:170 +msgid "Monitor index:" +msgstr "Index moniteur:" + +#~ msgid "Test" +#~ msgstr "Test" diff --git a/extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/locale/it/LC_MESSAGES/multi-monitors-add-on.mo b/extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/locale/it/LC_MESSAGES/multi-monitors-add-on.mo new file mode 100644 index 0000000..14040b3 Binary files /dev/null and b/extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/locale/it/LC_MESSAGES/multi-monitors-add-on.mo differ diff --git a/extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/locale/it/LC_MESSAGES/multi-monitors-add-on.po b/extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/locale/it/LC_MESSAGES/multi-monitors-add-on.po new file mode 100644 index 0000000..fd41a90 --- /dev/null +++ b/extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/locale/it/LC_MESSAGES/multi-monitors-add-on.po @@ -0,0 +1,93 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: Multi Monitors Add On Gnome Shell Extension\n" +"Report-Msgid-Bugs-To: https://github.com/spin83/multi-monitors-add-on/" +"issues\n" +"POT-Creation-Date: 2019-10-04 04:44-0300\n" +"PO-Revision-Date: 2019-10-21 14:53+0200\n" +"Last-Translator: Luca Bandini (@Vombato) \n" +"Language-Team: ItalianLanguage: it\n" +"Language: it\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 2.2.4\n" +"X-Poedit-SourceCharset: UTF-8\n" + +#: indicator.js:46 +msgid "Preferences" +msgstr "Preferenze" + +#: indicator.js:115 +msgid "Multi Monitors Add-On" +msgstr "Componente aggiuntivo per più monitor" + +#: mmoverview.js:642 +msgid "Overview" +msgstr "Panoramica" + +#. Translators: If there is no suitable word for "Activities" +#. in your language, you can use the word for "Overview". +#: mmpanel.js:333 +msgid "Activities" +msgstr "Attività" + +#: mmpanel.js:414 +msgid "Top Bar" +msgstr "Barra Superiore" + +#: prefs.js:62 +msgid "Show Multi Monitors indicator on Top Panel." +msgstr "Mostra l'icona Multi Monitor sul pannello superiore." + +#: prefs.js:63 +msgid "Show Panel on additional monitors." +msgstr "Mostra Menu su monitor secondari." + +#: prefs.js:64 +msgid "Show Thumbnails-Slider on additional monitors." +msgstr "Visualizza le aree di lavoro sui monitor secondari." + +#: prefs.js:65 +msgid "Show Activities-Button on additional monitors." +msgstr "Mostra il Bottone Attività sui monitor secondari." + +#: prefs.js:66 +msgid "Show AppMenu-Button on additional monitors." +msgstr "Visualizza il pulsante del menu Applicazioni sui monitor secondari." + +#: prefs.js:67 +msgid "Show DateTime-Button on additional monitors." +msgstr "Mostra il Bottone Data/Ora sui monitor secondari." + +#: prefs.js:71 +msgid "Enable hot corners." +msgstr "" + +#: prefs.js:77 +msgid "A list of indicators for transfer to additional monitors." +msgstr "Un elenco di indicatori per il trasferimento a monitor secondari." + +#: prefs.js:124 +msgid "Select indicator" +msgstr "Seleziona indicatore" + +#: prefs.js:127 +msgid "Add" +msgstr "Aggiungere" + +#: prefs.js:141 +msgid "Indicators on Top Panel" +msgstr "Indicatore nel pannello superiore" + +#: prefs.js:170 +msgid "Monitor index:" +msgstr "Indice monitor:" + +#~ msgid "Test" +#~ msgstr "Test" diff --git a/extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/locale/pl/LC_MESSAGES/multi-monitors-add-on.mo b/extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/locale/pl/LC_MESSAGES/multi-monitors-add-on.mo new file mode 100644 index 0000000..84f0f8e Binary files /dev/null and b/extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/locale/pl/LC_MESSAGES/multi-monitors-add-on.mo differ diff --git a/extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/locale/pl/LC_MESSAGES/multi-monitors-add-on.po b/extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/locale/pl/LC_MESSAGES/multi-monitors-add-on.po new file mode 100644 index 0000000..80116d8 --- /dev/null +++ b/extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/locale/pl/LC_MESSAGES/multi-monitors-add-on.po @@ -0,0 +1,94 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: \n" +"Report-Msgid-Bugs-To: https://github.com/spin83/multi-monitors-add-on/" +"issues\n" +"POT-Creation-Date: 2019-10-04 04:44-0300\n" +"PO-Revision-Date: 2016-12-29 14:25+0100\n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: pl_PL\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 1.8.11\n" +"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 " +"|| n%100>=20) ? 1 : 2);\n" + +#: indicator.js:46 +msgid "Preferences" +msgstr "Ustawienia" + +#: indicator.js:115 +msgid "Multi Monitors Add-On" +msgstr "Multi Monitors Add-On" + +#: mmoverview.js:642 +msgid "Overview" +msgstr "" + +#. Translators: If there is no suitable word for "Activities" +#. in your language, you can use the word for "Overview". +#: mmpanel.js:333 +msgid "Activities" +msgstr "" + +#: mmpanel.js:414 +msgid "Top Bar" +msgstr "" + +#: prefs.js:62 +msgid "Show Multi Monitors indicator on Top Panel." +msgstr "Wyświetl wskaźnik rozszerzenia na głównym pasku." + +#: prefs.js:63 +msgid "Show Panel on additional monitors." +msgstr "Wyświetl główny pasek na dodatkowych monitorach." + +#: prefs.js:64 +msgid "Show Thumbnails-Slider on additional monitors." +msgstr "Wyświetl pasek miniatur na dodatkowych monitorach." + +#: prefs.js:65 +msgid "Show Activities-Button on additional monitors." +msgstr "Wyświetl przycisk podglądu na dodatkowych monitorach." + +#: prefs.js:66 +msgid "Show AppMenu-Button on additional monitors." +msgstr "Wyświetl przycisk aplikacji na dodatkowych monitorach." + +#: prefs.js:67 +msgid "Show DateTime-Button on additional monitors." +msgstr "Wyświetl przycisk daty i czasu na dodatkowych monitorach." + +#: prefs.js:71 +msgid "Enable hot corners." +msgstr "Włączenie podglądu po najechaniu rogu ekranu." + +#: prefs.js:77 +msgid "A list of indicators for transfer to additional monitors." +msgstr "Lista wskaźników do przesunięcia na dodatkowe monitory." + +#: prefs.js:124 +msgid "Select indicator" +msgstr "Wybierz wskaźnik" + +#: prefs.js:127 +msgid "Add" +msgstr "Dodaj" + +#: prefs.js:141 +msgid "Indicators on Top Panel" +msgstr "Wskaźniki na głównym panelu" + +#: prefs.js:170 +msgid "Monitor index:" +msgstr "Indeks monitora:" + +#~ msgid "Test" +#~ msgstr "Test" diff --git a/extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/locale/pt_BR/LC_MESSAGES/multi-monitors-add-on.mo b/extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/locale/pt_BR/LC_MESSAGES/multi-monitors-add-on.mo new file mode 100644 index 0000000..beae2e9 Binary files /dev/null and b/extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/locale/pt_BR/LC_MESSAGES/multi-monitors-add-on.mo differ diff --git a/extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/locale/pt_BR/LC_MESSAGES/multi-monitors-add-on.po b/extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/locale/pt_BR/LC_MESSAGES/multi-monitors-add-on.po new file mode 100644 index 0000000..94c370c --- /dev/null +++ b/extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/locale/pt_BR/LC_MESSAGES/multi-monitors-add-on.po @@ -0,0 +1,89 @@ +# Brazilian Portuguese translation for multi-monitors-add-on +# Copyright (C) 2019 THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the multi-monitors-add-on package. +# Rafael Fontenelle , 2019. +# +msgid "" +msgstr "" +"Project-Id-Version: Multi Monitors Add On Gnome Shell Extension\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-01-23 22:29+0100\n" +"PO-Revision-Date: 2019-10-03 06:49-0300\n" +"Last-Translator: Rafael Fontenelle \n" +"Language-Team: Brazilian Portuguese \n" +"Language: pt_BR\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n > 1)\n" +"X-Generator: Gtranslator 3.32.0\n" +"X-Project-Style: gnome\n" + +#: prefs.js:61 +msgid "Show Multi Monitors indicator on Top Panel." +msgstr "Mostrar o indicador do Multi Monitors no painel superior" + +#: prefs.js:62 +msgid "Show Panel on additional monitors." +msgstr "Mostrar o painel em monitores adicionais" + +#: prefs.js:63 +msgid "Show Thumbnails-Slider on additional monitors." +msgstr "Mostrar controle deslizante de miniaturas em monitores adicionais" + +#: prefs.js:64 +msgid "Show Activities-Button on additional monitors." +msgstr "Mostrar botão de Atividades em monitores adicionais" + +#: prefs.js:65 +msgid "Show AppMenu-Button on additional monitors." +msgstr "Mostrar botão de menu de aplicativos em monitores adicionais" + +#: prefs.js:67 +msgid "Show DateTime-Button on additional monitors." +msgstr "Mostrar o botão de data e hora em monitores adicionais" + +#: prefs.js:75 +msgid "A list of indicators for transfer to additional monitors." +msgstr "Uma lista de indicadores para transferir para monitores adicionais." + +#: prefs.js:71 +msgid "Enable hot corners." +msgstr "" + +#: prefs.js:122 +msgid "Select indicator" +msgstr "Selecionar indicador" + +#: prefs.js:125 +msgid "Add" +msgstr "Adicionar" + +#: prefs.js:139 +msgid "Indicators on Top Panel" +msgstr "Indicadores no painel superior" + +#: prefs.js:168 +msgid "Monitor index:" +msgstr "Índice do monitor:" + +#: indicator.js:106 +msgid "Preferences" +msgstr "Preferências" + +#: indicator.js:107 +msgid "Test" +msgstr "Testar" + +#: indicator.js:129 +msgid "Multi Monitors Add-On" +msgstr "Multi Monitors Add-On" + +#~ msgid "Overview" +#~ msgstr "Panorama" + +#~ msgid "Activities" +#~ msgstr "Atividades" + +#~ msgid "Top Bar" +#~ msgstr "Barra superior" diff --git a/extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/metadata.json b/extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/metadata.json new file mode 100644 index 0000000..68b1295 --- /dev/null +++ b/extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/metadata.json @@ -0,0 +1,10 @@ +{ + "shell-version": ["40", "41", "42", "43"], + "uuid": "multi-monitors-add-on@spin83", + "name": "Multi Monitors Add-On", + "settings-schema": "org.gnome.shell.extensions.multi-monitors-add-on", + "gettext-domain": "multi-monitors-add-on", + "description": "Add multiple monitors overview and panel for gnome-shell.", + "url": "https://github.com/spin83/multi-monitors-add-on.git", + "version": 25 +} diff --git a/extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/mmcalendar.js b/extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/mmcalendar.js new file mode 100644 index 0000000..66237f4 --- /dev/null +++ b/extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/mmcalendar.js @@ -0,0 +1,412 @@ +/* +Copyright (C) 2014 spin83 + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, visit https://www.gnu.org/licenses/. +*/ + +const Signals = imports.signals; + +const { St, Gio, Shell, Clutter, GnomeDesktop, Pango, GObject, GLib } = imports.gi; + +const Main = imports.ui.main; +const PanelMenu = imports.ui.panelMenu; +const MessageList = imports.ui.messageList; +const DateMenu = imports.ui.dateMenu; +const Calendar = imports.ui.calendar; +const PopupMenu = imports.ui.popupMenu; + +const ExtensionUtils = imports.misc.extensionUtils; +const CE = ExtensionUtils.getCurrentExtension(); +const MultiMonitors = CE.imports.extension; +const Convenience = CE.imports.convenience; + +// Calendar.DoNotDisturbSwitch is const, so not exported. Either +// is untrue, or +// GObject.type_from_name() is broken, so we can't get its constructor via GI +// either. Luckily it's a short class, so we can copy & paste. +const MultiMonitorsDoNotDisturbSwitch = GObject.registerClass( +class MultiMonitorsDoNotDisturbSwitch extends PopupMenu.Switch { + _init() { + this._settings = new Gio.Settings({ + schema_id: 'org.gnome.desktop.notifications', + }); + + super._init(this._settings.get_boolean('show-banners')); + + this._settings.bind('show-banners', + this, 'state', + Gio.SettingsBindFlags.INVERT_BOOLEAN); + + this.connect('destroy', () => { + this._settings.run_dispose(); + this._settings = null; + }); + } +}); + +var MultiMonitorsCalendar = (() => { + let MultiMonitorsCalendar = class MultiMonitorsCalendar extends St.Widget { + _init () { + this._weekStart = Shell.util_get_week_start(); + this._settings = new Gio.Settings({ schema_id: 'org.gnome.desktop.calendar' }); + + this._showWeekdateKeyId = this._settings.connect('changed::%s'.format(Calendar.SHOW_WEEKDATE_KEY), this._onSettingsChange.bind(this)); + this._useWeekdate = this._settings.get_boolean(Calendar.SHOW_WEEKDATE_KEY); + + this._headerFormatWithoutYear = _('%OB'); + this._headerFormat = _('%OB %Y'); + + // Start off with the current date + this._selectedDate = new Date(); + + this._shouldDateGrabFocus = false; + + super._init({ + style_class: 'calendar', + layout_manager: new Clutter.GridLayout(), + reactive: true, + }); + + this._buildHeader(); + this.connect('destroy', this._onDestroy.bind(this)); + } + + _onDestroy() { + this._settings.disconnect(this._showWeekdateKeyId); + } + }; + MultiMonitors.copyClass(Calendar.Calendar, MultiMonitorsCalendar); + return GObject.registerClass({ + Signals: { 'selected-date-changed': { param_types: [GLib.DateTime.$gtype] } }, + }, MultiMonitorsCalendar); +})(); + +var MultiMonitorsEventsSection = (() => { + let MultiMonitorsEventsSection = class MultiMonitorsEventsSection extends St.Button { + _init() { + super._init({ + style_class: 'events-button', + can_focus: true, + x_expand: true, + child: new St.BoxLayout({ + style_class: 'events-box', + vertical: true, + x_expand: true, + }), + }); + + this._startDate = null; + this._endDate = null; + + this._eventSource = null; + this._calendarApp = null; + + this._title = new St.Label({ + style_class: 'events-title', + }); + this.child.add_child(this._title); + + this._eventsList = new St.BoxLayout({ + style_class: 'events-list', + vertical: true, + x_expand: true, + }); + this.child.add_child(this._eventsList); + + this._appSys = Shell.AppSystem.get_default(); + this._appInstalledChangedId = this._appSys.connect('installed-changed', + this._appInstalledChanged.bind(this)); + this._appInstalledChanged(); + + this.connect('destroy', this._onDestroy.bind(this)); + this._appInstalledChanged(); + } + + _onDestroy() { + this._appSys.disconnect(this._appInstalledChangedId); + }}; + + MultiMonitors.copyClass(DateMenu.EventsSection, MultiMonitorsEventsSection); + return GObject.registerClass(MultiMonitorsEventsSection); +})(); + +var MultiMonitorsNotificationSection = (() => { + let MultiMonitorsNotificationSection = class MultiMonitorsNotificationSection extends MessageList.MessageListSection { + _init() { + super._init(); + + this._sources = new Map(); + this._nUrgent = 0; + + this._sourceAddedId = Main.messageTray.connect('source-added', this._sourceAdded.bind(this)); + Main.messageTray.getSources().forEach(source => { + this._sourceAdded(Main.messageTray, source); + }); + + this.connect('destroy', this._onDestroy.bind(this)); + } + + _onDestroy() { + Main.messageTray.disconnect(this._sourceAddedId); + let source, obj; + for ([source, obj] of this._sources.entries()) { + this._onSourceDestroy(source, obj); + } + }}; + + MultiMonitors.copyClass(Calendar.NotificationSection, MultiMonitorsNotificationSection); + return GObject.registerClass(MultiMonitorsNotificationSection); +})(); + +var MultiMonitorsCalendarMessageList = (() => { + let MultiMonitorsCalendarMessageList = class MultiMonitorsCalendarMessageList extends St.Widget { + _init() { + super._init({ + style_class: 'message-list', + layout_manager: new Clutter.BinLayout(), + x_expand: true, + y_expand: true, + }); + + this._sessionModeUpdatedId = 0; + + this._placeholder = new Calendar.Placeholder(); + this.add_actor(this._placeholder); + + let box = new St.BoxLayout({ vertical: true, + x_expand: true, y_expand: true }); + this.add_actor(box); + + this._scrollView = new St.ScrollView({ + style_class: 'vfade', + overlay_scrollbars: true, + x_expand: true, y_expand: true, + }); + this._scrollView.set_policy(St.PolicyType.NEVER, St.PolicyType.AUTOMATIC); + box.add_actor(this._scrollView); + + let hbox = new St.BoxLayout({ style_class: 'message-list-controls' }); + box.add_child(hbox); + + const dndLabel = new St.Label({ + text: _('Do Not Disturb'), + y_align: Clutter.ActorAlign.CENTER, + }); + hbox.add_child(dndLabel); + + this._dndSwitch = new MultiMonitorsDoNotDisturbSwitch(); + this._dndButton = new St.Button({ + can_focus: true, + toggle_mode: true, + child: this._dndSwitch, + label_actor: dndLabel, + }); + + this._dndSwitch.bind_property('state', + this._dndButton, 'checked', + GObject.BindingFlags.BIDIRECTIONAL | GObject.BindingFlags.SYNC_CREATE); + + hbox.add_child(this._dndButton); + + this._clearButton = new St.Button({ + style_class: 'message-list-clear-button button', + label: _('Clear'), + can_focus: true, + x_expand: true, + x_align: Clutter.ActorAlign.END, + }); + this._clearButton.connect('clicked', () => { + this._sectionList.get_children().forEach(s => s.clear()); + }); + hbox.add_actor(this._clearButton); + + this._placeholder.bind_property('visible', + this._clearButton, 'visible', + GObject.BindingFlags.INVERT_BOOLEAN); + + this._sectionList = new St.BoxLayout({ style_class: 'message-list-sections', + vertical: true, + x_expand: true, + y_expand: true, + y_align: Clutter.ActorAlign.START }); + this._sectionList.connect('actor-added', this._sync.bind(this)); + this._sectionList.connect('actor-removed', this._sync.bind(this)); + this._scrollView.add_actor(this._sectionList); + + this._notificationSection = new MultiMonitorsNotificationSection(); + this._addSection(this._notificationSection); + + this._sessionModeUpdatedId = Main.sessionMode.connect('updated', this._sync.bind(this)); + this.connect('destroy', this._onDestroy.bind(this)); + } + + _onDestroy() { + Main.sessionMode.disconnect(this._sessionModeUpdatedId); + this._sessionModeUpdatedId = 0; + } + + _sync() { + if (this._sessionModeUpdatedId === 0) return; + Calendar.CalendarMessageList.prototype._sync.call(this); + }}; + + MultiMonitors.copyClass(Calendar.CalendarMessageList, MultiMonitorsCalendarMessageList); + return GObject.registerClass(MultiMonitorsCalendarMessageList); +})(); + +var MultiMonitorsMessagesIndicator = (() => { + let MultiMonitorsMessagesIndicator = class MultiMonitorsMessagesIndicator extends St.Icon { + _init() { + super._init({ + icon_size: 16, + visible: false, + y_expand: true, + y_align: Clutter.ActorAlign.CENTER, + }); + + this._sources = []; + this._count = 0; + + this._settings = new Gio.Settings({ + schema_id: 'org.gnome.desktop.notifications', + }); + this._settings.connect('changed::show-banners', this._sync.bind(this)); + + this._sourceAddedId = Main.messageTray.connect('source-added', this._onSourceAdded.bind(this)); + this._sourceRemovedId = Main.messageTray.connect('source-removed', this._onSourceRemoved.bind(this)); + this._queueChangedId = Main.messageTray.connect('queue-changed', this._updateCount.bind(this)); + + let sources = Main.messageTray.getSources(); + sources.forEach(source => this._onSourceAdded(null, source)); + + this._sync(); + + this.connect('destroy', () => { + this._settings.run_dispose(); + this._settings = null; + Main.messageTray.disconnect(this._sourceAddedId); + Main.messageTray.disconnect(this._sourceRemovedId); + Main.messageTray.disconnect(this._queueChangedId); + }); + }}; + + MultiMonitors.copyClass(DateMenu.MessagesIndicator, MultiMonitorsMessagesIndicator); + return GObject.registerClass(MultiMonitorsMessagesIndicator); +})(); + +var MultiMonitorsDateMenuButton = (() => { + let MultiMonitorsDateMenuButton = class MultiMonitorsDateMenuButton extends PanelMenu.Button { + _init() { + let hbox; + let vbox; + + super._init(0.5); + + this._clockDisplay = new St.Label({ style_class: 'clock' }); + this._clockDisplay.clutter_text.y_align = Clutter.ActorAlign.CENTER; + this._clockDisplay.clutter_text.ellipsize = Pango.EllipsizeMode.NONE; + + this._indicator = new MultiMonitorsMessagesIndicator(); + + const indicatorPad = new St.Widget(); + this._indicator.bind_property('visible', + indicatorPad, 'visible', + GObject.BindingFlags.SYNC_CREATE); + indicatorPad.add_constraint(new Clutter.BindConstraint({ + source: this._indicator, + coordinate: Clutter.BindCoordinate.SIZE, + })); + + let box = new St.BoxLayout({ style_class: 'clock-display-box' }); + box.add_actor(indicatorPad); + box.add_actor(this._clockDisplay); + box.add_actor(this._indicator); + + this.label_actor = this._clockDisplay; + this.add_actor(box); + this.add_style_class_name('clock-display'); + + let layout = new DateMenu.FreezableBinLayout(); + let bin = new St.Widget({ layout_manager: layout }); + // For some minimal compatibility with PopupMenuItem + bin._delegate = this; + this.menu.box.add_child(bin); + + hbox = new St.BoxLayout({ name: 'calendarArea' }); + bin.add_actor(hbox); + + this._calendar = new MultiMonitorsCalendar(); + this._calendar.connect('selected-date-changed', (_calendar, datetime) => { + let date = DateMenu._gDateTimeToDate(datetime); + layout.frozen = !DateMenu._isToday(date); + this._eventsItem.setDate(date); + }); + this._date = new DateMenu.TodayButton(this._calendar); + + this.menu.connect('open-state-changed', (menu, isOpen) => { + // Whenever the menu is opened, select today + if (isOpen) { + let now = new Date(); + this._calendar.setDate(now); + this._date.setDate(now); + this._eventsItem.setDate(now); + } + }); + + // Fill up the first column + this._messageList = new MultiMonitorsCalendarMessageList(); + hbox.add_child(this._messageList); + + // Fill up the second column + const boxLayout = new DateMenu.CalendarColumnLayout([this._calendar, this._date]); + vbox = new St.Widget({ style_class: 'datemenu-calendar-column', + layout_manager: boxLayout }); + boxLayout.hookup_style(vbox); + hbox.add(vbox); + + vbox.add_actor(this._date); + vbox.add_actor(this._calendar); + + this._displaysSection = new St.ScrollView({ style_class: 'datemenu-displays-section vfade', + x_expand: true, + overlay_scrollbars: true }); + this._displaysSection.set_policy(St.PolicyType.NEVER, St.PolicyType.EXTERNAL); + vbox.add_actor(this._displaysSection); + + let displaysBox = new St.BoxLayout({ vertical: true, + x_expand: true, + style_class: 'datemenu-displays-box' }); + this._displaysSection.add_actor(displaysBox); + + this._eventsItem = new MultiMonitorsEventsSection(); + displaysBox.add_child(this._eventsItem); + + this._clock = new GnomeDesktop.WallClock(); + this._clock.bind_property('clock', this._clockDisplay, 'text', GObject.BindingFlags.SYNC_CREATE); + this._clockNotifyTimezoneId = this._clock.connect('notify::timezone', this._updateTimeZone.bind(this)); + + this._sessionModeUpdatedId = Main.sessionMode.connect('updated', this._sessionUpdated.bind(this)); + this._sessionUpdated(); + } + + _onDestroy() { + Main.sessionMode.disconnect(this._sessionModeUpdatedId); + this._clock.disconnect(this._clockNotifyTimezoneId); + super._onDestroy(); + }}; + + MultiMonitors.copyClass(DateMenu.DateMenuButton, MultiMonitorsDateMenuButton); + return GObject.registerClass(MultiMonitorsDateMenuButton); +})(); + diff --git a/extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/mmlayout.js b/extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/mmlayout.js new file mode 100644 index 0000000..a354ec1 --- /dev/null +++ b/extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/mmlayout.js @@ -0,0 +1,251 @@ +/** + * New node file + */ + +const { St, Meta } = imports.gi; + +const Main = imports.ui.main; +const Panel = imports.ui.panel; +const Layout = imports.ui.layout; + +const Config = imports.misc.config; + +const ExtensionUtils = imports.misc.extensionUtils; +const CE = ExtensionUtils.getCurrentExtension(); +const Convenience = CE.imports.convenience; +const MultiMonitors = CE.imports.extension; +const MMPanel = CE.imports.mmpanel; + +var SHOW_PANEL_ID = 'show-panel'; +var ENABLE_HOT_CORNERS = 'enable-hot-corners'; + +const MultiMonitorsPanelBox = class MultiMonitorsPanelBox { + constructor(monitor) { + this.panelBox = new St.BoxLayout({ name: 'panelBox', vertical: true, clip_to_allocation: true }); + Main.layoutManager.addChrome(this.panelBox, { affectsStruts: true, trackFullscreen: true }); + this.panelBox.set_position(monitor.x, monitor.y); + this.panelBox.set_size(monitor.width, -1); + Main.uiGroup.set_child_below_sibling(this.panelBox, Main.layoutManager.panelBox); + } + + destroy() { + this.panelBox.destroy(); + } + + updatePanel(monitor) { + this.panelBox.set_position(monitor.x, monitor.y); + this.panelBox.set_size(monitor.width, -1); + } +}; + +var MultiMonitorsLayoutManager = class MultiMonitorsLayoutManager { + constructor() { + this._settings = Convenience.getSettings(); + this._desktopSettings = Convenience.getSettings("org.gnome.desktop.interface"); + + Main.mmPanel = []; + + this._monitorIds = []; + this.mmPanelBox = []; + this.mmappMenu = false; + + this._showAppMenuId = null; + this._monitorsChangedId = null; + + this.statusIndicatorsController = null; + this._layoutManager_updateHotCorners = null; + this._changedEnableHotCornersId = null; + } + + showPanel() { + if (this._settings.get_boolean(SHOW_PANEL_ID)) { + if (!this._monitorsChangedId) { + this._monitorsChangedId = Main.layoutManager.connect('monitors-changed', this._monitorsChanged.bind(this)); + this._monitorsChanged(); + } + if (!this._showAppMenuId) { + this._showAppMenuId = this._settings.connect('changed::'+MMPanel.SHOW_APP_MENU_ID, this._showAppMenu.bind(this)); + } + + if (!this.statusIndicatorsController) { + this.statusIndicatorsController = new MMPanel.StatusIndicatorsController(); + } + + if (!this._layoutManager_updateHotCorners) { + this._layoutManager_updateHotCorners = Main.layoutManager._updateHotCorners; + + const _this = this; + Main.layoutManager._updateHotCorners = function() { + this.hotCorners.forEach((corner) => { + if (corner) + corner.destroy(); + }); + this.hotCorners = []; + + if (!_this._desktopSettings.get_boolean(ENABLE_HOT_CORNERS)) { + this.emit('hot-corners-changed'); + return; + } + + let size = this.panelBox.height; + + for (let i = 0; i < this.monitors.length; i++) { + let monitor = this.monitors[i]; + let cornerX = this._rtl ? monitor.x + monitor.width : monitor.x; + let cornerY = monitor.y; + + let corner = new Layout.HotCorner(this, monitor, cornerX, cornerY); + corner.setBarrierSize(size); + this.hotCorners.push(corner); + } + + this.emit('hot-corners-changed'); + }; + + if (!this._changedEnableHotCornersId) { + this._changedEnableHotCornersId = this._desktopSettings.connect('changed::'+ENABLE_HOT_CORNERS, + Main.layoutManager._updateHotCorners.bind(Main.layoutManager)); + } + + Main.layoutManager._updateHotCorners(); + } + } + else { + this.hidePanel(); + } + } + + hidePanel() { + if (this._changedEnableHotCornersId) { + global.settings.disconnect(this._changedEnableHotCornersId); + this._changedEnableHotCornersId = null; + } + + if (this._layoutManager_updateHotCorners) { + Main.layoutManager['_updateHotCorners'] = this._layoutManager_updateHotCorners; + this._layoutManager_updateHotCorners = null; + Main.layoutManager._updateHotCorners(); + } + + if (this.statusIndicatorsController) { + this.statusIndicatorsController.destroy(); + this.statusIndicatorsController = null; + } + + if (this._showAppMenuId) { + this._settings.disconnect(this._showAppMenuId); + this._showAppMenuId = null; + } + this._hideAppMenu(); + + if (this._monitorsChangedId) { + Main.layoutManager.disconnect(this._monitorsChangedId); + this._monitorsChangedId = null; + } + + let panels2remove = this._monitorIds.length; + for (let i = 0; i < panels2remove; i++) { + let monitorId = this._monitorIds.pop(); + this._popPanel(); + global.log("remove: "+monitorId); + } + } + + _monitorsChanged () { + let monitorChange = Main.layoutManager.monitors.length - this._monitorIds.length -1; + if (monitorChange<0) { + for (let idx = 0; idx<-monitorChange; idx++) { + let monitorId = this._monitorIds.pop(); + this._popPanel(); + global.log("remove: "+monitorId); + } + } + + let j = 0; + let tIndicators = false; + for (let i = 0; i < Main.layoutManager.monitors.length; i++) { + if (i!=Main.layoutManager.primaryIndex) { + let monitor = Main.layoutManager.monitors[i]; + let monitorId = "i"+i+"x"+monitor.x+"y"+monitor.y+"w"+monitor.width+"h"+monitor.height; + if (monitorChange>0 && j==this._monitorIds.length) { + this._monitorIds.push(monitorId); + this._pushPanel(i, monitor); + global.log("new: "+monitorId); + tIndicators = true; + } + else if (this._monitorIds[j]>monitorId || this._monitorIds[j]"+monitorId); + } + j++; + } + } + this._showAppMenu(); + if (tIndicators && this.statusIndicatorsController) { + this.statusIndicatorsController.transferIndicators(); + } + } + + _pushPanel(i, monitor) { + let mmPanelBox = new MultiMonitorsPanelBox(monitor); + let panel = new MMPanel.MultiMonitorsPanel(i, mmPanelBox); + + Main.mmPanel.push(panel); + this.mmPanelBox.push(mmPanelBox); + } + + _popPanel() { + let panel = Main.mmPanel.pop(); + if (this.statusIndicatorsController) { + this.statusIndicatorsController.transferBack(panel); + } + let mmPanelBox = this.mmPanelBox.pop(); + mmPanelBox.destroy(); + } + + _changeMainPanelAppMenuButton(appMenuButton) { + let role = "appMenu"; + let panel = Main.panel; + let indicator = panel.statusArea[role]; + panel.menuManager.removeMenu(indicator.menu); + indicator.destroy(); + if (indicator._actionGroupNotifyId) { + indicator._targetApp.disconnect(indicator._actionGroupNotifyId); + indicator._actionGroupNotifyId = 0; + } + if (indicator._busyNotifyId) { + indicator._targetApp.disconnect(indicator._busyNotifyId); + indicator._busyNotifyId = 0; + } + if (indicator.menu._windowsChangedId) { + indicator.menu._app.disconnect(indicator.menu._windowsChangedId); + indicator.menu._windowsChangedId = 0; + } + indicator = new appMenuButton(panel); + panel.statusArea[role] = indicator; + let box = panel._leftBox; + panel._addToPanelBox(role, indicator, box.get_n_children()+1, box); + } + + _showAppMenu() { + if (this._settings.get_boolean(MMPanel.SHOW_APP_MENU_ID) && Main.mmPanel.length>0) { + if (!this.mmappMenu) { + this._changeMainPanelAppMenuButton(MMPanel.MultiMonitorsAppMenuButton); + this.mmappMenu = true; + } + } + else { + this._hideAppMenu(); + } + } + + _hideAppMenu() { + if (this.mmappMenu) { + this._changeMainPanelAppMenuButton(Panel.AppMenuButton); + this.mmappMenu = false; + Main.panel._updatePanel() + } + } +}; diff --git a/extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/mmoverview.js b/extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/mmoverview.js new file mode 100644 index 0000000..b7555d2 --- /dev/null +++ b/extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/mmoverview.js @@ -0,0 +1,678 @@ +/* +Copyright (C) 2014 spin83 + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, visit https://www.gnu.org/licenses/. +*/ + +const { Clutter, GObject, St, Shell, GLib, Gio, Meta } = imports.gi; + +const Main = imports.ui.main; +const Params = imports.misc.params; +const WorkspaceThumbnail = imports.ui.workspaceThumbnail; +const OverviewControls = imports.ui.overviewControls; +const Overview = imports.ui.overview; +const SearchController = imports.ui.searchController; +const LayoutManager = imports.ui.layout; +const Background = imports.ui.background; +const WorkspacesView = imports.ui.workspacesView; + +const ExtensionUtils = imports.misc.extensionUtils; +const CE = ExtensionUtils.getCurrentExtension(); +const MultiMonitors = CE.imports.extension; +const Convenience = CE.imports.convenience; + +const THUMBNAILS_SLIDER_POSITION_ID = 'thumbnails-slider-position'; + +var MultiMonitorsWorkspaceThumbnail = (() => { + let MultiMonitorsWorkspaceThumbnail = class MultiMonitorsWorkspaceThumbnail extends St.Widget { + _init(metaWorkspace, monitorIndex) { + super._init({ + clip_to_allocation: true, + style_class: 'workspace-thumbnail', + }); + this._delegate = this; + + this.metaWorkspace = metaWorkspace; + this.monitorIndex = monitorIndex; + + this._removed = false; + + this._contents = new Clutter.Actor(); + this.add_child(this._contents); + + this.connect('destroy', this._onDestroy.bind(this)); + + this._createBackground(); + + let workArea = Main.layoutManager.getWorkAreaForMonitor(this.monitorIndex); + this.setPorthole(workArea.x, workArea.y, workArea.width, workArea.height); + + let windows = global.get_window_actors().filter(actor => { + let win = actor.meta_window; + return win.located_on_workspace(metaWorkspace); + }); + + // Create clones for windows that should be visible in the Overview + this._windows = []; + this._allWindows = []; + this._minimizedChangedIds = []; + for (let i = 0; i < windows.length; i++) { + let minimizedChangedId = + windows[i].meta_window.connect('notify::minimized', + this._updateMinimized.bind(this)); + this._allWindows.push(windows[i].meta_window); + this._minimizedChangedIds.push(minimizedChangedId); + + if (this._isMyWindow(windows[i]) && this._isOverviewWindow(windows[i])) + this._addWindowClone(windows[i]); + } + + // Track window changes + this._windowAddedId = this.metaWorkspace.connect('window-added', + this._windowAdded.bind(this)); + this._windowRemovedId = this.metaWorkspace.connect('window-removed', + this._windowRemoved.bind(this)); + this._windowEnteredMonitorId = global.display.connect('window-entered-monitor', + this._windowEnteredMonitor.bind(this)); + this._windowLeftMonitorId = global.display.connect('window-left-monitor', + this._windowLeftMonitor.bind(this)); + + this.state = WorkspaceThumbnail.ThumbnailState.NORMAL; + this._slidePosition = 0; // Fully slid in + this._collapseFraction = 0; // Not collapsed + } + + _createBackground() { + this._bgManager = new Background.BackgroundManager({ monitorIndex: this.monitorIndex, + container: this._contents, + vignette: false }); + }}; + + MultiMonitors.copyClass(WorkspaceThumbnail.WorkspaceThumbnail, MultiMonitorsWorkspaceThumbnail); + return GObject.registerClass({ + Properties: { + 'collapse-fraction': GObject.ParamSpec.double( + 'collapse-fraction', 'collapse-fraction', 'collapse-fraction', + GObject.ParamFlags.READWRITE, + 0, 1, 0), + 'slide-position': GObject.ParamSpec.double( + 'slide-position', 'slide-position', 'slide-position', + GObject.ParamFlags.READWRITE, + 0, 1, 0), + }, + }, MultiMonitorsWorkspaceThumbnail); +})(); + +const MultiMonitorsThumbnailsBox = (() => { + let MultiMonitorsThumbnailsBox = class MultiMonitorsThumbnailsBox extends St.Widget { + _init(scrollAdjustment, monitorIndex) { + + super._init({ reactive: true, + style_class: 'workspace-thumbnails', + request_mode: Clutter.RequestMode.WIDTH_FOR_HEIGHT }); + + this._delegate = this; + this._monitorIndex = monitorIndex; + + let indicator = new St.Bin({ style_class: 'workspace-thumbnail-indicator' }); + + // We don't want the indicator to affect drag-and-drop + Shell.util_set_hidden_from_pick(indicator, true); + + this._indicator = indicator; + this.add_actor(indicator); + + // The porthole is the part of the screen we're showing in the thumbnails + this._porthole = { width: global.stage.width, height: global.stage.height, + x: global.stage.x, y: global.stage.y }; + + this._dropWorkspace = -1; + this._dropPlaceholderPos = -1; + this._dropPlaceholder = new St.Bin({ style_class: 'placeholder' }); + this.add_actor(this._dropPlaceholder); + this._spliceIndex = -1; + + this._targetScale = 0; + this._scale = 0; + this._pendingScaleUpdate = false; + this._stateUpdateQueued = false; + this._animatingIndicator = false; + + this._stateCounts = {}; + for (let key in WorkspaceThumbnail.ThumbnailState) + this._stateCounts[WorkspaceThumbnail.ThumbnailState[key]] = 0; + + this._thumbnails = []; + + this._showingId = Main.overview.connect('showing', + this._createThumbnails.bind(this)); + this._hiddenId = Main.overview.connect('hidden', + this._destroyThumbnails.bind(this)); + + this._itemDragBeginId = Main.overview.connect('item-drag-begin', + this._onDragBegin.bind(this)); + this._itemDragEndId = Main.overview.connect('item-drag-end', + this._onDragEnd.bind(this)); + this._itemDragCancelledId = Main.overview.connect('item-drag-cancelled', + this._onDragCancelled.bind(this)); + this._windowDragBeginId = Main.overview.connect('window-drag-begin', + this._onDragBegin.bind(this)); + this._windowDragEndId = Main.overview.connect('window-drag-end', + this._onDragEnd.bind(this)); + this._windowDragCancelledId = Main.overview.connect('window-drag-cancelled', + this._onDragCancelled.bind(this)); + + this._settings = new Gio.Settings({ schema_id: WorkspaceThumbnail.MUTTER_SCHEMA }); + this._changedDynamicWorkspacesId = this._settings.connect('changed::dynamic-workspaces', + this._updateSwitcherVisibility.bind(this)); + + this._monitorsChangedId = Main.layoutManager.connect('monitors-changed', () => { + this._destroyThumbnails(); + if (Main.overview.visible) + this._createThumbnails(); + }); + + this._workareasChangedPortholeId = global.display.connect('workareas-changed', + this._updatePorthole.bind(this)); + + this._switchWorkspaceNotifyId = 0; + this._nWorkspacesNotifyId = 0; + this._syncStackingId = 0; + this._workareasChangedId = 0; + + this._scrollAdjustment = scrollAdjustment; + + this._scrollAdjustmentNotifyValueId = this._scrollAdjustment.connect('notify::value', adj => { + let workspaceManager = global.workspace_manager; + let activeIndex = workspaceManager.get_active_workspace_index(); + + this._animatingIndicator = adj.value !== activeIndex; + + if (!this._animatingIndicator) + this._queueUpdateStates(); + + this.queue_relayout(); + }); + + this.connect('destroy', this._onDestroy.bind(this)); + } + + _onDestroy() { + this._destroyThumbnails(); + this._scrollAdjustment.disconnect(this._scrollAdjustmentNotifyValueId); + Main.overview.disconnect(this._showingId); + Main.overview.disconnect(this._hiddenId); + + Main.overview.disconnect(this._itemDragBeginId); + Main.overview.disconnect(this._itemDragEndId); + Main.overview.disconnect(this._itemDragCancelledId); + Main.overview.disconnect(this._windowDragBeginId); + Main.overview.disconnect(this._windowDragEndId); + Main.overview.disconnect(this._windowDragCancelledId); + + this._settings.disconnect(this._changedDynamicWorkspacesId); + Main.layoutManager.disconnect(this._monitorsChangedId); + global.display.disconnect(this._workareasChangedPortholeId); + } + + addThumbnails(start, count) { + let workspaceManager = global.workspace_manager; + + for (let k = start; k < start + count; k++) { + let metaWorkspace = workspaceManager.get_workspace_by_index(k); + let thumbnail = new MultiMonitorsWorkspaceThumbnail(metaWorkspace, this._monitorIndex); + thumbnail.setPorthole(this._porthole.x, this._porthole.y, + this._porthole.width, this._porthole.height); + this._thumbnails.push(thumbnail); + this.add_actor(thumbnail); + + if (start > 0 && this._spliceIndex == -1) { + // not the initial fill, and not splicing via DND + thumbnail.state = WorkspaceThumbnail.ThumbnailState.NEW; + thumbnail.slide_position = 1; // start slid out + this._haveNewThumbnails = true; + } else { + thumbnail.state = WorkspaceThumbnail.ThumbnailState.NORMAL; + } + + this._stateCounts[thumbnail.state]++; + } + + this._queueUpdateStates(); + + // The thumbnails indicator actually needs to be on top of the thumbnails + this.set_child_above_sibling(this._indicator, null); + + // Clear the splice index, we got the message + this._spliceIndex = -1; + } + + _updatePorthole() { + this._porthole = Main.layoutManager.getWorkAreaForMonitor(this._monitorIndex); + this.queue_relayout(); + }}; + + MultiMonitors.copyClass(WorkspaceThumbnail.ThumbnailsBox, MultiMonitorsThumbnailsBox); + return GObject.registerClass({ + Properties: { + 'indicator-y': GObject.ParamSpec.double( + 'indicator-y', 'indicator-y', 'indicator-y', + GObject.ParamFlags.READWRITE, + 0, Infinity, 0), + 'scale': GObject.ParamSpec.double( + 'scale', 'scale', 'scale', + GObject.ParamFlags.READWRITE, + 0, Infinity, 0), + }, + }, MultiMonitorsThumbnailsBox); +})(); + +/* This isn't compatible with GNOME 40 and i don't know how to fix it -- TH +var MultiMonitorsSlidingControl = (() => { + let MultiMonitorsSlidingControl = class MultiMonitorsSlidingControl extends St.Widget { + _init(params) { + params = Params.parse(params, { slideDirection: OverviewControls.SlideDirection.LEFT }); + + this.layout = new OverviewControls.SlideLayout(); + this.layout.slideDirection = params.slideDirection; + super._init({ + layout_manager: this.layout, + style_class: 'overview-controls', + clip_to_allocation: true, + }); + + this._visible = true; + this._inDrag = false; + + this.connect('destroy', this._onDestroy.bind(this)); + this._hidingId = Main.overview.connect('hiding', this._onOverviewHiding.bind(this)); + + this._itemDragBeginId = Main.overview.connect('item-drag-begin', this._onDragBegin.bind(this)); + this._itemDragEndId = Main.overview.connect('item-drag-end', this._onDragEnd.bind(this)); + this._itemDragCancelledId = Main.overview.connect('item-drag-cancelled', this._onDragEnd.bind(this)); + + this._windowDragBeginId = Main.overview.connect('window-drag-begin', this._onWindowDragBegin.bind(this)); + this._windowDragCancelledId = Main.overview.connect('window-drag-cancelled', this._onWindowDragEnd.bind(this)); + this._windowDragEndId = Main.overview.connect('window-drag-end', this._onWindowDragEnd.bind(this)); + } + + _onDestroy() { + Main.overview.disconnect(this._hidingId); + + Main.overview.disconnect(this._itemDragBeginId); + Main.overview.disconnect(this._itemDragEndId); + Main.overview.disconnect(this._itemDragCancelledId); + + Main.overview.disconnect(this._windowDragBeginId); + Main.overview.disconnect(this._windowDragCancelledId); + Main.overview.disconnect(this._windowDragEndId); + }}; + + MultiMonitors.copyClass(OverviewControls.SlidingControl, MultiMonitorsSlidingControl); + return GObject.registerClass(MultiMonitorsSlidingControl); +})(); + +var MultiMonitorsThumbnailsSlider = (() => { + let MultiMonitorsThumbnailsSlider = class MultiMonitorsThumbnailsSlider extends MultiMonitorsSlidingControl { + _init(thumbnailsBox) { + super._init({ slideDirection: OverviewControls.SlideDirection.RIGHT }); + + this._thumbnailsBox = thumbnailsBox; + + this.request_mode = Clutter.RequestMode.WIDTH_FOR_HEIGHT; + this.reactive = true; + this.track_hover = true; + this.add_actor(this._thumbnailsBox); + + this._monitorsChangedId = Main.layoutManager.connect('monitors-changed', this._updateSlide.bind(this)); + this._activeWorkspaceChangedId = global.workspace_manager.connect('active-workspace-changed', + this._updateSlide.bind(this)); + this._notifyNWorkspacesId = global.workspace_manager.connect('notify::n-workspaces', + this._updateSlide.bind(this)); + this.connect('notify::hover', this._updateSlide.bind(this)); + this._thumbnailsBox.bind_property('visible', this, 'visible', GObject.BindingFlags.SYNC_CREATE); + } + + _onDestroy() { + global.workspace_manager.disconnect(this._activeWorkspaceChangedId); + global.workspace_manager.disconnect(this._notifyNWorkspacesId); + Main.layoutManager.disconnect(this._monitorsChangedId); + super._onDestroy(); + }}; + + MultiMonitors.copyClass(OverviewControls.ThumbnailsSlider, MultiMonitorsThumbnailsSlider); + return GObject.registerClass(MultiMonitorsThumbnailsSlider); +})(); +*/ + +var MultiMonitorsControlsManager = GObject.registerClass( +class MultiMonitorsControlsManager extends St.Widget { + _init(index) { + this._monitorIndex = index; + this._workspacesViews = null; + this._spacer_height = 0; + this._fixGeometry = 0; + this._visible = false; + + let layout + if (OverviewControls.ControlsManagerLayout) { + layout = new OverviewControls.ControlsManagerLayout(); + } else { + layout = new OverviewControls.ControlsLayout(); + } + super._init({ + layout_manager: layout, + x_expand: true, + y_expand: true, + clip_to_allocation: true, + }); + + this._workspaceAdjustment = Main.overview._overview._controls._workspaceAdjustment; + + this._thumbnailsBox = + new MultiMonitorsThumbnailsBox(this._workspaceAdjustment, this._monitorIndex); + //this._thumbnailsSlider = new MultiMonitorsThumbnailsSlider(this._thumbnailsBox); + + this._searchController = new St.Widget({ visible: false, x_expand: true, y_expand: true, clip_to_allocation: true }); + this._pageChangedId = Main.overview.searchController.connect('page-changed', this._setVisibility.bind(this)); + this._pageEmptyId = Main.overview.searchController.connect('page-empty', this._onPageEmpty.bind(this)); + + this._group = new St.BoxLayout({ name: 'mm-overview-group-'+index, + x_expand: true, y_expand: true }); + this.add_actor(this._group); + + this._group.add_child(this._searchController); + //this._group.add_actor(this._thumbnailsSlider); + + this._settings = Convenience.getSettings(); + + this._monitorsChanged(); + //this._thumbnailsSlider.slideOut(); + this._thumbnailsBox._updatePorthole(); + + this.connect('notify::allocation', this._updateSpacerVisibility.bind(this)); + this.connect('destroy', this._onDestroy.bind(this)); + //this._thumbnailsSelectSideId = this._settings.connect('changed::'+THUMBNAILS_SLIDER_POSITION_ID, + // this._thumbnailsSelectSide.bind(this)); + this._monitorsChangedId = Main.layoutManager.connect('monitors-changed', this._monitorsChanged.bind(this)); + } + + _onDestroy() { + Main.overview.searchController.disconnect(this._pageChangedId); + Main.overview.searchController.disconnect(this._pageEmptyId); + this._settings.disconnect(this._thumbnailsSelectSideId); + Main.layoutManager.disconnect(this._monitorsChangedId); + } + + _monitorsChanged() { + this._primaryMonitorOnTheLeft = Main.layoutManager.monitors[this._monitorIndex].x > Main.layoutManager.primaryMonitor.x; + this._thumbnailsSelectSide(); + } + + /* + _thumbnailsSelectSide() { + let thumbnailsSlider; + thumbnailsSlider = this._thumbnailsSlider; + + let sett = this._settings.get_string(THUMBNAILS_SLIDER_POSITION_ID); + let onLeftSide = sett === 'left' || (sett === 'auto' && this._primaryMonitorOnTheLeft); + + if (onLeftSide) { + let first = this._group.get_first_child(); + if (first != thumbnailsSlider) { + this._thumbnailsSlider.layout.slideDirection = OverviewControls.SlideDirection.LEFT; + this._thumbnailsBox.remove_style_class_name('workspace-thumbnails'); + this._thumbnailsBox.set_style_class_name('workspace-thumbnails workspace-thumbnails-left'); + this._group.set_child_below_sibling(thumbnailsSlider, first) + } + } + else { + let last = this._group.get_last_child(); + if (last != thumbnailsSlider) { + this._thumbnailsSlider.layout.slideDirection = OverviewControls.SlideDirection.RIGHT; + this._thumbnailsBox.remove_style_class_name('workspace-thumbnails workspace-thumbnails-left'); + this._thumbnailsBox.set_style_class_name('workspace-thumbnails'); + this._group.set_child_above_sibling(thumbnailsSlider, last); + } + } + this._fixGeometry = 3; + } + */ + + _updateSpacerVisibility() { + if (Main.layoutManager.monitors.length { + this._searchController.visible = false; + }, + }); + this._workspacesViews = null; + } +}); + +var MultiMonitorsOverviewActor = GObject.registerClass( +class MultiMonitorsOverviewActor extends St.BoxLayout { + _init(index) { + this._monitorIndex = index; + super._init({ + name: 'mm-overview-'+index, + /* Translators: This is the main view to select + activities. See also note for "Activities" string. */ + accessible_name: _("MMOverview@"+index), + vertical: true, + }); + + this.add_constraint(new LayoutManager.MonitorConstraint({ index: this._monitorIndex })); + + this._panelGhost = null; + if (Main.mmPanel) { + for (let idx in Main.mmPanel) { + if (Main.mmPanel[idx].monitorIndex !== this._monitorIndex) + continue + // Add a clone of the panel to the overview so spacing and such is + // automatic + this._panelGhost = new St.Bin({ + child: new Clutter.Clone({ source: Main.mmPanel[idx] }), + reactive: false, + opacity: 0, + }); + this.add_actor(this._panelGhost); + break; + } + } + + this._spacer = new St.Widget(); + this.add_actor(this._spacer); + + this._controls = new MultiMonitorsControlsManager(this._monitorIndex); + + // Add our same-line elements after the search entry + this.add_child(this._controls); + } +}); + + +var MultiMonitorsOverview = class MultiMonitorsOverview { + constructor(index) { + this.monitorIndex = index; + + this._initCalled = true; + this._overview = new MultiMonitorsOverviewActor(this.monitorIndex); + this._overview._delegate = this; + this._overview.connect('destroy', this._onDestroy.bind(this)); + Main.layoutManager.overviewGroup.add_child(this._overview); + + this._showingId = Main.overview.connect('showing', this._show.bind(this)); + this._hidingId = Main.overview.connect('hiding', this._hide.bind(this)); + } + + getWorkspacesActualGeometry() { + return this._overview._controls.getWorkspacesActualGeometry(); + } + + _onDestroy() { + Main.overview.disconnect(this._showingId); + Main.overview.disconnect(this._hidingId); + + Main.layoutManager.overviewGroup.remove_child(this._overview); + this._overview._delegate = null; + } + + _show() { + this._overview._controls.show(); + } + + _hide() { + this._overview._controls.hide(); + } + + destroy() { + this._overview.destroy(); + } + + addAction(action) { + this._overview.add_action(action); + } + + removeAction(action) { + if (action.get_actor()) + this._overview.remove_action(action); + } +}; diff --git a/extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/mmpanel.js b/extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/mmpanel.js new file mode 100644 index 0000000..a381f15 --- /dev/null +++ b/extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/mmpanel.js @@ -0,0 +1,520 @@ +/* +Copyright (C) 2014 spin83 + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, visit https://www.gnu.org/licenses/. +*/ + +const { St, Shell, Meta, Atk, Clutter, GObject } = imports.gi; + +const Main = imports.ui.main; +const Panel = imports.ui.panel; +const PopupMenu = imports.ui.popupMenu; +const PanelMenu = imports.ui.panelMenu; +const CtrlAltTab = imports.ui.ctrlAltTab; +const ExtensionSystem = imports.ui.extensionSystem; + +const ExtensionUtils = imports.misc.extensionUtils; +const CE = ExtensionUtils.getCurrentExtension(); +const MultiMonitors = CE.imports.extension; +const Convenience = CE.imports.convenience; +const MMCalendar = CE.imports.mmcalendar; + +const SHOW_ACTIVITIES_ID = 'show-activities'; +var SHOW_APP_MENU_ID = 'show-app-menu'; +const SHOW_DATE_TIME_ID = 'show-date-time'; +const AVAILABLE_INDICATORS_ID = 'available-indicators'; +const TRANSFER_INDICATORS_ID = 'transfer-indicators'; + +var StatusIndicatorsController = class StatusIndicatorsController { + constructor() { + this._transfered_indicators = []; + this._settings = Convenience.getSettings(); + + this._updatedSessionId = Main.sessionMode.connect('updated', this._updateSessionIndicators.bind(this)); + this._updateSessionIndicators(); + this._extensionStateChangedId = Main.extensionManager.connect('extension-state-changed', + this._extensionStateChanged.bind(this)); + + this._transferIndicatorsId = this._settings.connect('changed::'+TRANSFER_INDICATORS_ID, + this.transferIndicators.bind(this)); + } + + destroy() { + this._settings.disconnect(this._transferIndicatorsId); + Main.extensionManager.disconnect(this._extensionStateChangedId); + Main.sessionMode.disconnect(this._updatedSessionId); + this._settings.set_strv(AVAILABLE_INDICATORS_ID, []); + this._transferBack(this._transfered_indicators); + } + + transferBack(panel) { + let transfer_back = this._transfered_indicators.filter((element) => { + return element.monitor==panel.monitorIndex; + }); + + this._transferBack(transfer_back, panel); + } + + transferIndicators() { + let boxs = ['_leftBox', '_centerBox', '_rightBox']; + let transfers = this._settings.get_value(TRANSFER_INDICATORS_ID).deep_unpack(); + let show_app_menu = this._settings.get_value(SHOW_APP_MENU_ID); + + let transfer_back = this._transfered_indicators.filter((element) => { + return !transfers.hasOwnProperty(element.iname); + }); + + this._transferBack(transfer_back); + + for(let iname in transfers) { + if(transfers.hasOwnProperty(iname) && Main.panel.statusArea[iname]) { + let monitor = transfers[iname]; + + let indicator = Main.panel.statusArea[iname]; + let panel = this._findPanel(monitor); + boxs.forEach((box) => { + if(Main.panel[box].contains(indicator.container) && panel) { + global.log('a '+box+ " > " + iname + " : "+ monitor); + this._transfered_indicators.push({iname:iname, box:box, monitor:monitor}); + Main.panel[box].remove_child(indicator.container); + if (show_app_menu && box === '_leftBox') + panel[box].insert_child_at_index(indicator.container, 1); + else + panel[box].insert_child_at_index(indicator.container, 0); + } + }); + } + } + } + + _findPanel(monitor) { + for (let i = 0; i < Main.mmPanel.length; i++) { + if (Main.mmPanel[i].monitorIndex == monitor) { + return Main.mmPanel[i]; + } + } + return null; + } + + _transferBack(transfer_back, panel) { + transfer_back.forEach((element) => { + this._transfered_indicators.splice(this._transfered_indicators.indexOf(element)); + if(Main.panel.statusArea[element.iname]) { + let indicator = Main.panel.statusArea[element.iname]; + if(!panel) { + panel = this._findPanel(element.monitor); + } + if(panel[element.box].contains(indicator.container)) { + global.log("r "+element.box+ " > " + element.iname + " : "+ element.monitor); + panel[element.box].remove_child(indicator.container); + if (element.box === '_leftBox') + Main.panel[element.box].insert_child_at_index(indicator.container, 1); + else + Main.panel[element.box].insert_child_at_index(indicator.container, 0); + } + } + }); + } + + _extensionStateChanged() { + this._findAvailableIndicators(); + this.transferIndicators(); + } + + _updateSessionIndicators() { + let session_indicators = []; + session_indicators.push('MultiMonitorsAddOn'); + let sessionPanel = Main.sessionMode.panel; + for (let sessionBox in sessionPanel){ + sessionPanel[sessionBox].forEach((sesionIndicator) => { + session_indicators.push(sesionIndicator); + }); + } + this._session_indicators = session_indicators; + this._available_indicators = []; + + this._findAvailableIndicators(); + this.transferIndicators(); + } + + _findAvailableIndicators() { + let available_indicators = []; + let statusArea = Main.panel.statusArea; + for(let indicator in statusArea) { + if(statusArea.hasOwnProperty(indicator) && this._session_indicators.indexOf(indicator)<0){ + available_indicators.push(indicator); + } + } + if(available_indicators.length!=this._available_indicators.length) { + this._available_indicators = available_indicators; +// global.log(this._available_indicators); + this._settings.set_strv(AVAILABLE_INDICATORS_ID, this._available_indicators); + } + } +}; + +var MultiMonitorsAppMenuButton = (() => { + let MultiMonitorsAppMenuButton = class MultiMonitorsAppMenuButton extends PanelMenu.Button { + _init(panel) { + if (panel.monitorIndex==undefined) + this._monitorIndex = Main.layoutManager.primaryIndex; + else + this._monitorIndex = panel.monitorIndex; + this._actionOnWorkspaceGroupNotifyId = 0; + this._targetAppGroup = null; + this._lastFocusedWindow = null; + Panel.AppMenuButton.prototype._init.call(this, panel); + + this._windowEnteredMonitorId = global.display.connect('window-entered-monitor', + this._windowEnteredMonitor.bind(this)); + this._windowLeftMonitorId = global.display.connect('window-left-monitor', + this._windowLeftMonitor.bind(this)); + } + + _windowEnteredMonitor (metaScreen, monitorIndex, metaWin) { + if (monitorIndex == this._monitorIndex) { + switch(metaWin.get_window_type()){ + case Meta.WindowType.NORMAL: + case Meta.WindowType.DIALOG: + case Meta.WindowType.MODAL_DIALOG: + case Meta.WindowType.SPLASHSCREEN: + this._sync(); + break; + } + } + } + + _windowLeftMonitor (metaScreen, monitorIndex, metaWin) { + if (monitorIndex == this._monitorIndex) { + switch(metaWin.get_window_type()){ + case Meta.WindowType.NORMAL: + case Meta.WindowType.DIALOG: + case Meta.WindowType.MODAL_DIALOG: + case Meta.WindowType.SPLASHSCREEN: + this._sync(); + break; + } + } + } + + _findTargetApp() { + + if (this._actionOnWorkspaceGroupNotifyId) { + this._targetAppGroup.disconnect(this._actionOnWorkspaceGroupNotifyId); + this._actionOnWorkspaceGroupNotifyId = 0; + this._targetAppGroup = null; + } + let groupWindow = false; + let groupFocus = false; + + let workspaceManager = global.workspace_manager; + let workspace = workspaceManager.get_active_workspace(); + let tracker = Shell.WindowTracker.get_default(); + let focusedApp = tracker.focus_app; + if (focusedApp && focusedApp.is_on_workspace(workspace)){ + let windows = focusedApp.get_windows(); + for (let i = 0; i < windows.length; i++) { + let win = windows[i]; + if (win.located_on_workspace(workspace)){ + if (win.get_monitor() == this._monitorIndex){ + if (win.has_focus()){ + this._lastFocusedWindow = win; + // global.log(this._monitorIndex+": focus :"+win.get_title()+" : "+win.has_focus()); + return focusedApp; + } + else + groupWindow = true; + } + else { + if(win.has_focus()) + groupFocus = true; + } + if (groupFocus && groupWindow) { + if(focusedApp != this._targetApp){ + this._targetAppGroup = focusedApp; + this._actionOnWorkspaceGroupNotifyId = this._targetAppGroup.connect('notify::action-group', + this._sync.bind(this)); + // global.log(this._monitorIndex+": gConnect :"+win.get_title()+" : "+win.has_focus()); + } + break; + } + } + } + } + + for (let i = 0; i < this._startingApps.length; i++) + if (this._startingApps[i].is_on_workspace(workspace)){ + // global.log(this._monitorIndex+": newAppFocus"); + return this._startingApps[i]; + } + + if (this._lastFocusedWindow && this._lastFocusedWindow.located_on_workspace(workspace) && + this._lastFocusedWindow.get_monitor() == this._monitorIndex){ + // global.log(this._monitorIndex+": lastFocus :"+this._lastFocusedWindow.get_title()); + return tracker.get_window_app(this._lastFocusedWindow); + } + + let windows = global.display.get_tab_list(Meta.TabList.NORMAL_ALL, workspace); + + for (let i = 0; i < windows.length; i++) { + if(windows[i].get_monitor() == this._monitorIndex){ + this._lastFocusedWindow = windows[i]; + // global.log(this._monitorIndex+": appFind :"+windows[i].get_title()); + return tracker.get_window_app(windows[i]); + } + } + + return null; + } + + _sync() { + if (!this._switchWorkspaceNotifyId) + return; + Panel.AppMenuButton.prototype._sync.call(this); + } + + _onDestroy() { + if (this._actionGroupNotifyId) { + this._targetApp.disconnect(this._actionGroupNotifyId); + this._actionGroupNotifyId = 0; + } + + global.display.disconnect(this._windowEnteredMonitorId); + global.display.disconnect(this._windowLeftMonitorId); + + if (this._busyNotifyId) { + this._targetApp.disconnect(this._busyNotifyId); + this._busyNotifyId = 0; + } + + if (this.menu._windowsChangedId) { + this.menu._app.disconnect(this.menu._windowsChangedId); + this.menu._windowsChangedId = 0; + } + Panel.AppMenuButton.prototype._onDestroy.call(this); + } + }; + MultiMonitors.copyClass(Panel.AppMenuButton, MultiMonitorsAppMenuButton); + return GObject.registerClass({Signals: {'changed': {}},}, MultiMonitorsAppMenuButton); +})(); + +var MultiMonitorsActivitiesButton = (() => { + let MultiMonitorsActivitiesButton = class MultiMonitorsActivitiesButton extends PanelMenu.Button { + _init() { + super._init(0.0, null, true); + this.accessible_role = Atk.Role.TOGGLE_BUTTON; + + this.name = 'mmPanelActivities'; + + /* Translators: If there is no suitable word for "Activities" + in your language, you can use the word for "Overview". */ + this._label = new St.Label({ text: _("Activities"), + y_align: Clutter.ActorAlign.CENTER }); + this.add_actor(this._label); + + this.label_actor = this._label; + + this._showingId = Main.overview.connect('showing', () => { + this.add_style_pseudo_class('overview'); + this.add_accessible_state (Atk.StateType.CHECKED); + }); + this._hidingId = Main.overview.connect('hiding', () => { + this.remove_style_pseudo_class('overview'); + this.remove_accessible_state (Atk.StateType.CHECKED); + }); + + this._xdndTimeOut = 0; + } + + _onDestroy() { + Main.overview.disconnect(this._showingId); + Main.overview.disconnect(this._hidingId); + super._onDestroy(); + } + } + MultiMonitors.copyClass(Panel.ActivitiesButton, MultiMonitorsActivitiesButton); + return GObject.registerClass(MultiMonitorsActivitiesButton); +})(); + +const MULTI_MONITOR_PANEL_ITEM_IMPLEMENTATIONS = { + 'activities': MultiMonitorsActivitiesButton, + 'appMenu': MultiMonitorsAppMenuButton, + 'dateMenu': MMCalendar.MultiMonitorsDateMenuButton, +}; + +var MultiMonitorsPanel = (() => { + let MultiMonitorsPanel = class MultiMonitorsPanel extends St.Widget { + _init(monitorIndex, mmPanelBox) { + super._init({ name: 'panel', + reactive: true }); + + this.monitorIndex = monitorIndex; + + this.set_offscreen_redirect(Clutter.OffscreenRedirect.ALWAYS); + + this._sessionStyle = null; + + this.statusArea = {}; + + this.menuManager = new PopupMenu.PopupMenuManager(this); + + this._leftBox = new St.BoxLayout({ name: 'panelLeft' }); + this.add_child(this._leftBox); + this._centerBox = new St.BoxLayout({ name: 'panelCenter' }); + this.add_child(this._centerBox); + this._rightBox = new St.BoxLayout({ name: 'panelRight' }); + this.add_child(this._rightBox); + + this._showingId = Main.overview.connect('showing', () => { + this.add_style_pseudo_class('overview'); + }); + this._hidingId = Main.overview.connect('hiding', () => { + this.remove_style_pseudo_class('overview'); + }); + + mmPanelBox.panelBox.add(this); + Main.ctrlAltTabManager.addGroup(this, _("Top Bar"), 'focus-top-bar-symbolic', + { sortGroup: CtrlAltTab.SortGroup.TOP }); + + this._updatedId = Main.sessionMode.connect('updated', this._updatePanel.bind(this)); + + this._workareasChangedId = global.display.connect('workareas-changed', () => this.queue_relayout()); + this._updatePanel(); + + this._settings = Convenience.getSettings(); + this._showActivitiesId = this._settings.connect('changed::'+SHOW_ACTIVITIES_ID, + this._showActivities.bind(this)); + this._showActivities(); + + this._showAppMenuId = this._settings.connect('changed::'+SHOW_APP_MENU_ID, + this._showAppMenu.bind(this)); + this._showAppMenu(); + + this._showDateTimeId = this._settings.connect('changed::'+SHOW_DATE_TIME_ID, + this._showDateTime.bind(this)); + this._showDateTime(); + + this.connect('destroy', this._onDestroy.bind(this)); + } + + _onDestroy() { + global.display.disconnect(this._workareasChangedId); + Main.overview.disconnect(this._showingId); + Main.overview.disconnect(this._hidingId); + + this._settings.disconnect(this._showActivitiesId); + this._settings.disconnect(this._showAppMenuId); + this._settings.disconnect(this._showDateTimeId); + + Main.ctrlAltTabManager.removeGroup(this); + Main.sessionMode.disconnect(this._updatedId); + } + + _showActivities() { + let name = 'activities'; + if (this._settings.get_boolean(SHOW_ACTIVITIES_ID)) { + if (this.statusArea[name]) + this.statusArea[name].visible = true; + } + else { + if (this.statusArea[name]) + this.statusArea[name].visible = false; + } + } + + _showDateTime() { + let name = 'dateMenu'; + if (this._settings.get_boolean(SHOW_DATE_TIME_ID)) { + if (this.statusArea[name]) + this.statusArea[name].visible = true; + } + else { + if (this.statusArea[name]) + this.statusArea[name].visible = false; + } + } + + _showAppMenu() { + let name = 'appMenu'; + if (this._settings.get_boolean(SHOW_APP_MENU_ID)) { + if (!this.statusArea[name]) { + let indicator = new MultiMonitorsAppMenuButton(this); + this.statusArea[name] = indicator; + let box = this._leftBox; + this._addToPanelBox(name, indicator, box.get_n_children()+1, box); + } + } + else { + if (this.statusArea[name]) { + let indicator = this.statusArea[name]; + this.menuManager.removeMenu(indicator.menu); + indicator.destroy(); + delete this.statusArea[name]; + } + } + } + + vfunc_get_preferred_width(forHeight) { + if (Main.layoutManager.monitors.length>this.monitorIndex) + return [0, Main.layoutManager.monitors[this.monitorIndex].width]; + + return [0, 0]; + } + + _hideIndicators() { + for (let role in MULTI_MONITOR_PANEL_ITEM_IMPLEMENTATIONS) { + let indicator = this.statusArea[role]; + if (!indicator) + continue; + indicator.container.hide(); + } + } + + _ensureIndicator(role) { + let indicator = this.statusArea[role]; + if (indicator) { + indicator.container.show(); + return null; + } + else { + let constructor = MULTI_MONITOR_PANEL_ITEM_IMPLEMENTATIONS[role]; + if (!constructor) { + // This icon is not implemented (this is a bug) + return null; + } + indicator = new constructor(this); + this.statusArea[role] = indicator; + } + return indicator; + } + + _getDraggableWindowForPosition(stageX) { + let workspaceManager = global.workspace_manager; + const windows = workspaceManager.get_active_workspace().list_windows(); + const allWindowsByStacking = + global.display.sort_windows_by_stacking(windows).reverse(); + + return allWindowsByStacking.find(metaWindow => { + let rect = metaWindow.get_frame_rect(); + return metaWindow.get_monitor() == this.monitorIndex && + metaWindow.showing_on_its_workspace() && + metaWindow.get_window_type() != Meta.WindowType.DESKTOP && + metaWindow.maximized_vertically && + stageX > rect.x && stageX < rect.x + rect.width; + }); + }}; + + MultiMonitors.copyClass(Panel.Panel, MultiMonitorsPanel); + return GObject.registerClass(MultiMonitorsPanel); +})(); diff --git a/extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/multi-monitors-add-on.pot b/extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/multi-monitors-add-on.pot new file mode 100644 index 0000000..6b18906 --- /dev/null +++ b/extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/multi-monitors-add-on.pot @@ -0,0 +1,89 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the multi-monitors-add-on package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: multi-monitors-add-on\n" +"Report-Msgid-Bugs-To: https://github.com/spin83/multi-monitors-add-on/" +"issues\n" +"POT-Creation-Date: 2019-10-04 04:44-0300\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: indicator.js:46 +msgid "Preferences" +msgstr "" + +#: indicator.js:115 +msgid "Multi Monitors Add-On" +msgstr "" + +#: mmoverview.js:642 +msgid "Overview" +msgstr "" + +#. Translators: If there is no suitable word for "Activities" +#. in your language, you can use the word for "Overview". +#: mmpanel.js:333 +msgid "Activities" +msgstr "" + +#: mmpanel.js:414 +msgid "Top Bar" +msgstr "" + +#: prefs.js:62 +msgid "Show Multi Monitors indicator on Top Panel." +msgstr "" + +#: prefs.js:63 +msgid "Show Panel on additional monitors." +msgstr "" + +#: prefs.js:64 +msgid "Show Thumbnails-Slider on additional monitors." +msgstr "" + +#: prefs.js:65 +msgid "Show Activities-Button on additional monitors." +msgstr "" + +#: prefs.js:66 +msgid "Show AppMenu-Button on additional monitors." +msgstr "" + +#: prefs.js:67 +msgid "Show DateTime-Button on additional monitors." +msgstr "" + +#: prefs.js:68 +msgid "Show Thumbnails-Slider on left side of additional monitors." +msgstr "" + +#: prefs.js:77 +msgid "A list of indicators for transfer to additional monitors." +msgstr "" + +#: prefs.js:124 +msgid "Select indicator" +msgstr "" + +#: prefs.js:127 +msgid "Add" +msgstr "" + +#: prefs.js:141 +msgid "Indicators on Top Panel" +msgstr "" + +#: prefs.js:170 +msgid "Monitor index:" +msgstr "" diff --git a/extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/prefs.js b/extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/prefs.js new file mode 100644 index 0000000..d1ba7ea --- /dev/null +++ b/extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/prefs.js @@ -0,0 +1,289 @@ +/* +Copyright (C) 2014 spin83 + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, visit https://www.gnu.org/licenses/. +*/ + +const Lang = imports.lang; + +const GObject = imports.gi.GObject; +const Gdk = imports.gi.Gdk; +const Gtk = imports.gi.Gtk; +const Gio = imports.gi.Gio; +const GLib = imports.gi.GLib; + +const Gettext = imports.gettext.domain('multi-monitors-add-on'); +const _ = Gettext.gettext; + +const ExtensionUtils = imports.misc.extensionUtils; +const MultiMonitors = ExtensionUtils.getCurrentExtension(); +const Convenience = MultiMonitors.imports.convenience; + +const SHOW_INDICATOR_ID = 'show-indicator'; +const SHOW_PANEL_ID = 'show-panel'; +const SHOW_ACTIVITIES_ID = 'show-activities'; +const SHOW_APP_MENU_ID = 'show-app-menu'; +const SHOW_DATE_TIME_ID = 'show-date-time'; +const THUMBNAILS_SLIDER_POSITION_ID = 'thumbnails-slider-position'; +const AVAILABLE_INDICATORS_ID = 'available-indicators'; +const TRANSFER_INDICATORS_ID = 'transfer-indicators'; +const ENABLE_HOT_CORNERS = 'enable-hot-corners'; + +const Columns = { + INDICATOR_NAME: 0, + MONITOR_NUMBER: 1 +}; + + +var MultiMonitorsPrefsWidget = GObject.registerClass( +class MultiMonitorsPrefsWidget extends Gtk.Grid { + _init() { + super._init({ + margin_top: 6, margin_end: 6, margin_bottom: 6, margin_start: 6 + }); + + this._numRows = 0; + + this.set_orientation(Gtk.Orientation.VERTICAL); + + this._settings = Convenience.getSettings(); + this._desktopSettings = Convenience.getSettings("org.gnome.desktop.interface"); + + this._display = Gdk.Display.get_default(); + this._monitors = this._display.get_monitors() + + this._addBooleanSwitch(_('Show Multi Monitors indicator on Top Panel.'), SHOW_INDICATOR_ID); + this._addBooleanSwitch(_('Show Panel on additional monitors.'), SHOW_PANEL_ID); + this._addBooleanSwitch(_('Show Activities-Button on additional monitors.'), SHOW_ACTIVITIES_ID); + this._addBooleanSwitch(_('Show AppMenu-Button on additional monitors.'), SHOW_APP_MENU_ID); + this._addBooleanSwitch(_('Show DateTime-Button on additional monitors.'), SHOW_DATE_TIME_ID); + this._addComboBoxSwitch(_('Show Thumbnails-Slider on additional monitors.'), THUMBNAILS_SLIDER_POSITION_ID, { + none: _('No'), + right: _('On the right'), + left: _('On the left'), + auto: _('Auto') + }); + this._addSettingsBooleanSwitch(_('Enable hot corners.'), this._desktopSettings, ENABLE_HOT_CORNERS); + + this._store = new Gtk.ListStore(); + this._store.set_column_types([GObject.TYPE_STRING, GObject.TYPE_INT]); + + this._treeView = new Gtk.TreeView({ model: this._store, hexpand: true, vexpand: true }); + this._treeView.get_selection().set_mode(Gtk.SelectionMode.SINGLE); + + let appColumn = new Gtk.TreeViewColumn({ expand: true, sort_column_id: Columns.INDICATOR_NAME, + title: _("A list of indicators for transfer to additional monitors.") }); + + let nameRenderer = new Gtk.CellRendererText; + appColumn.pack_start(nameRenderer, true); + appColumn.add_attribute(nameRenderer, "text", Columns.INDICATOR_NAME); + + nameRenderer = new Gtk.CellRendererText; + appColumn.pack_start(nameRenderer, true); + appColumn.add_attribute(nameRenderer, "text", Columns.MONITOR_NUMBER); + + this._treeView.append_column(appColumn); + this.add(this._treeView); + + let toolbar = new Gtk.Box({orientation: Gtk.Orientation.HORIZONTAL}); + toolbar.get_style_context().add_class("inline-toolbar"); + + this._settings.connect('changed::'+TRANSFER_INDICATORS_ID, Lang.bind(this, this._updateIndicators)); + this._updateIndicators(); + + let addTButton = new Gtk.Button({ icon_name: "list-add" }); + addTButton.connect('clicked', Lang.bind(this, this._addIndicator)); + toolbar.append(addTButton); + + let removeTButton = new Gtk.Button({ icon_name: "list-remove" }); + removeTButton.connect('clicked', Lang.bind(this, this._removeIndicator)); + toolbar.append(removeTButton); + + this.add(toolbar); + } + + add(child) { + this.attach(child, 0, this._numRows++, 1, 1); + } + + _updateIndicators() { + this._store.clear(); + + let transfers = this._settings.get_value(TRANSFER_INDICATORS_ID).deep_unpack(); + + for(let indicator in transfers) { + if(transfers.hasOwnProperty(indicator)){ + let monitor = transfers[indicator]; + let iter = this._store.append(); + this._store.set(iter, [Columns.INDICATOR_NAME, Columns.MONITOR_NUMBER], [indicator, monitor]); + } + } + } + + _addIndicator() { + + let dialog = new Gtk.Dialog({ title: _("Select indicator"), + transient_for: this.get_toplevel(), modal: true }); + dialog.add_button(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL); + dialog.add_button(_("Add"), Gtk.ResponseType.OK); + dialog.set_default_response(Gtk.ResponseType.OK); + + let grid = new Gtk.Grid({ column_spacing: 10, row_spacing: 15, + margin_top: 10, margin_end: 10, margin_bottom: 10, margin_start: 10 }); + + grid.set_orientation(Gtk.Orientation.VERTICAL); + + dialog._store = new Gtk.ListStore(); + dialog._store.set_column_types([GObject.TYPE_STRING]); + + dialog._treeView = new Gtk.TreeView({ model: dialog._store, hexpand: true, vexpand: true }); + dialog._treeView.get_selection().set_mode(Gtk.SelectionMode.SINGLE); + + let appColumn = new Gtk.TreeViewColumn({ expand: true, sort_column_id: Columns.INDICATOR_NAME, + title: _("Indicators on Top Panel") }); + + let nameRenderer = new Gtk.CellRendererText; + appColumn.pack_start(nameRenderer, true); + appColumn.add_attribute(nameRenderer, "text", Columns.INDICATOR_NAME); + + dialog._treeView.append_column(appColumn); + + let availableIndicators = () => { + let transfers = this._settings.get_value(TRANSFER_INDICATORS_ID).unpack(); + dialog._store.clear(); + this._settings.get_strv(AVAILABLE_INDICATORS_ID).forEach((indicator) => { + if(!transfers.hasOwnProperty(indicator)){ + let iter = dialog._store.append(); + dialog._store.set(iter, [Columns.INDICATOR_NAME], [indicator]); + } + }); + }; + + let availableIndicatorsId = this._settings.connect('changed::'+AVAILABLE_INDICATORS_ID, + availableIndicators); + let transferIndicatorsId = this._settings.connect('changed::'+TRANSFER_INDICATORS_ID, + availableIndicators); + + availableIndicators.apply(this); + grid.attach(dialog._treeView, 0, 0, 2, 1); + + let gHBox = new Gtk.Box({orientation: Gtk.Orientation.HORIZONTAL, + margin_top: 10, margin_end: 10, margin_bottom: 10, margin_start: 10, + spacing: 20, hexpand: true}); + let gLabel = new Gtk.Label({label: _('Monitor index:'), halign: Gtk.Align.START}); + gHBox.append(gLabel); + dialog._adjustment = new Gtk.Adjustment({lower: 0.0, upper: 0.0, step_increment:1.0}); + let spinButton = new Gtk.SpinButton({halign: Gtk.Align.END, adjustment: dialog._adjustment, numeric: 1}); + gHBox.append(spinButton); + + let monitorsChanged = () => { + let n_monitors = this._monitors.get_n_items() -1; + dialog._adjustment.set_upper(n_monitors) + dialog._adjustment.set_value(n_monitors); + }; + + let monitorsChangedId = this._monitors.connect('items-changed', monitorsChanged); + + monitorsChanged.apply(this); + grid.append(gHBox); + + dialog.get_content_area().append(grid); + + dialog.connect('response', (dialog, id) => { + this._monitors.disconnect(monitorsChangedId); + this._settings.disconnect(availableIndicatorsId); + this._settings.disconnect(transferIndicatorsId); + if (id != Gtk.ResponseType.OK) { + dialog.destroy(); + return; + } + + let [any, model, iter] = dialog._treeView.get_selection().get_selected(); + if (any) { + let indicator = model.get_value(iter, Columns.INDICATOR_NAME); + + let transfers = this._settings.get_value(TRANSFER_INDICATORS_ID).deep_unpack(); + if(!transfers.hasOwnProperty(indicator)){ + transfers[indicator] = dialog._adjustment.get_value(); + this._settings.set_value(TRANSFER_INDICATORS_ID, new GLib.Variant('a{si}', transfers)); + } + } + + dialog.destroy(); + }); + } + + _removeIndicator() { + let [any, model, iter] = this._treeView.get_selection().get_selected(); + if (any) { + let indicator = model.get_value(iter, Columns.INDICATOR_NAME); + + let transfers = this._settings.get_value(TRANSFER_INDICATORS_ID).deep_unpack(); + if(transfers.hasOwnProperty(indicator)){ + delete transfers[indicator]; + this._settings.set_value(TRANSFER_INDICATORS_ID, new GLib.Variant('a{si}', transfers)); + } + } + } + + _addComboBoxSwitch(label, schema_id, options) { + this._addSettingsComboBoxSwitch(label, this._settings, schema_id, options) + } + + _addSettingsComboBoxSwitch(label, settings, schema_id, options) { + let gHBox = new Gtk.Box({orientation: Gtk.Orientation.HORIZONTAL, + margin_top: 10, margin_end: 10, margin_bottom: 10, margin_start: 10, + spacing: 20, hexpand: true}); + let gLabel = new Gtk.Label({label: _(label), halign: Gtk.Align.START}); + gHBox.append(gLabel); + + let gCBox = new Gtk.ComboBoxText({halign: Gtk.Align.END}); + Object.entries(options).forEach(function(entry) { + const [key, val] = entry; + gCBox.append(key, val); + }); + gHBox.append(gCBox); + + this.add(gHBox); + + settings.bind(schema_id, gCBox, 'active-id', Gio.SettingsBindFlags.DEFAULT); + } + + _addBooleanSwitch(label, schema_id) { + this._addSettingsBooleanSwitch(label, this._settings, schema_id); + } + + _addSettingsBooleanSwitch(label, settings, schema_id) { + let gHBox = new Gtk.Box({orientation: Gtk.Orientation.HORIZONTAL, + margin_top: 10, margin_end: 10, margin_bottom: 10, margin_start: 10, + spacing: 20, hexpand: true}); + let gLabel = new Gtk.Label({label: _(label), halign: Gtk.Align.START}); + gHBox.append(gLabel); + let gSwitch = new Gtk.Switch({halign: Gtk.Align.END}); + gHBox.append(gSwitch); + this.add(gHBox); + + settings.bind(schema_id, gSwitch, 'active', Gio.SettingsBindFlags.DEFAULT); + } +}); + +function init() { + Convenience.initTranslations(); +} + +function buildPrefsWidget() { + let widget = new MultiMonitorsPrefsWidget(); + + return widget; +} diff --git a/extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/schemas/gschemas.compiled b/extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/schemas/gschemas.compiled new file mode 100644 index 0000000..5a9e945 Binary files /dev/null and b/extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/schemas/gschemas.compiled differ diff --git a/extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/schemas/org.gnome.shell.extensions.multi-monitors-add-on.gschema.xml b/extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/schemas/org.gnome.shell.extensions.multi-monitors-add-on.gschema.xml new file mode 100644 index 0000000..4a42a23 --- /dev/null +++ b/extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/schemas/org.gnome.shell.extensions.multi-monitors-add-on.gschema.xml @@ -0,0 +1,59 @@ + + + + + true + Show Multi Monitors indicator on Top Panel. + Add or remove Multi Monitors indicator from Top Panel. + + + + true + Show Panel on additional monitors. + Add or remove Panel from additional monitors. + + + + true + Show Activities-Button on additional monitors. + Change visibility of Activities-Button on additional monitors. + + + + true + Show AppMenu-Button on additional monitors. + Change visibility of AppMenu-Button on additional monitors. + + + + true + Show DateTime-Button on additional monitors. + Change visibility of DateTime-Button on additional monitors. + + + + + + + + + + 'auto' + Show Thumbnails-Slider on additional monitors. + Select position of Thumbnails-Slider on additional monitors. + + + + [] + A list of available indicators. + A list of indicators that are available for transfer. For internal use only. + + + + {} + A list of indicators for transfer. + A list of indicators selected for transfer to additional Panel. + + + + \ No newline at end of file diff --git a/extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/stylesheet.css b/extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/stylesheet.css new file mode 100644 index 0000000..b1d20c5 --- /dev/null +++ b/extensions/multi-monitors-add-on/multi-monitors-add-on@spin83/stylesheet.css @@ -0,0 +1,29 @@ + +.helloworld-label { + font-size: 72px; + font-weight: bold; + color: #ffffff; + background-color: rgba(0,0,0,0.5); + border-radius: 5px; + padding: .5em; +} + +.multimonitor-spacer { + height: 4em; +} + +.multimonitor-status-indicators-box { + spacing: 0px; +} + +.multimonitor-status-icon { + padding: 0 2px; +} + +.workspace-thumbnails-left { + border-radius: 0 9px 9px 0; +} + +.workspace-thumbnails-left:rtl { + border-radius: 9px 0 0 9px; +} diff --git a/extensions/no-overview.mk b/extensions/no-overview.mk new file mode 100644 index 0000000..f59ce6f --- /dev/null +++ b/extensions/no-overview.mk @@ -0,0 +1,58 @@ +# Progress Linux: gnome-shell-extensions-extra + +# Copyright (C) 2010-2023 Daniel Baumann +# +# SPDX-License-Identifier: GPL-3.0+ +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Build-Depends: +# none + +SHELL := sh -e + +EXTENSION := no-overview +UUID := no-overview@fthx + +all: + +test: + +build: + +install: + mkdir -p $(DESTDIR)/usr/share/gnome-shell/extensions + cp -a $(EXTENSION) $(DESTDIR)/usr/share/gnome-shell/extensions/$(UUID) + + # removing unused files + rm -f $(DESTDIR)/usr/share/gnome-shell/extensions/$(UUID)/LICENSE + rm -f $(DESTDIR)/usr/share/gnome-shell/extensions/$(UUID)/README.md + +uninstall: + rm -rf $(DESTDIR)/usr/share/gnome-shell/extensions/$(UUID) + rmdir --ignore-fail-on-non-empty --parents $(DESTDIR) || true + +clean: + +distclean: + +reinstall: uninstall install + +upstream: + rm -rf $(EXTENSION) + git clone https://github.com/fthx/$(EXTENSION) + rm -rf $(EXTENSION)/.git + + # dfsg + rm -f $(EXTENSION)/metadata.json diff --git a/extensions/no-overview/LICENSE b/extensions/no-overview/LICENSE new file mode 100644 index 0000000..f288702 --- /dev/null +++ b/extensions/no-overview/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/extensions/no-overview/README.md b/extensions/no-overview/README.md new file mode 100644 index 0000000..25fb2aa --- /dev/null +++ b/extensions/no-overview/README.md @@ -0,0 +1,3 @@ +GNOME Shell 40+ extension + +https://extensions.gnome.org/extension/4099/no-overview/ diff --git a/extensions/no-overview/extension.js b/extensions/no-overview/extension.js new file mode 100644 index 0000000..32a9090 --- /dev/null +++ b/extensions/no-overview/extension.js @@ -0,0 +1,38 @@ +/* + No overview at start-up + Contributors: @fthx, @fmuellner + License: GPL v3 +*/ + + +const Main = imports.ui.main; + + +class Extension { + constructor() { + this._realHasOverview = Main.sessionMode.hasOverview; + } + + enable() { + if (!Main.layoutManager._startingUp) { + return; + } + + Main.sessionMode.hasOverview = false; + Main.layoutManager.connect('startup-complete', () => { + Main.sessionMode.hasOverview = this._realHasOverview + }); + // handle Ubuntu's method + if (Main.layoutManager.startInOverview) { + Main.layoutManager.startInOverview = false; + } + } + + disable() { + Main.sessionMode.hasOverview = this._realHasOverview; + } +} + +function init() { + return new Extension(); +} \ No newline at end of file diff --git a/extensions/vertical-workspaces.mk b/extensions/vertical-workspaces.mk new file mode 100644 index 0000000..3dd5bd0 --- /dev/null +++ b/extensions/vertical-workspaces.mk @@ -0,0 +1,56 @@ +# Progress Linux: gnome-shell-extensions-extra + +# Copyright (C) 2010-2023 Daniel Baumann +# +# SPDX-License-Identifier: GPL-3.0+ +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Build-Depends: +# gettext libglib2.0-bin unzip zip + +SHELL := sh -e + +EXTENSION := vertical-workspaces +UUID := $(shell awk -F\" '/"uuid": / { print $$4 }' $(EXTENSION)/metadata.json) + +all: + +test: + +build: + $(MAKE) -C $(EXTENSION) zip + +install: build + mkdir -p $(DESTDIR)/usr/share/gnome-shell/extensions/$(UUID) + unzip -d $(DESTDIR)/usr/share/gnome-shell/extensions/$(UUID) $(EXTENSION)/*.zip + + # removing unused files + rm -f $(DESTDIR)/usr/share/gnome-shell/extensions/$(UUID)/LICENSE + +uninstall: + rm -rf $(DESTDIR)/usr/share/gnome-shell/extensions/$(UUID) + rmdir --ignore-fail-on-non-empty --parents $(DESTDIR) || true + +clean: + $(MAKE) -C $(EXTENSION) clean + +distclean: + +reinstall: uninstall install + +upstream: + rm -rf $(EXTENSION) + git clone https://github.com/G-dH/$(EXTENSION) $(EXTENSION) + rm -rf $(EXTENSION)/.git diff --git a/extensions/vertical-workspaces/CHANGELOG.md b/extensions/vertical-workspaces/CHANGELOG.md new file mode 100644 index 0000000..a11360e --- /dev/null +++ b/extensions/vertical-workspaces/CHANGELOG.md @@ -0,0 +1,147 @@ +## Changelog: + +### v24 (not released yet) +**Added:** +- Support for horizontally stacked workspaces, available through `Workspaces Thumbnails Position` option. +- Options `Workspaces Scale` and `Workspaces Spacing` adjustments for workspace preview. +- Options `App Search Icon Size` with reduced spacing between icons and `Search Results Width`. +- Option `Workspace Switcher Animation` / `Static Backgroud` for static background while switching workspaces outside of the overview. +- Open preferences by middle click on *Show Applications button* in the dash (default dash only). +- Text shadow in labels of app grid view icons for better visibility on lighter backgrounds, in case you use `Show Static Background` option for the overview. + +**Fixed:** +- Improved blur effect transitions performance +- Smaller single windows not properly scaling with workspace preview in `Expose Windows on Hover` mode. +- (upstream bug) Closing windows in the overview fills log with "access to destroyed" object errors. + +**Other changes:** + + +### v23 (v19, v20, v21, v22) (2022-12-22) +**Added:** +- Overview modes `Expose Windows on Hover` and `Static Workspace` +- Option `Always Show Window Titles` +- Option `Dash Background Radius` +- Option `Animation Speed` + +**Fixed:** +- Startup animation can still freeze Shell in certain configuration. Injection replaced by complete override of the *startupAnimation()* function. +- Workaround for upstream bug - stuttering first animation of App Grid with many icons. + +**Other changes:** +- Preferences split into more sections for better readability. + +### v17, v18 (2022-12-07) +**Added:** +- Separate scales for blur amount in overview window picker and app grid/search results. +- Option `Smooth Blur Transitions` allows to disable smooth blur transitions on slower hw. + +**Fixed:** +- Startup animation can freeze Shell if `Show Workspace Preview Background` option disabled. +- Secondary workspace thumbnails not visible in overview after starting GS. +- Dash, WS thumbnails and Search entry animations exceptions. +- App grid animates over the Dash instead below it. + +**Other changes:** +- Default Dash background opacity set to 40. +- Workspace thumbnail caption style. + +### v16 (2022-12-05) +**Fixed:** +- Dash to Dock compatibility. +- Improved static background transitions. + +### v15 (2022-12-01) +**Fixed:** +- Dash / ws thumbnails shifted after disable, if ws preview background is disabled. +- Delayed dash / ws thumbnails animation after screen unlocks. + +### v14 (2022-11-29 e.g.o only) +**Added:** +- Option `Show Static Background` allows keep background wallpaper in the Activities overview. +- Slider `Blur Static Background` allows add blur to the static background image. +- Search result style - added bit of transparency to look better with static background. +- Link to changelog on About page. + +**Fixed:** +- Option `Override Page Up/Down Shortcuts` doesn't work reliably. + +**Other changes:** +- Next/Prev page indicators in GS43 are hard to switch from horizontal orientation to vertical, so for now I added style that makes them look more like vertical arrows indicating direction to the prev/next page. + +### v13 (2022-10-20) +**Added:** +- Horizontal 3 finger gesture automatically changes its direction depending on the workspace thumbnails position to match direction of the transition animation. +- Vertically oriented Dash items can be selected and activated even with the pointer at the edge of the screen. +- Option `Startup State` allows to change GNOME Shell's startup state from Overview to Desktop. +- Option `Always Show Search Entry` now allows showing the search entry even if the search is not active. + +**Fixed** +- 3 finger gestures not having proper orientation when used for the first time after enabling the extension. +- Dash overlapping workspace during transition between normal view and overview when using a 3 finger gesture. +- Dash icons can get out of border when dash size reach its maximum. +- Smaller workspace preview size if DtD set to auto-hide. +- Dash startup animation doesn't respect Dash position, workspace thumbnails don't animate at all. + +### v12 2022-09-04 +**Fixed:** +- Dash to Dock compatibility issue when original Dash set to vertical position + +### v11 2022-09-04 +**Added** +- Window preview app icon size +- About page +- Reset button that allows to set all options to their default values +- GNOME Shell 43 support +- Automatic `Fix for Dash to Dock` option activation when DtD detected during enabling + +**Fixed** +- App Grid page indicator not vertical +- Workspace thumbnail caption can show window title from different workspace (typically VBox Machine) + +### v10 2022-08-03 +**Added:** +- Option `Show Workspace Preview Background` allows to hide background wallpaper in the overview. + +**Fixed:** +- Broken overview after *Dash to Dock* disabled. + +**Other changes:** +- Preferences reorganized + +### v9 2022-07-31 +**Added:** +- Option `Show Workspace Labels` allows to show label on each workspace thumbnail. Options: `Index`, `Index + Workspace Name`, `Index + App Name` +- Option `Show Workspace Label on Hover` hides the labels until mouse hovers over a thumbnail. +- Option to hide Workspace Thumbnails on primary and secondary monitors individually in their position option list. +- Independent position adjustment for secondary monitors workspace thumbnails. +- Vertical workspace switcher popup. +- Settings page `Content` has been removed and `Disable` options were added to the position option list of the `Dash` and `Workspace Thumbnails`. + +### v8 22-07-27 +**Added:** +- **Vertical Dash** which can be placed at the left and right side of the screen, in addition to top and bottom positions. +- `Fine Tune Position` sliders for Dash and window switcher. +- `Dash Height Max Scale` option has been replaced by `Dash Max Icon Size` option which allows more precise setting. + +### v7 22-07-23 +**Fixed:** +- Fix of `Fix for Dash to Dock` + +### v6 22-07-23 +**Added:** +- Option `Auto` to App Grid Animation menu, changes animation direction according to workspace switcher position and visibility. +- Option `Fix for Dash to Dock` helps to keep VW consistent when DtD updates its position and while updating monitors configuration. + +**Fixed:** +- Dash position can be off a little bit with `Center Dash to WS` option. +- Secondary monitor overview transitions + +### v5 2022-07-20 +**Added:** +- `Content` page in Preferences window with options to hide Dash, workspace switcher and wallpaper in workspace thumbnails. +- New transition animations between Window Picker, App Grid and Desktop views. +- Workspace and App Grid animation options. +- Option to automatically switch `(Shift +) Super + Page Up/Down` keyboard shortcuts for the current workspace orientation. +- Option to expand workspace thumbnails to entire height of the work area at the expense of Dash width. + diff --git a/extensions/vertical-workspaces/LICENSE b/extensions/vertical-workspaces/LICENSE new file mode 100644 index 0000000..f288702 --- /dev/null +++ b/extensions/vertical-workspaces/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/extensions/vertical-workspaces/Makefile b/extensions/vertical-workspaces/Makefile new file mode 100644 index 0000000..b0afba4 --- /dev/null +++ b/extensions/vertical-workspaces/Makefile @@ -0,0 +1,90 @@ +SHELL := /bin/bash + +# Replace these with the name and domain of your extension! +NAME := vertical-workspaces +DOMAIN := G-dH.github.com +ZIP_NAME := $(NAME)@$(DOMAIN).zip + +# Some of the recipes below depend on some of these files. +JS_FILES = $(shell find -type f -and \( -name "*.js" \)) +UI_FILES = $(shell find -type f -and \( -name "*.ui" \)) +#RESOURCE_FILES = $(shell find resources -mindepth 2 -type f) +LOCALES_PO = $(wildcard po/*.po) +LOCALES_MO = $(patsubst po/%.po,locale/%/LC_MESSAGES/$(NAME).mo,$(LOCALES_PO)) + +# These files will be included in the extension zip file. +ZIP_CONTENT = $(JS_FILES) $(LOCALES_MO) \ + schemas/* schemas/gschemas.compiled metadata.json LICENSE stylesheet.css + +# These six recipes can be invoked by the user. +.PHONY: all zip install uninstall pot clean + +all: $(ZIP_CONTENT) + +# The zip recipes only bundles the extension without installing it. +zip: $(ZIP_NAME) + +# The install recipes creates the extension zip and installs it. +install: $(ZIP_NAME) + gnome-extensions install "$(ZIP_NAME)" --force + @echo "Extension installed successfully! Now restart the Shell ('Alt'+'F2', then 'r' or log out/log in on Wayland)." + +# This uninstalls the previously installed extension. +uninstall: + gnome-extensions uninstall "$(NAME)@$(DOMAIN)" + +# Use gettext to generate a translation template file. +pot: $(JS_FILES) $(UI_FILES) + @echo "Generating '$(NAME).pot'..." + @xgettext --from-code=UTF-8 \ + --add-comments=Translators \ + --copyright-holder="GdH" \ + --package-name="$(NAME)" \ + --output=po/$(NAME).pot \ + $(JS_FILES) $(UI_FILES) + +# This removes all temporary files created with the other recipes. +clean: + rm -rf $(ZIP_NAME) \ + schemas/gschemas.compiled \ + locale + +# This bundles the extension and checks whether it is small enough to be uploaded to +# extensions.gnome.org. We do not use "gnome-extensions pack" for this, as this is not +# readily available on the GitHub runners. +$(ZIP_NAME): $(ZIP_CONTENT) + @echo "Packing zip file..." + @rm --force $(ZIP_NAME) + @zip $(ZIP_NAME) -- $(ZIP_CONTENT) + + @#Check if the zip size is too big to be uploaded + @SIZE=$$(unzip -Zt $(ZIP_NAME) | awk '{print $$3}') ; \ + if [[ $$SIZE -gt 5242880 ]]; then \ + echo "ERROR! The extension is too big to be uploaded to" \ + "the extensions website, keep it smaller than 5 MB!"; \ + exit 1; \ + fi + +# Compiles the gschemas.compiled file from the gschema.xml file. +schemas/gschemas.compiled: schemas/org.gnome.shell.extensions.$(NAME).gschema.xml + @echo "Compiling schemas..." + @glib-compile-schemas schemas + +# Compiles the gresource file from the gresources.xml. +#resources/$(NAME).gresource: resources/$(NAME).gresource.xml +# @echo "Compiling resources..." +# @glib-compile-resources --sourcedir="resources" --generate resources/$(NAME).gresource.xml + +# Generates the gresources.xml based on all files in the resources subdirectory. +#resources/$(NAME).gresource.xml: $(RESOURCE_FILES) +# @echo "Creating resources xml..." +# @FILES=$$(find "resources" -mindepth 2 -type f -printf "%P\n" | xargs -i echo "{}") ; \ + echo " $$FILES " \ + > resources/$(NAME).gresource.xml + +# Compiles all *.po files to *.mo files. +locale/%/LC_MESSAGES/$(NAME).mo: po/%.po + @echo "Compiling $@" + @mkdir -p locale/$*/LC_MESSAGES + @msgfmt -c -o $@ $< + diff --git a/extensions/vertical-workspaces/README.md b/extensions/vertical-workspaces/README.md new file mode 100644 index 0000000..49faf8f --- /dev/null +++ b/extensions/vertical-workspaces/README.md @@ -0,0 +1,72 @@ +# V-Shell (former Vertical Workspaces) + +A GNOME Shell extension that lets you customize your desktop interface to suit your workflow and style. You can change the horizontal stacking of workspaces to vertical, but also change layout, content, appearance and behavior of the Shell. Forget Dash to Dock and similar dock extensions, with V-Shell you don't need it, just use Static Workspace option. + +Supported GNOME versions: 42, 43 (dropped support for 40, 41 - not tested). + +## Features +- Vertically or horizontally stacked workspaces. +- Position, orientation, scale and visibility of the overview content. +- Support for secondary monitors, workspaces thumbnails can be placed on the opposite side relative to primary monitor. Removes unnecessary transitions. +- Static background with blur adjustments. +- 2 overview modes with static windows/workspace that expose windows on hover/click on workspace thumbnail. The *Static Workspace* option allows you to use dash like a dock with auto-hide but with all advantages of the activities overview. +- Custom dash icons size and behavior when clicked. +- Dash background transparency and corner radius adjustments. +- App grid icon size, number of columns and rows. +- Custom search view width, app results icons size and number of result lists rows. +- Workspace thumbnails can show background wallpaper and labels (always or on mouse hover) with combination of workspace index, workspace name, name of the current application and current window title. +- Title captions of window previews moves into the preview (originally beneath the preview) and can be set as always visible. +- Static background in workspace switcher (outside overview). Keeps Conky below, DING desktop icons stay visible (if not covered by windows). +- More efficient and visually appealing transition animations (compared to the original Shell) that can be customized or disabled. +- Animation/transition speed adjustment. +- Window search provider with *Space* hotkey allows quick window navigation. +- Recent files search provider with *Ctrl + Space* hotkey. +- Reorder workspaces in overview using *Shift + Scroll* or *Shift + Page Up/Down* +- Adds *Force Quit*, *Close Windows on Current Workspace* and *Move Windows to Current Workspace* items to app icon menu. The latter action can be activated using *Shift + click* on app icon. + + +[](https://extensions.gnome.org/extension/5177/vertical-workspaces/) + +![Various Overview Layouts](screenshots/screenshot.jpg) + +## Installation + +### Installation from extensions.gnome.org +The easiest way to install the latest stable release of V-Shell: go to [extensions.gnome.org](https://extensions.gnome.org/extension/5177/vertical-workspaces/) and toggle the switch. + +### Installation from the latest Github release +Download the latest release archive using following command: + + wget https://github.com/G-dH/vertical-workspaces/releases/latest/download/vertical-workspaces@G-dH.github.com.zip + +Install the extension (`--force` switch needs to be used only if some version of the extension is already installed): + + gnome-extensions install --force vertical-workspaces@G-dH.github.com.zip + +### Installation from GitHub repository +The most recent version in the repository is the one I'm currently using and developing on my own systems, problems may occur, but usually nothing serious. The repository version may change often and doesn't updates automatically on your system, but once the stable release shows up on extensions.gnome.org, it should be updated automatically from there. If you want to help me, use this latest version and report bugs. +You may need to install `git`, `gettext` and `glib2.0` for successful installation. +Navigate to the directory you want to download the source code and execute following commands in the terminal: + + git clone https://github.com/G-dH/vertical-workspaces.git + cd vertical-workspaces + make install + +### Enabling the extension +After installation you need to enable the extension and access its settings. + +- First restart GNOME Shell (`ALt` + `F2`, `r`, `Enter`, or Log Out/Log In if you use Wayland) +- Now you should see *Vertical Workspaces* extension in *Extensions* application (re-open the app if needed to load new data), where you can enable it and access its Preferences window by pressing `Settings` button. + +## Credits +This extension uses customized utils and dash modules of the [Vertical Overview extension](https://github.com/RensAlthuis/vertical-overview). + +## Buy me a coffee +If you like my extensions and want to keep me motivated, you can also buy me a coffee: +[buymeacoffee.com/georgdh](https://buymeacoffee.com/georgdh) + +![Settings window](screenshots/screenshot1.png) +![Settings window](screenshots/screenshot2.png) +![Settings window](screenshots/screenshot3.png) +![Settings window](screenshots/screenshot4.png) +![Settings window](screenshots/screenshot5.png) \ No newline at end of file diff --git a/extensions/vertical-workspaces/appDisplay.js b/extensions/vertical-workspaces/appDisplay.js new file mode 100644 index 0000000..4690fcf --- /dev/null +++ b/extensions/vertical-workspaces/appDisplay.js @@ -0,0 +1,944 @@ +/** + * Vertical Workspaces + * appDisplay.js + * + * @author GdH + * @copyright 2022 - 2023 + * @license GPL-3.0 + * + */ + +'use strict'; + +const { Clutter, GLib, GObject, Graphene, Meta, Shell, St } = imports.gi; + +const DND = imports.ui.dnd; +const Main = imports.ui.main; +const AppDisplay = imports.ui.appDisplay; +const IconGrid = imports.ui.iconGrid; +const { AppMenu } = imports.ui.appMenu; +const PopupMenu = imports.ui.popupMenu; +const BoxPointer = imports.ui.boxpointer; + +const ExtensionUtils = imports.misc.extensionUtils; +const Me = ExtensionUtils.getCurrentExtension(); +const IconGridOverride = Me.imports.iconGrid; + +const _Util = Me.imports.util; +let _overrides; + +let _appGridLayoutSettings; +let _appDisplayScrollConId; +let _appSystemStateConId; +let _appGridLayoutConId; +let _updateAppGridTimeoutId; +let _origAppDisplayAcceptDrop; +let _origAppViewItemAcceptDrop; +let _origAppViewItemHandleDragOver; + +let opt; +let shellVersion = _Util.shellVersion; + + +function update(reset = false) { + if (_overrides) { + _overrides.removeAll(); + } + + if (reset) { + _setAppDisplayOrientation(false); + _updateAppGridProperties(reset); + _updateAppGridDND(reset); + _restoreOverviewGroup(); + _overrides = null; + opt = null; + return; + } + + opt = Me.imports.settings.opt; + + _overrides = new _Util.Overrides(); + + if (opt.ORIENTATION === Clutter.Orientation.VERTICAL) { + _overrides.addOverride('AppDisplayVertical', AppDisplay.AppDisplay.prototype, AppDisplayVertical); + _overrides.addOverride('BaseAppViewVertical', AppDisplay.BaseAppView.prototype, BaseAppViewVertical); + } + + _overrides.addOverride('AppSearchProvider', AppDisplay.AppSearchProvider.prototype, AppSearchProvider); + + // Custom App Grid + _overrides.addOverride('AppFolderDialog', AppDisplay.AppFolderDialog.prototype, AppFolderDialog); + if (shellVersion >= 43) { + // const defined class needs to be touched before real access + AppDisplay.BaseAppViewGridLayout; + _overrides.addOverride('BaseAppViewGridLayout', AppDisplay.BaseAppViewGridLayout.prototype, BaseAppViewGridLayout); + _overrides.addOverride('IconGrid', IconGrid.IconGrid.prototype, IconGridOverride.IconGrid); + } + _overrides.addOverride('FolderView', AppDisplay.FolderView.prototype, FolderView); + _overrides.addInjection('AppFolderDialog', AppDisplay.AppFolderDialog.prototype, AppFolderDialogInjections); + _overrides.addOverride('AppIcon', AppDisplay.AppIcon.prototype, AppIcon); + _overrides.addOverride('BaseAppView', AppDisplay.BaseAppView.prototype, BaseAppView); + _overrides.addOverride('AppDisplay', AppDisplay.AppDisplay.prototype, AppDisplayCommon); + + + _setAppDisplayOrientation(opt.ORIENTATION === Clutter.Orientation.VERTICAL); + _updateAppGridProperties(); + _updateAppGridDND(); +} + +//--------------------------------------------------------------------------------------------------------- + +function _setAppDisplayOrientation(vertical = false) { + const CLUTTER_ORIENTATION = vertical ? Clutter.Orientation.VERTICAL : Clutter.Orientation.HORIZONTAL; + const scroll = vertical ? 'vscroll' : 'hscroll'; + // app display to vertical has issues - page indicator not working + // global appDisplay orientation switch is not built-in + let appDisplay = Main.overview._overview._controls._appDisplay; + // following line itself only changes in which axis will operate overshoot detection which switches appDisplay pages while dragging app icon to vertical + appDisplay._orientation = CLUTTER_ORIENTATION; + appDisplay._grid.layoutManager._orientation = CLUTTER_ORIENTATION; + appDisplay._swipeTracker.orientation = CLUTTER_ORIENTATION; + appDisplay._swipeTracker._reset(); + if (vertical) { + appDisplay._scrollView.set_policy(St.PolicyType.NEVER, St.PolicyType.EXTERNAL); + + // move and change orientation of page indicators + // needs corrections in appgrid page calculations, e.g. appDisplay.adaptToSize() fnc, + // which complicates use of super call inside the function + const pageIndicators = appDisplay._pageIndicators; + pageIndicators.vertical = true; + appDisplay._box.vertical = false; + pageIndicators.x_expand = false; + pageIndicators.y_align = Clutter.ActorAlign.CENTER; + pageIndicators.x_align = Clutter.ActorAlign.START; + + const scrollContainer = appDisplay._scrollView.get_parent(); + if (shellVersion < 43) { + // remove touch friendly side navigation bars / arrows + appDisplay._hintContainer && scrollContainer.remove_child(appDisplay._hintContainer); + } else { + // moving these bars needs more patching of the appDisplay's code + // for now we just change bars style to be more like vertically oriented arrows indicating direction to prev/next page + appDisplay._nextPageIndicator.add_style_class_name('nextPageIndicator'); + appDisplay._prevPageIndicator.add_style_class_name('prevPageIndicator'); + } + + // setting their x_scale to 0 removes the arrows and avoid allocation issues compared to .hide() them + appDisplay._nextPageArrow.scale_x = 0; + appDisplay._prevPageArrow.scale_x = 0; + } else { + appDisplay._scrollView.set_policy(St.PolicyType.EXTERNAL, St.PolicyType.NEVER); + if (_appDisplayScrollConId) { + appDisplay._adjustment.disconnect(_appDisplayScrollConId); + _appDisplayScrollConId = 0; + } + + // restore original page indicators + const pageIndicators = appDisplay._pageIndicators; + pageIndicators.vertical = false; + appDisplay._box.vertical = true; + pageIndicators.x_expand = true; + pageIndicators.y_align = Clutter.ActorAlign.END; + pageIndicators.x_align = Clutter.ActorAlign.CENTER; + + // put back touch friendly navigation bars/buttons + const scrollContainer = appDisplay._scrollView.get_parent(); + appDisplay._hintContainer && appDisplay._hintContainer.get_parent() == null && scrollContainer.add_child(appDisplay._hintContainer); + appDisplay._nextPageArrow.scale_x = 1; + appDisplay._prevPageArrow.scale_x = 1; + + appDisplay._nextPageIndicator.remove_style_class_name('nextPageIndicator'); + appDisplay._prevPageIndicator.remove_style_class_name('prevPageIndicator'); + } + + // value for page indicator is calculated from scroll adjustment, horizontal needs to be replaced by vertical + appDisplay._adjustment = appDisplay._scrollView[scroll].adjustment; + + // no need to connect already connected signal (wasn't removed the original one before) + if (!vertical) { + // reset used appdisplay properties + Main.overview._overview._controls._appDisplay.scale_y = 1; + Main.overview._overview._controls._appDisplay.scale_x = 1; + Main.overview._overview._controls._appDisplay.opacity = 255; + return; + } + + // update appGrid dot pages indicators + _appDisplayScrollConId = appDisplay._adjustment.connect('notify::value', adj => { + const value = adj.value / adj.page_size; + appDisplay._pageIndicators.setCurrentPosition(value); + }); +} + +// Set App Grid columns, rows, icon size, incomplete pages +function _updateAppGridProperties(reset = false) { + // columns, rows, icon size + const appDisplay = Main.overview._overview._controls._appDisplay; + appDisplay.visible = true; + + // replace isFavorite function to always return false to allow dnd with favorite apps + if (!reset && opt.APP_GRID_INCLUDE_DASH) { + if (!appDisplay._appFavorites._backupIsFavorite) { + appDisplay._appFavorites._backupIsFavorite = appDisplay._appFavorites.isFavorite; + } + appDisplay._appFavorites.isFavorite = () => false; + } else { + if (appDisplay._appFavorites._backupIsFavorite) { + appDisplay._appFavorites.isFavorite = appDisplay._appFavorites._backupIsFavorite; + appDisplay._appFavorites._backupIsFavorite = undefined; + } + } + + if (reset) { + appDisplay._grid.layout_manager.fixedIconSize = -1; + appDisplay._grid.layoutManager.allow_incomplete_pages = true; + appDisplay._grid.setGridModes(); + if (_appGridLayoutSettings) { + _appGridLayoutSettings.disconnect(_appGridLayoutConId); + _appGridLayoutConId = 0; + _appGridLayoutSettings = null; + } + appDisplay._redisplay(); + // secondary call is necessary to properly update app grid + appDisplay._redisplay(); + } else { + // update grid on layout reset + if (!_appGridLayoutSettings) { + _appGridLayoutSettings = ExtensionUtils.getSettings('org.gnome.shell'); + _appGridLayoutConId = _appGridLayoutSettings.connect('changed::app-picker-layout', _resetAppGrid); + } + + // remove icons from App Grid + _resetAppGrid(); + + const updateGrid = function(rows, columns) { + if (rows === -1 || columns === -1) { + appDisplay._grid.setGridModes(); + } else { + appDisplay._grid.setGridModes( + [{ rows, columns }] + ); + } + appDisplay._grid._setGridMode(0); + } + + appDisplay._grid._currentMode = -1; + if (opt.APP_GRID_ALLOW_CUSTOM) { + updateGrid(opt.APP_GRID_ROWS, opt.APP_GRID_COLUMNS); + } else { + appDisplay._grid.setGridModes(); + updateGrid(-1, -1); + } + appDisplay._grid.layoutManager.fixedIconSize = opt.APP_GRID_ICON_SIZE; + appDisplay._grid.layoutManager.allow_incomplete_pages = opt.APP_GRID_ALLOW_INCOMPLETE_PAGES; + + // force rebuild icons. size shouldn't be the same as the current one, otherwise can be arbitrary + appDisplay._grid.layoutManager.adaptToSize(200, 200); + appDisplay._redisplay(); + + _realizeAppDisplay(); + } +} + +//------ App Grid - DND ---------------------------------------------------------- + +function _updateAppGridDND(reset) { + if (opt.APP_GRID_ORDER && !reset) { + if (!_appSystemStateConId) + _appSystemStateConId = Shell.AppSystem.get_default().connect('app-state-changed', () => Main.overview._overview._controls._appDisplay._redisplay()); + + // deny dnd from dash to app grid + if (!_origAppDisplayAcceptDrop) + _origAppDisplayAcceptDrop = AppDisplay.AppDisplay.prototype.acceptDrop; + AppDisplay.AppDisplay.prototype.acceptDrop = function() { return false; }; + + // deny creating folders by dnd on other icon + if (!_origAppViewItemHandleDragOver) + _origAppViewItemHandleDragOver = AppDisplay.AppViewItem.prototype.handleDragOver; + AppDisplay.AppViewItem.prototype.handleDragOver = () => DND.DragMotionResult.NO_DROP; + + if (!_origAppViewItemAcceptDrop) + _origAppViewItemAcceptDrop = AppDisplay.AppViewItem.prototype.acceptDrop; + AppDisplay.AppViewItem.prototype.acceptDrop = () => false; + } else { + if (_appSystemStateConId) { + Shell.AppSystem.get_default().disconnect(_appSystemStateConId); + _appSystemStateConId = 0; + } + + if (_origAppDisplayAcceptDrop) + AppDisplay.AppDisplay.prototype.acceptDrop = _origAppDisplayAcceptDrop; + + if (_origAppViewItemHandleDragOver) + AppDisplay.AppViewItem.prototype.handleDragOver = _origAppViewItemHandleDragOver; + + if (_origAppViewItemAcceptDrop) + AppDisplay.AppViewItem.prototype.acceptDrop = _origAppViewItemAcceptDrop; + } +} + +function _realizeAppDisplay() { + // force app grid to build all icons before the first visible animation to remove possible stuttering + // let the main loop realize previous changes before continuing + + // don't do this during shell startup + if (Main.layoutManager._startingUp) + return; + + if (_updateAppGridTimeoutId) { + GLib.source_remove(_updateAppGridTimeoutId); + } + + _updateAppGridTimeoutId = GLib.timeout_add( + GLib.PRIORITY_DEFAULT, + 1000, + () => { + Main.layoutManager.overviewGroup.opacity = 1; + Main.layoutManager.overviewGroup.scale_x = 0.1; + Main.layoutManager.overviewGroup.show(); + Main.overview.dash.showAppsButton.checked = true; + + GLib.source_remove(_updateAppGridTimeoutId); + + _updateAppGridTimeoutId = GLib.timeout_add(GLib.PRIORITY_DEFAULT, + 500, + () => { + _restoreOverviewGroup(); + _updateAppGridTimeoutId = 0; + return GLib.SOURCE_REMOVE; + }); + } + ); +} + +function _restoreOverviewGroup() { + Main.overview.dash.showAppsButton.checked = false; + Main.layoutManager.overviewGroup.opacity = 255; + Main.layoutManager.overviewGroup.scale_x = 1; + Main.layoutManager.overviewGroup.hide(); +} + +//------ appDisplay - Vertical -------------------------------------------------------------------------------- + +var AppDisplayVertical = { + // correction of the appGrid size when page indicators were moved from the bottom to the right + adaptToSize: function(width, height) { + const [, indicatorWidth] = this._pageIndicators.get_preferred_width(-1); + width -= indicatorWidth; + + this._grid.findBestModeForSize(width, height); + + const adaptToSize = AppDisplay.BaseAppView.prototype.adaptToSize.bind(this); + adaptToSize(width, height); + }, +} + + +//------ AppDisplay.AppSearchProvider ---------------------------------------------------------------------------------- + +// App search result size +var AppSearchProvider = { + createResultObject: function(resultMeta) { + if (resultMeta.id.endsWith('.desktop')) { + const icon = new AppDisplay.AppIcon(this._appSys.lookup_app(resultMeta['id']), { + expandTitleOnHover: false, + }); + icon.icon.setIconSize(opt.SEARCH_ICON_SIZE); + return icon; + } else { + const icon = new AppDisplay.SystemActionIcon(this, resultMeta); + icon.icon._setSizeManually = true; + icon.icon.setIconSize(opt.SEARCH_ICON_SIZE); + return icon; + } + } +} + +var BaseAppViewVertical = { + // this fixes dnd from appDisplay to the workspace thumbnail on the left if appDisplay is on page 1 because of appgrid left overshoot + _pageForCoords: function(x, y) { + return AppDisplay.SidePages.NONE; + }, +} + +// ------ AppDisplay - Custom App Grid ------------------------------------------------------------------------ + +var AppDisplayCommon = { + _ensureDefaultFolders: function() { + // disable creation of default folders if user deleted them + }, + + // apps load adapted for custom sorting and including dash items + _loadApps: function() { + let appIcons = []; + this._appInfoList = Shell.AppSystem.get_default().get_installed().filter(appInfo => { + try { + appInfo.get_id(); // catch invalid file encodings + } catch (e) { + return false; + } + return (opt.APP_GRID_INCLUDE_DASH || !this._appFavorites.isFavorite(appInfo.get_id())) && + this._parentalControlsManager.shouldShowApp(appInfo); + }); + + let apps = this._appInfoList.map(app => app.get_id()); + + let appSys = Shell.AppSystem.get_default(); + + const appsInsideFolders = new Set(); + this._folderIcons = []; + if (!opt.APP_GRID_ORDER) { + + let folders = this._folderSettings.get_strv('folder-children'); + folders.forEach(id => { + let path = `${this._folderSettings.path}folders/${id}/`; + let icon = this._items.get(id); + if (!icon) { + icon = new AppDisplay.FolderIcon(id, path, this); + icon.connect('apps-changed', () => { + this._redisplay(); + this._savePages(); + }); + icon.connect('notify::pressed', () => { + if (icon.pressed) + this.updateDragFocus(icon); + }); + } + + // Don't try to display empty folders + if (!icon.visible) { + icon.destroy(); + return; + } + + appIcons.push(icon); + this._folderIcons.push(icon); + + icon.getAppIds().forEach(appId => appsInsideFolders.add(appId)); + }); + } + + // Allow dragging of the icon only if the Dash would accept a drop to + // change favorite-apps. There are no other possible drop targets from + // the app picker, so there's no other need for a drag to start, + // at least on single-monitor setups. + // This also disables drag-to-launch on multi-monitor setups, + // but we hope that is not used much. + const isDraggable = + global.settings.is_writable('favorite-apps') || + global.settings.is_writable('app-picker-layout'); + + apps.forEach(appId => { + if (!opt.APP_GRID_ORDER && appsInsideFolders.has(appId)) + return; + + let icon = this._items.get(appId); + if (!icon) { + let app = appSys.lookup_app(appId); + + icon = new AppDisplay.AppIcon(app, { isDraggable }); + icon.connect('notify::pressed', () => { + if (icon.pressed) + this.updateDragFocus(icon); + }); + } + + appIcons.push(icon); + }); + + // At last, if there's a placeholder available, add it + if (this._placeholder) + appIcons.push(this._placeholder); + + //const runningIDs = Shell.AppSystem.get_default().get_running().map(app => app.get_id()); + + // remove running apps + /*if (!APP_GRID_INCLUDE_DASH) { // !icon.app means folder + appIcons = appIcons.filter((icon) => this._folderIcons.includes(icon) || !(runningIDs.includes(icon.app.id) || this._appFavorites.isFavorite(icon.id))); + }*/ + + return appIcons; + }, +} + +var BaseAppView = { + // adds sorting options and option to add favorites and running apps + _redisplay: function() { + let oldApps = this._orderedItems.slice(); + let oldAppIds = oldApps.map(icon => icon.id); + + let newApps = this._loadApps().sort(this._compareItems.bind(this)); + let newAppIds = newApps.map(icon => icon.id); + + let addedApps = newApps.filter(icon => !oldAppIds.includes(icon.id)); + let removedApps = oldApps.filter(icon => !newAppIds.includes(icon.id)); + + // Remove old app icons + removedApps.forEach(icon => { + this._removeItem(icon); + icon.destroy(); + }); + + // Add new app icons, or move existing ones + newApps.forEach(icon => { + const [page, position] = this._getItemPosition(icon); + if (addedApps.includes(icon)) + this._addItem(icon, page, position); + else if (page !== -1 && position !== -1) { + this._moveItem(icon, page, position); + } + + }); + + // Reorder App Grid by usage + // sort all alphabetically + if(opt.APP_GRID_ORDER > 0) { + const { itemsPerPage } = this._grid; + let appIcons = this._orderedItems; + appIcons.sort((a, b) => a.name.toLowerCase().localeCompare(b.name.toLowerCase())); + // then sort used apps by usage + if (opt.APP_GRID_ORDER === 2) { + appIcons.sort((a, b) => Shell.AppUsage.get_default().compare(a.app.id, b.app.id)); + } + // sort favorites first + if (opt.APP_GRID_INCLUDE_DASH === 2) { + const fav = Object.keys(this._appFavorites._favorites); + appIcons.sort((a, b) => { + let aFav = fav.indexOf(a.id); + if (aFav < 0) aFav = 999; + let bFav = fav.indexOf(b.id); + if (bFav < 0) bFav = 999; + return bFav < aFav; + }); + } + + // sort running first + if (opt.APP_GRID_INCLUDE_DASH === 2) { + appIcons.sort((a, b) => a.app.get_state() !== Shell.AppState.RUNNING && b.app.get_state() === Shell.AppState.RUNNING); + } + + appIcons.forEach((icon, i) => { + const page = Math.floor(i / itemsPerPage); + const position = i % itemsPerPage; + this._moveItem(icon, page, position); + }); + + this._orderedItems = appIcons; + } + + this.emit('view-loaded'); + }, + + _canAccept: function(source) { + return (opt.APP_GRID_ORDER ? false : source instanceof AppDisplay.AppViewItem); + }, + + // GS <= 42 only, Adapt app grid so it can use all available space + adaptToSize(width, height) { + let box = new Clutter.ActorBox({ + x2: width, + y2: height, + }); + box = this.get_theme_node().get_content_box(box); + box = this._scrollView.get_theme_node().get_content_box(box); + box = this._grid.get_theme_node().get_content_box(box); + + const availWidth = box.get_width(); + const availHeight = box.get_height(); + + const gridRatio = this._grid.layout_manager.columnsPerPage / + this._grid.layout_manager.rowsPerPage; + const spaceRatio = availWidth / availHeight; + let pageWidth, pageHeight; + + if (spaceRatio > gridRatio * 1.1) { + // Enough room for some preview + pageHeight = availHeight; + pageWidth = Math.ceil(availHeight * gridRatio); + + if (spaceRatio > gridRatio * 1.5) { + // Ultra-wide layout, give some extra space for + // the page area, but up to an extent. + const extraPageSpace = Math.min( + Math.floor((availWidth - pageWidth) / 2), 200); // AppDisplay.MAX_PAGE_PADDING == 200 + pageWidth += extraPageSpace; + this._grid.layout_manager.pagePadding.left = + Math.floor(extraPageSpace / 2); + this._grid.layout_manager.pagePadding.right = + Math.ceil(extraPageSpace / 2); + } + } else { + // Not enough room, needs to shrink horizontally + pageWidth = Math.ceil(availWidth * 0.95); // width limiter, original is 0.8 + pageHeight = availHeight; + this._grid.layout_manager.pagePadding.left = + Math.floor(availWidth * 0.02); + this._grid.layout_manager.pagePadding.right = + Math.ceil(availWidth * 0.02); + } + + this._grid.adaptToSize(pageWidth, pageHeight); + + const leftPadding = Math.floor( + (availWidth - this._grid.layout_manager.pageWidth) / 2); + const rightPadding = Math.ceil( + (availWidth - this._grid.layout_manager.pageWidth) / 2); + const topPadding = Math.floor( + (availHeight - this._grid.layout_manager.pageHeight) / 2); + const bottomPadding = Math.ceil( + (availHeight - this._grid.layout_manager.pageHeight) / 2); + + this._scrollView.content_padding = new Clutter.Margin({ + left: leftPadding, + right: rightPadding, + top: topPadding, + bottom: bottomPadding, + }); + + this._availWidth = availWidth; + this._availHeight = availHeight; + + this._pageIndicatorOffset = leftPadding; + this._pageArrowOffset = Math.max( + leftPadding - 80, 0); // 80 is AppDisplay.PAGE_PREVIEW_MAX_ARROW_OFFSET + } +} + +var BaseAppViewGridLayout = { + _getIndicatorsWidth(box) { + const [width, height] = box.get_size(); + const arrows = [ + this._nextPageArrow, + this._previousPageArrow, + ]; + + const minArrowsWidth = arrows.reduce( + (previousWidth, accessory) => { + const [min] = accessory.get_preferred_width(height); + return Math.max(previousWidth, min); + }, 0); + + const idealIndicatorWidth = (width * 0.1/*PAGE_PREVIEW_RATIO*/) / 2; + + return Math.max(idealIndicatorWidth, minArrowsWidth); + } +} + +// ------------------ AppDisplay.AppFolderDialog - injection -------------------------------------------------------------- + +var AppFolderDialogInjections = { + _init: function() { + const iconSize = opt.APP_GRID_FOLDER_ICON_SIZE < 0 ? 96 : opt.APP_GRID_FOLDER_ICON_SIZE; + let width = opt.APP_GRID_FOLDER_COLUMNS * (iconSize + 64); + width = Math.max(640, Math.round(width + width / 10)); + let height = opt.APP_GRID_FOLDER_ROWS * (iconSize + 64) + 150; + opt.APP_GRID_ALLOW_CUSTOM && this.child.set_style(` + width: ${width}px; + height: ${height}px; + padding: 30px; + `); + } +} + + +// ------------------ AppDisplay.FolderGrid ----------------------------------------------------------------------- + +var FolderView = { + _createGrid: function() { + let grid; + if (shellVersion < 43) { + grid = new FolderGrid(); + } else { + grid = new FolderGrid43(); + } + return grid; + } +} + +// folder columns and rows + +var FolderGrid = GObject.registerClass( +class FolderGrid extends IconGrid.IconGrid { + _init() { + super._init({ + allow_incomplete_pages: false, + columns_per_page: opt.APP_GRID_ALLOW_CUSTOM ? opt.APP_GRID_FOLDER_COLUMNS : 3, + rows_per_page: opt.APP_GRID_ALLOW_CUSTOM ? opt.APP_GRID_FOLDER_ROWS : 3, + page_halign: Clutter.ActorAlign.CENTER, + page_valign: Clutter.ActorAlign.CENTER, + }); + + opt.APP_GRID_ALLOW_CUSTOM && this.set_style('column-spacing: 10px; row-spacing: 10px;'); + this.layout_manager.fixedIconSize = opt.APP_GRID_FOLDER_ICON_SIZE; + } + + adaptToSize(width, height) { + this.layout_manager.adaptToSize(width, height); + } +}); + + +// only the first access to the const AppDisplay.AppGrid throws an error, so touch it before it's really needed +let FolderGrid43; +AppDisplay.AppGrid; +if (AppDisplay.AppGrid) { + FolderGrid43 = GObject.registerClass( + class FolderGrid43 extends AppDisplay.AppGrid { + _init() { + super._init({ + allow_incomplete_pages: false, + columns_per_page: opt.APP_GRID_ALLOW_CUSTOM ? opt.APP_GRID_FOLDER_COLUMNS : 3, + rows_per_page: opt.APP_GRID_ALLOW_CUSTOM ? opt.APP_GRID_FOLDER_ROWS : 3, + page_halign: Clutter.ActorAlign.CENTER, + page_valign: Clutter.ActorAlign.CENTER, + }); + + opt.APP_GRID_ALLOW_CUSTOM && this.set_style('column-spacing: 10px; row-spacing: 10px;'); + this.layout_manager.fixedIconSize = opt.APP_GRID_FOLDER_ICON_SIZE; + + this.setGridModes([ + { + rows: opt.APP_GRID_ALLOW_CUSTOM ? opt.APP_GRID_FOLDER_ROWS : 3, + columns: opt.APP_GRID_ALLOW_CUSTOM ? opt.APP_GRID_FOLDER_COLUMNS : 3, + }, + ]); + } + + adaptToSize(width, height) { + this.layout_manager.adaptToSize(width, height); + } + }); + +} + +var FOLDER_DIALOG_ANIMATION_TIME = 200; // AppDisplay.FOLDER_DIALOG_ANIMATION_TIME +var AppFolderDialog = { + _zoomAndFadeIn: function() { + let [sourceX, sourceY] = + this._source.get_transformed_position(); + let [dialogX, dialogY] = + this.child.get_transformed_position(); + + this.child.set({ + translation_x: sourceX - dialogX, + translation_y: sourceY - dialogY, + scale_x: this._source.width / this.child.width, + scale_y: this._source.height / this.child.height, + opacity: 0, + }); + + this.ease({ + background_color: Clutter.Color.from_pixel(0x00000033), // DIALOG_SHADE_NORMAL + duration: FOLDER_DIALOG_ANIMATION_TIME, + mode: Clutter.AnimationMode.EASE_OUT_QUAD, + }); + + + this.child.ease({ + translation_x: 0, + translation_y: 0, + scale_x: 1, + scale_y: 1, + opacity: 255, + duration: FOLDER_DIALOG_ANIMATION_TIME, + mode: Clutter.AnimationMode.EASE_OUT_QUAD, + }); + + this._needsZoomAndFade = false; + + if (this._sourceMappedId === 0) { + this._sourceMappedId = this._source.connect( + 'notify::mapped', this._zoomAndFadeOut.bind(this)); + } + }, +} + +function _resetAppGrid(settings = null, key = null) { + if (settings) { + const currentValue = JSON.stringify(settings.get_value('app-picker-layout').deep_unpack()); + const emptyValue = JSON.stringify([]); + if (key === 'app-picker-layout' && currentValue != emptyValue) + return; + } + const appDisplay = Main.overview._overview._controls._appDisplay; + const items = appDisplay._orderedItems; + for (let i = items.length - 1; i > -1; i--) { + Main.overview._overview._controls._appDisplay._removeItem(items[i]); + } + // redisplay only from callback + if (settings) + appDisplay._redisplay(); +} + +// ------------------ AppDisplay.AppIcon - override --------------------------------------------------------------- + +function _getWindowApp(metaWin) { + const tracker = Shell.WindowTracker.get_default(); + return tracker.get_window_app(metaWin); +} + +function _getAppLastUsedWindow(app) { + let recentWin; + global.display.get_tab_list(Meta.TabList.NORMAL_ALL, null).forEach(metaWin => { + const winApp = _getWindowApp(metaWin); + if (!recentWin && winApp == app) { + recentWin = metaWin; + } + }); + return recentWin; +} + +function _getAppRecentWorkspace(app) { + const recentWin = _getAppLastUsedWindow(app) + if (recentWin) + return recentWin.get_workspace(); + + return null; +} + +var AppIcon = { + activate: function(button) { + const event = Clutter.get_current_event(); + const modifiers = event ? event.get_state() : 0; + const isMiddleButton = button && button == Clutter.BUTTON_MIDDLE; + const isCtrlPressed = (modifiers & Clutter.ModifierType.CONTROL_MASK) != 0; + const isShiftPressed = (modifiers & Clutter.ModifierType.SHIFT_MASK) != 0; + const openNewWindow = this.app.can_open_new_window() && + this.app.state == Shell.AppState.RUNNING && + (isCtrlPressed || isMiddleButton); + + const currentWS = global.workspace_manager.get_active_workspace(); + const appRecentWorkspace = _getAppRecentWorkspace(this.app); + + let targetWindowOnCurrentWs = false; + if (opt.DASH_FOLLOW_RECENT_WIN) { + targetWindowOnCurrentWs = appRecentWorkspace === currentWS; + } else { + this.app.get_windows().forEach( + w => targetWindowOnCurrentWs = targetWindowOnCurrentWs || (w.get_workspace() === currentWS) + ); + } + + if ((this.app.state == Shell.AppState.STOPPED || openNewWindow) && !isShiftPressed) + this.animateLaunch(); + + if (openNewWindow) { + this.app.open_new_window(-1); + // if the app has more than one window (option: and has no window on the current workspace), + // don't activate the app, only move the overview to the workspace with the app's recent window + } else if (opt.DASH_SHOW_WINS_BEFORE && !isShiftPressed && this.app.get_n_windows() > 1 && !targetWindowOnCurrentWs) { + this._scroll = true; + this._scrollTime = Date.now(); + //const appWS = this.app.get_windows()[0].get_workspace(); + Main.wm.actionMoveWorkspace(appRecentWorkspace); + Main.overview.dash.showAppsButton.checked = false; + return; + } else if (opt.DASH_SHIFT_CLICK_MV && isShiftPressed && this.app.get_windows().length) { + this._moveAppToCurrentWorkspace(); + return; + } else if (isShiftPressed) { + return; + } else { + this.app.activate(); + } + + Main.overview.hide(); + }, + + _moveAppToCurrentWorkspace: function() { + this.app.get_windows().forEach(w => w.change_workspace(global.workspace_manager.get_active_workspace())); + }, + + popupMenu: function(side = St.Side.LEFT) { + if (shellVersion >= 42) + this.setForcedHighlight(true); + this._removeMenuTimeout(); + this.fake_release(); + + if (!this._getWindowsOnCurrentWs) { + this._getWindowsOnCurrentWs = function() { + const winList = []; + this.app.get_windows().forEach(w => { + if(w.get_workspace() === global.workspace_manager.get_active_workspace()) winList.push(w) + }); + return winList; + }; + + this._windowsOnOtherWs = function() { + return (this.app.get_windows().length - this._getWindowsOnCurrentWs().length) > 0; + }; + } + + if (!this._menu) { + this._menu = new AppMenu(this, side, { + favoritesSection: true, + showSingleWindows: true, + }); + + this._menu.setApp(this.app); + this._openSigId = this._menu.connect('open-state-changed', (menu, isPoppedUp) => { + if (!isPoppedUp) + this._onMenuPoppedDown(); + }); + //Main.overview.connectObject('hiding', + this._hidingSigId = Main.overview.connect('hiding', + () => this._menu.close(), this); + + Main.uiGroup.add_actor(this._menu.actor); + this._menuManager.addMenu(this._menu); + } + + // once the menu is created, it stays unchanged and we need to modify our items based on current situation + if (this._addedMenuItems && this._addedMenuItems.length) { + this._addedMenuItems.forEach(i => i.destroy()); + } + + const popupItems =[]; + + const separator = new PopupMenu.PopupSeparatorMenuItem(); + this._menu.addMenuItem(separator); + + if (this.app.get_n_windows()) { + if (/*opt.APP_MENU_FORCE_QUIT*/true) { + popupItems.push([_('Force Quit'), () => { + this.app.get_windows()[0].kill(); + }]); + } + + if (/*opt.APP_MENU_CLOSE_WS*/true) { + const nWin = this._getWindowsOnCurrentWs().length; + if (nWin) { + popupItems.push([_(`Close ${nWin} Windows on Current Workspace`), () => { + const windows = this._getWindowsOnCurrentWs(); + let time = global.get_current_time(); + for (let win of windows) { + // increase time by 1 ms for each window to avoid errors from GS + win.delete(time++); + } + }]); + } + } + + if (/*opt.APP_MENU_MV_TO_WS && */this._windowsOnOtherWs()) { + popupItems.push([_('Move App to Current Workspace'), this._moveAppToCurrentWorkspace]); + } + } + + this._addedMenuItems = []; + this._addedMenuItems.push(separator); + popupItems.forEach(i => { + let item = new PopupMenu.PopupMenuItem(i[0]); + this._menu.addMenuItem(item); + item.connect('activate', i[1].bind(this)); + this._addedMenuItems.push(item); + }); + + this.emit('menu-state-changed', true); + + this._menu.open(BoxPointer.PopupAnimation.FULL); + this._menuManager.ignoreRelease(); + this.emit('sync-tooltip'); + + return false; + } +} diff --git a/extensions/vertical-workspaces/dash.js b/extensions/vertical-workspaces/dash.js new file mode 100644 index 0000000..c4e3101 --- /dev/null +++ b/extensions/vertical-workspaces/dash.js @@ -0,0 +1,829 @@ +/** + * Vertical Workspaces + * dash.js + * + * @author GdH + * @copyright 2022-2023 + * @license GPL-3.0 + * modified dash module of https://github.com/RensAlthuis/vertical-overview extension + */ + +const { Clutter, GLib, GObject, Graphene, Meta, Shell, St } = imports.gi; +const AppDisplay = imports.ui.appDisplay; +const AppFavorites = imports.ui.appFavorites; +const DND = imports.ui.dnd; +const IconGrid = imports.ui.iconGrid; +const Main = imports.ui.main; +const Overview = imports.ui.overview; +const Dash = imports.ui.dash; +const { DashIcon, DashItemContainer, getAppFromSource, DragPlaceholderItem } = imports.ui.dash; + +const Me = imports.misc.extensionUtils.getCurrentExtension(); +const Util = Me.imports.util; +const _ = Me.imports.settings._; + +let verticalOverrides = {}; +let _origWorkId; +let _newWorkId; +let _showAppsIconBtnPressId; + +// added values to achieve better ability to scale down according the available space +var BaseIconSizes = [16, 24, 32, 40, 44, 48, 56, 64, 72, 80, 96, 112, 128]; + +const RecentFilesSearchProviderPrefix = Me.imports.recentFilesSearchProvider.prefix; +const WindowSearchProviderPrefix = Me.imports.windowSearchProvider.prefix; + +let _overrides; + +const DASH_ITEM_LABEL_SHOW_TIME = 150; + +let opt; + +function update(reset = false) { + if (_overrides) { + _overrides.removeAll(); + } + + opt = Me.imports.settings.opt; + const dash = Main.overview._overview._controls.layoutManager._dash; + + setToHorizontal(); + + dash.remove_style_class_name("vertical-overview"); + dash.remove_style_class_name("vertical-overview-left"); + dash.remove_style_class_name("vertical-overview-right"); + + if (reset) { + _moveDashAppGridIcon(reset); + _connectShowAppsIcon(reset); + _updateSearchWindowsIcon(false); + _updateRecentFilesIcon(false); + dash.visible = true; + dash._background.opacity = 255; + _overrides = null; + opt = null; + return; + } + + _overrides = new Util.Overrides(); + + _overrides.addOverride('DashItemContainer', Dash.DashItemContainer.prototype, DashItemContainerOverride); + _overrides.addOverride('DashCommon', Dash.Dash.prototype, DashCommonOverride); + + if (opt.DASH_VERTICAL) { + _overrides.addOverride('Dash', Dash.Dash.prototype, DashOverride); + setToVertical(); + dash.add_style_class_name("vertical-overview"); + + if (!_newWorkId) { + _origWorkId = dash._workId; + dash._workId = Main.initializeDeferredWork(dash._box, dash._redisplay.bind(dash)); + _newWorkId = dash._workId; + } else { + dash._workId = _newWorkId; + } + } else { + setToHorizontal(); + if (_origWorkId) + dash._workId = _origWorkId; + } + + _updateSearchWindowsIcon(); + _updateRecentFilesIcon(); + _moveDashAppGridIcon(); + _connectShowAppsIcon(); + + if (dash._showWindowsIcon && !dash._showWindowsIconClickedId) { + dash._showWindowsIconClickedId = dash._showWindowsIcon.toggleButton.connect('clicked', (a, c) => c && Util.activateSearchProvider(WindowSearchProviderPrefix)); + } + if (dash._recentFilesIcon && !dash._recentFilesIconClickedId) { + dash._recentFilesIconClickedId = dash._recentFilesIcon.toggleButton.connect('clicked', (a, c) => c && Util.activateSearchProvider(RecentFilesSearchProviderPrefix)); + } + Main.overview.dash._redisplay(); + Main.overview._overview._controls.layoutManager._dash.visible = opt.DASH_VISIBLE; +} + +function setToVertical() { + let dash = Main.overview._overview._controls.layoutManager._dash; + + dash._box.layout_manager.orientation = Clutter.Orientation.VERTICAL; + dash._dashContainer.layout_manager.orientation = Clutter.Orientation.VERTICAL; + dash._dashContainer.y_expand = false; + dash._dashContainer.x_expand = true; + dash.x_align = Clutter.ActorAlign.START; + dash.y_align = Clutter.ActorAlign.CENTER; + + let sizerBox = dash._background.get_children()[0]; + sizerBox.clear_constraints(); + sizerBox.add_constraint(new Clutter.BindConstraint({ + source: dash._showAppsIcon.icon, + coordinate: Clutter.BindCoordinate.WIDTH, + })); + sizerBox.add_constraint(new Clutter.BindConstraint({ + source: dash._dashContainer, + coordinate: Clutter.BindCoordinate.HEIGHT, + })); + dash._box.remove_all_children(); + dash._separator = null; + dash._queueRedisplay(); + dash._adjustIconSize(); + + dash.add_style_class_name(opt.DASH_LEFT ? 'vertical-overview-left' : 'vertical-overview-right'); +} + +function setToHorizontal() { + let dash = Main.overview._overview._controls.layoutManager._dash; + if (_origWorkId) + dash._workId = _origWorkId; //pretty sure this is a leak, but there no provided way to disconnect these... + dash._box.layout_manager.orientation = Clutter.Orientation.HORIZONTAL; + dash._dashContainer.layout_manager.orientation = Clutter.Orientation.HORIZONTAL; + dash._dashContainer.y_expand = true; + dash._dashContainer.x_expand = false; + dash.x_align = Clutter.ActorAlign.CENTER; + dash.y_align = 0; + + let sizerBox = dash._background.get_children()[0]; + sizerBox.clear_constraints(); + sizerBox.add_constraint(new Clutter.BindConstraint({ + source: dash._showAppsIcon.icon, + coordinate: Clutter.BindCoordinate.HEIGHT, + })); + sizerBox.add_constraint(new Clutter.BindConstraint({ + source: dash._dashContainer, + coordinate: Clutter.BindCoordinate.WIDTH, + })); + + dash._box.remove_all_children(); + dash._separator = null; + dash._queueRedisplay(); + dash._adjustIconSize(); +} + +function _moveDashAppGridIcon(reset = false) { + // move dash app grid icon to the front + const dash = Main.overview._overview._controls.layoutManager._dash; + + const appIconPosition = opt.get('showAppsIconPosition', true); + dash._showAppsIcon.remove_style_class_name('show-apps-icon-vertical-hide'); + dash._showAppsIcon.remove_style_class_name('show-apps-icon-horizontal-hide'); + dash._showAppsIcon.opacity = 255; + if (!reset && appIconPosition === 0) // 0 - start + dash._dashContainer.set_child_at_index(dash._showAppsIcon, 0); + if (reset || appIconPosition === 1) { // 1 - end + const index = dash._dashContainer.get_children().length - 1; + dash._dashContainer.set_child_at_index(dash._showAppsIcon, index); + } + if (!reset && appIconPosition === 2) {// 2 - hide + const style = opt.DASH_VERTICAL ? 'show-apps-icon-vertical-hide' : 'show-apps-icon-horizontal-hide'; + dash._showAppsIcon.add_style_class_name(style); + // for some reason even if the icon height in vertical mode should be set to 0 by the style, it stays visible in full size returning height 1px + dash._showAppsIcon.opacity = 0; + } +} + +function _connectShowAppsIcon(reset = false) { + if (!reset) { + if (_showAppsIconBtnPressId || Util.dashIsDashToDock()) { + // button is already connected || dash is Dash to Dock + return; + } + + Main.overview.dash._showAppsIcon.reactive = true; + _showAppsIconBtnPressId = Main.overview.dash._showAppsIcon.connect('button-press-event', (actor, event) => { + const button = event.get_button(); + if (button === Clutter.BUTTON_MIDDLE) { + Util.openPreferences(); + } else if (button === Clutter.BUTTON_SECONDARY) { + Util.activateSearchProvider(WindowSearchProviderPrefix); + } else { + return Clutter.EVENT_PROPAGATE; + } + }); + } else { + if (_showAppsIconBtnPressId) { + Main.overview.dash._showAppsIcon.disconnect(_showAppsIconBtnPressId); + _showAppsIconBtnPressId = 0; + Main.overview.dash._showAppsIcon.reactive = false; + } + } +} + +var DashOverride = { + handleDragOver: function (source, actor, _x, y, _time) { + let app = getAppFromSource(source); + + // Don't allow favoriting of transient apps + if (app == null || app.is_window_backed()) + return DND.DragMotionResult.NO_DROP; + + if (!global.settings.is_writable('favorite-apps')) + return DND.DragMotionResult.NO_DROP; + + let favorites = AppFavorites.getAppFavorites().getFavorites(); + let numFavorites = favorites.length; + + let favPos = favorites.indexOf(app); + + let children = this._box.get_children(); + let numChildren = children.length; + let boxHeight = this._box.height; + + // Keep the placeholder out of the index calculation; assuming that + // the remove target has the same size as "normal" items, we don't + // need to do the same adjustment there. + if (this._dragPlaceholder) { + boxHeight -= this._dragPlaceholder.height; + numChildren--; + } + + // Same with the separator + if (this._separator) { + boxHeight -= this._separator.height; + numChildren--; + } + + let pos; + if (!this._emptyDropTarget) + pos = Math.floor(y * numChildren / boxHeight); + else + pos = 0; // always insert at the top when dash is empty + + // Put the placeholder after the last favorite if we are not + // in the favorites zone + if (pos > numFavorites) + pos = numFavorites; + + if (pos !== this._dragPlaceholderPos && this._animatingPlaceholdersCount === 0) { + this._dragPlaceholderPos = pos; + + // Don't allow positioning before or after self + if (favPos != -1 && (pos == favPos || pos == favPos + 1)) { + this._clearDragPlaceholder(); + return DND.DragMotionResult.CONTINUE; + } + + // If the placeholder already exists, we just move + // it, but if we are adding it, expand its size in + // an animation + let fadeIn; + if (this._dragPlaceholder) { + this._dragPlaceholder.destroy(); + fadeIn = false; + } else { + fadeIn = true; + } + + this._dragPlaceholder = new DragPlaceholderItem(); + this._dragPlaceholder.child.set_width(this.iconSize / 2); + this._dragPlaceholder.child.set_height(this.iconSize); + this._box.insert_child_at_index(this._dragPlaceholder, + this._dragPlaceholderPos); + this._dragPlaceholder.show(fadeIn); + } + + if (!this._dragPlaceholder) + return DND.DragMotionResult.NO_DROP; + + let srcIsFavorite = favPos != -1; + + if (srcIsFavorite) + return DND.DragMotionResult.MOVE_DROP; + + return DND.DragMotionResult.COPY_DROP; + }, + + _redisplay: function () { + let favorites = AppFavorites.getAppFavorites().getFavoriteMap(); + + let running = this._appSystem.get_running(); + + let children = this._box.get_children().filter(actor => { + return actor.child && + actor.child._delegate && + actor.child._delegate.app; + }); + // Apps currently in the dash + let oldApps = children.map(actor => actor.child._delegate.app); + // Apps supposed to be in the dash + let newApps = []; + + for (let id in favorites) + newApps.push(favorites[id]); + + for (let i = 0; i < running.length; i++) { + let app = running[i]; + if (app.get_id() in favorites) + continue; + newApps.push(app); + } + + // Figure out the actual changes to the list of items; we iterate + // over both the list of items currently in the dash and the list + // of items expected there, and collect additions and removals. + // Moves are both an addition and a removal, where the order of + // the operations depends on whether we encounter the position + // where the item has been added first or the one from where it + // was removed. + // There is an assumption that only one item is moved at a given + // time; when moving several items at once, everything will still + // end up at the right position, but there might be additional + // additions/removals (e.g. it might remove all the launchers + // and add them back in the new order even if a smaller set of + // additions and removals is possible). + // If above assumptions turns out to be a problem, we might need + // to use a more sophisticated algorithm, e.g. Longest Common + // Subsequence as used by diff. + let addedItems = []; + let removedActors = []; + + let newIndex = 0; + let oldIndex = 0; + while (newIndex < newApps.length || oldIndex < oldApps.length) { + let oldApp = oldApps.length > oldIndex ? oldApps[oldIndex] : null; + let newApp = newApps.length > newIndex ? newApps[newIndex] : null; + + // No change at oldIndex/newIndex + if (oldApp == newApp) { + oldIndex++; + newIndex++; + continue; + } + + // App removed at oldIndex + if (oldApp && !newApps.includes(oldApp)) { + removedActors.push(children[oldIndex]); + oldIndex++; + continue; + } + + // App added at newIndex + if (newApp && !oldApps.includes(newApp)) { + addedItems.push({ + app: newApp, + item: this._createAppItem(newApp), + pos: newIndex + }); + newIndex++; + continue; + } + + // App moved + let nextApp = newApps.length > newIndex + 1 + ? newApps[newIndex + 1] : null; + let insertHere = nextApp && nextApp == oldApp; + let alreadyRemoved = removedActors.reduce((result, actor) => { + let removedApp = actor.child._delegate.app; + return result || removedApp == newApp; + }, false); + + if (insertHere || alreadyRemoved) { + let newItem = this._createAppItem(newApp); + addedItems.push({ + app: newApp, + item: newItem, + pos: newIndex + removedActors.length + }); + newIndex++; + } else { + removedActors.push(children[oldIndex]); + oldIndex++; + } + } + + for (let i = 0; i < addedItems.length; i++) { + this._box.insert_child_at_index(addedItems[i].item, + addedItems[i].pos); + } + + for (let i = 0; i < removedActors.length; i++) { + let item = removedActors[i]; + + // Don't animate item removal when the overview is transitioning + // or hidden + if (Main.overview.visible && !Main.overview.animationInProgress) + item.animateOutAndDestroy(); + else + item.destroy(); + } + + this._adjustIconSize(); + + // Skip animations on first run when adding the initial set + // of items, to avoid all items zooming in at once + + let animate = this._shownInitially && Main.overview.visible && + !Main.overview.animationInProgress; + + if (!this._shownInitially) + this._shownInitially = true; + + for (let i = 0; i < addedItems.length; i++) + addedItems[i].item.show(animate); + + // Update separator + const nFavorites = Object.keys(favorites).length; + const nIcons = children.length + addedItems.length - removedActors.length; + if (nFavorites > 0 && nFavorites < nIcons) { + // destroy the horizontal separator if it exists. + // this is incredibly janky, but I can't think of a better way atm. + if (this._separator && this._separator.height !== 1) { + this._separator.destroy(); + this._separator = null; + } + + if (!this._separator) { + this._separator = new St.Widget({ + style_class: 'dash-separator', + x_align: Clutter.ActorAlign.CENTER, + y_align: Clutter.ActorAlign.CENTER, + width: this.iconSize, + height: 1, + }); + this._box.add_child(this._separator) + } + + //FIXME: separator placement is broken (also in original dash) + let pos = nFavorites; + if (this._dragPlaceholder) + pos++; + this._box.set_child_at_index(this._separator, pos); + } else if (this._separator) { + this._separator.destroy(); + this._separator = null; + } + // Workaround for https://bugzilla.gnome.org/show_bug.cgi?id=692744 + // Without it, StBoxLayout may use a stale size cache + this._box.queue_relayout(); + }, + + _createAppItem: function (app) { + let appIcon = new DashIcon(app); + + let indicator = appIcon._dot; + indicator.x_align = opt.DASH_LEFT ? Clutter.ActorAlign.START : Clutter.ActorAlign.END; + indicator.y_align = Clutter.ActorAlign.CENTER; + + appIcon.connect('menu-state-changed', + (o, opened) => { + this._itemMenuStateChanged(item, opened); + }); + + let item = new DashItemContainer(); + item.setChild(appIcon); + + // Override default AppIcon label_actor, now the + // accessible_name is set at DashItemContainer.setLabelText + appIcon.label_actor = null; + item.setLabelText(app.get_name()); + + appIcon.icon.setIconSize(this.iconSize); + this._hookUpLabel(item, appIcon); + + return item; + } +} + +var DashItemContainerOverride = { + // move labels according dash position + showLabel: function() { + if (!this._labelText) + return; + + this.label.set_text(this._labelText); + this.label.opacity = 0; + this.label.show(); + + let [stageX, stageY] = this.get_transformed_position(); + + const itemWidth = this.allocation.get_width(); + const itemHeight = this.allocation.get_height(); + + const labelWidth = this.label.get_width(); + const labelHeight = this.label.get_height(); + const xOffset = Math.floor((itemWidth - labelWidth) / 2); + let x = Math.clamp(stageX + xOffset, 0, global.stage.width - labelWidth); + + let node = this.label.get_theme_node(); + let y; + + if (opt.DASH_TOP) { + const yOffset = itemHeight - labelHeight + 3 * node.get_length('-y-offset'); + y = stageY + yOffset; + + } else if (opt.DASH_BOTTOM) { + const yOffset = node.get_length('-y-offset'); + y = stageY - this.label.height - yOffset; + + } else if (opt.DASH_RIGHT) { + const yOffset = Math.floor((itemHeight - labelHeight) / 2); + + const xOffset = 4; + + x = stageX - xOffset - this.label.width; + y = Math.clamp(stageY + yOffset, 0, global.stage.height - labelHeight); + + } if (opt.DASH_LEFT) { + const yOffset = Math.floor((itemHeight - labelHeight) / 2); + + const xOffset = 4; + + x = stageX + this.width + xOffset; + y = Math.clamp(stageY + yOffset, 0, global.stage.height - labelHeight); + } + + this.label.set_position(x, y); + this.label.ease({ + opacity: 255, + duration: DASH_ITEM_LABEL_SHOW_TIME, + mode: Clutter.AnimationMode.EASE_OUT_QUAD, + }); + + this.label.set_position(x, y); + this.label.ease({ + opacity: 255, + duration: DASH_ITEM_LABEL_SHOW_TIME, + mode: Clutter.AnimationMode.EASE_OUT_QUAD, + }); + } +} + +var DashCommonOverride = { + _adjustIconSize: function () { + // For the icon size, we only consider children which are "proper" + // icons (i.e. ignoring drag placeholders) and which are not + // animating out (which means they will be destroyed at the end of + // the animation) + let iconChildren = this._box.get_children().filter(actor => { + return actor.child && + actor.child._delegate && + actor.child._delegate.icon && + !actor.animatingOut; + }); + + // add new custom icons into the calculation + if (this._showAppsIcon.visible) { + iconChildren.push(this._showAppsIcon); + } + if (this._showWindowsIcon) { + iconChildren.push(this._showWindowsIcon); + } + if (this._recentFilesIcon) { + iconChildren.push(this._recentFilesIcon); + } + + if (!iconChildren.length) return; + + if (this._maxWidth === -1 || this._maxHeight === -1) + return; + + const dashHorizontal = !opt.DASH_VERTICAL; + + const themeNode = this.get_theme_node(); + const maxAllocation = new Clutter.ActorBox({ + x1: 0, + y1: 0, + x2: dashHorizontal ? this._maxWidth : 42, // not whatever + y2: dashHorizontal ? 42 : this._maxHeight, + }); + + let maxContent = themeNode.get_content_box(maxAllocation); + + let spacing = themeNode.get_length('spacing'); + + let firstButton = iconChildren[0].child; + let firstIcon = firstButton._delegate.icon; + + if (!firstIcon.icon) return; + + // Enforce valid spacings during the size request + firstIcon.icon.ensure_style(); + const [, , iconWidth, iconHeight] = firstIcon.icon.get_preferred_size(); + const [, , buttonWidth, buttonHeight] = firstButton.get_preferred_size(); + + let availWidth, availHeight, maxIconSize; + if (dashHorizontal) { + availWidth = maxContent.x2 - maxContent.x1; + // Subtract icon padding and box spacing from the available width + availWidth -= iconChildren.length * (buttonWidth - iconWidth) + + (iconChildren.length - 1) * spacing + + 2 * this._background.get_theme_node().get_horizontal_padding(); + + availHeight = this._maxHeight; + availHeight -= this.margin_top + this.margin_bottom; + availHeight -= this._background.get_theme_node().get_vertical_padding(); + availHeight -= themeNode.get_vertical_padding(); + availHeight -= buttonHeight - iconHeight; + + maxIconSize = Math.min(availWidth / iconChildren.length, availHeight, opt.MAX_ICON_SIZE); + } else { + availWidth = this._maxWidth; + availWidth -= this._background.get_theme_node().get_horizontal_padding(); + availWidth -= themeNode.get_horizontal_padding(); + availWidth -= buttonWidth - iconWidth; + + availHeight = maxContent.y2 - maxContent.y1; + availHeight -= iconChildren.length * (buttonHeight - iconHeight) + + (iconChildren.length - 1) * spacing + + 2 * this._background.get_theme_node().get_vertical_padding(); + + maxIconSize = Math.min(availWidth, availHeight / iconChildren.length, opt.MAX_ICON_SIZE); + } + + let scaleFactor = St.ThemeContext.get_for_stage(global.stage).scale_factor; + let iconSizes = BaseIconSizes.map(s => s * scaleFactor); + + let newIconSize = BaseIconSizes[0]; + for (let i = 0; i < iconSizes.length; i++) { + if (iconSizes[i] <= maxIconSize) + newIconSize = BaseIconSizes[i]; + } + + /*if (newIconSize == this.iconSize) + return;*/ + + let oldIconSize = this.iconSize; + this.iconSize = newIconSize; + this.emit('icon-size-changed'); + + let scale = oldIconSize / newIconSize; + for (let i = 0; i < iconChildren.length; i++) { + let icon = iconChildren[i].child._delegate.icon; + + // Set the new size immediately, to keep the icons' sizes + // in sync with this.iconSize + icon.setIconSize(this.iconSize); + + // Don't animate the icon size change when the overview + // is transitioning, not visible or when initially filling + // the dash + if (!Main.overview.visible || Main.overview.animationInProgress || + !this._shownInitially) + continue; + + let [targetWidth, targetHeight] = icon.icon.get_size(); + + // Scale the icon's texture to the previous size and + // tween to the new size + icon.icon.set_size(icon.icon.width * scale, + icon.icon.height * scale); + + icon.icon.ease({ + width: targetWidth, + height: targetHeight, + duration: Dash.DASH_ANIMATION_TIME, + mode: Clutter.AnimationMode.EASE_OUT_QUAD, + }); + } + + if (this._separator) { + this._separator.ease({ + width: dashHorizontal ? 1 : this.iconSize, + height: dashHorizontal ? this.iconSize : 1, + duration: Dash.DASH_ANIMATION_TIME, + mode: Clutter.AnimationMode.EASE_OUT_QUAD, + }); + } + }, +} + +function _updateSearchWindowsIcon(show = opt.SHOW_WINDOWS_ICON) { + + const dash = Main.overview._overview._controls.layoutManager._dash; + const dashContainer = dash._dashContainer; + + if (dash._showWindowsIcon) { + dashContainer.remove_child(dash._showWindowsIcon); + dash._showWindowsIconClickedId && dash._showWindowsIcon.toggleButton.disconnect(dash._showWindowsIconClickedId); + dash._showWindowsIconClickedId = undefined; + dash._showWindowsIcon && dash._showWindowsIcon.destroy(); + dash._showWindowsIcon = undefined; + } + + if (!show || !opt.WINDOW_SEARCH_PROVIDER_ENABLED) return; + + if (!dash._showWindowsIcon) { + dash._showWindowsIcon = new ShowWindowsIcon(); + dash._showWindowsIcon.show(false); + dashContainer.add_child(dash._showWindowsIcon); + dash._hookUpLabel(dash._showWindowsIcon); + } + + dash._showWindowsIcon.icon.setIconSize(opt.MAX_ICON_SIZE); + if (opt.SHOW_WINDOWS_ICON === 1) { + dashContainer.set_child_at_index(dash._showWindowsIcon, 0); + } else if (opt.SHOW_WINDOWS_ICON === 2) { + index = dashContainer.get_children().length - 1; + dashContainer.set_child_at_index(dash._showWindowsIcon, index); + } + + Main.overview._overview._controls.layoutManager._dash._adjustIconSize(); +} + +var ShowWindowsIcon = GObject.registerClass( +class ShowWindowsIcon extends Dash.DashItemContainer { + _init() { + super._init(); + + this._labelText = _('Search Open Windows (Hotkey: Space)'); + this.toggleButton = new St.Button({ + style_class: 'show-apps', + track_hover: true, + can_focus: true, + toggle_mode: false, + }); + + this._iconActor = null; + this.icon = new IconGrid.BaseIcon(this.labelText, { + setSizeManually: true, + showLabel: false, + createIcon: this._createIcon.bind(this), + }); + this.icon.y_align = Clutter.ActorAlign.CENTER; + + this.toggleButton.add_actor(this.icon); + this.toggleButton._delegate = this; + + this.setChild(this.toggleButton); + } + + _createIcon(size) { + this._iconActor = new St.Icon({ + icon_name: 'focus-windows-symbolic', + icon_size: size, + style_class: 'show-apps-icon', + track_hover: true, + }); + return this._iconActor; + } +}); + +function _updateRecentFilesIcon(show = opt.SHOW_RECENT_FILES_ICON) { + + const dash = Main.overview._overview._controls.layoutManager._dash; + const dashContainer = dash._dashContainer; + + if (dash._recentFilesIcon) { + dashContainer.remove_child(dash._recentFilesIcon); + dash._recentFilesIconClickedId && dash._recentFilesIcon.toggleButton.disconnect(dash._recentFilesIconClickedId); + dash._recentFilesIconClickedId = undefined; + dash._recentFilesIcon && dash._recentFilesIcon.destroy(); + dash._recentFilesIcon = undefined; + } + + if (!show || !opt.RECENT_FILES_SEARCH_PROVIDER_ENABLED) return; + + if (!dash._recentFilesIcon) { + dash._recentFilesIcon = new ShowRecentFilesIcon(); + dash._recentFilesIcon.show(false); + dashContainer.add_child(dash._recentFilesIcon); + dash._hookUpLabel(dash._recentFilesIcon); + } + + dash._recentFilesIcon.icon.setIconSize(opt.MAX_ICON_SIZE); + if (opt.SHOW_RECENT_FILES_ICON === 1) { + dashContainer.set_child_at_index(dash._recentFilesIcon, 0); + } else if (opt.SHOW_RECENT_FILES_ICON === 2) { + index = dashContainer.get_children().length - 1; + dashContainer.set_child_at_index(dash._recentFilesIcon, index); + } + + Main.overview._overview._controls.layoutManager._dash._adjustIconSize(); +} + +var ShowRecentFilesIcon = GObject.registerClass( +class ShowRecentFilesIcon extends Dash.DashItemContainer { + _init() { + super._init(); + + this._labelText = _('Search Recent Files (Hotkey: Ctrl + Space)'); + this.toggleButton = new St.Button({ + style_class: 'show-apps', + track_hover: true, + can_focus: true, + toggle_mode: false, + }); + + this._iconActor = null; + this.icon = new IconGrid.BaseIcon(this.labelText, { + setSizeManually: true, + showLabel: false, + createIcon: this._createIcon.bind(this), + }); + this.icon.y_align = Clutter.ActorAlign.CENTER; + + this.toggleButton.add_actor(this.icon); + this.toggleButton._delegate = this; + + this.setChild(this.toggleButton); + } + + _createIcon(size) { + this._iconActor = new St.Icon({ + icon_name: 'document-open-recent-symbolic', + icon_size: size, + style_class: 'show-apps-icon', + track_hover: true, + }); + return this._iconActor; + } +}); diff --git a/extensions/vertical-workspaces/extension.js b/extensions/vertical-workspaces/extension.js new file mode 100644 index 0000000..dc05349 --- /dev/null +++ b/extensions/vertical-workspaces/extension.js @@ -0,0 +1,564 @@ +/** + * Vertical Workspaces + * extension.js + * + * @author GdH + * @copyright 2022 - 2023 + * @license GPL-3.0 + * + */ + +'use strict'; + +const { GLib, GObject, Meta, Shell, St } = imports.gi; + +const Main = imports.ui.main; + +const Util = imports.misc.util; +const Background = imports.ui.background; + +const ExtensionUtils = imports.misc.extensionUtils; +const Me = ExtensionUtils.getCurrentExtension(); +const Settings = Me.imports.settings; +const _Util = Me.imports.util; + +const WindowSearchProvider = Me.imports.windowSearchProvider; +const RecentFilesSearchProvider = Me.imports.recentFilesSearchProvider; +const LayoutOverride = Me.imports.layout; +const AppDisplayOverride = Me.imports.appDisplay; +const WorkspaceThumbnailOverride = Me.imports.workspaceThumbnail; +const WorkspaceOverride = Me.imports.workspace; +const WorkspacesViewOverride = Me.imports.workspacesView; +const WindowPreviewOverride = Me.imports.windowPreview; +const IconGridOverride = Me.imports.iconGrid; +const WorkspaceAnimationOverride = Me.imports.workspaceAnimation; +const WindowManagerOverride = Me.imports.windowManager; +const OverviewOverride = Me.imports.overview; +const OverviewControlsOverride = Me.imports.overviewControls; +const SwipeTrackerOverride = Me.imports.swipeTracker; +const WorkspaceSwitcherPopupOverride = Me.imports.workspaceSwitcherPopup; +const SearchOverride = Me.imports.search; +const PanelOverride = Me.imports.panel; +const DashOverride = Me.imports.dash; + + +let opt = null; + +let _bgManagers; +let _shellSettings; + +let _enabled; +let _resetExtensionIfEnabled; +let _prevDash; + +let _showingOverviewConId; +let _monitorsChangedSigId; +let _watchDockSigId; + +let _resetTimeoutId; + +// drop control for app grid sorting modes +let _appSystemStateSigId; +let _origAppViewItemAcceptDrop; +let _origAppViewItemHandleDragOver; +let _origAppDisplayAcceptDrop; + +let _enableTimeoutId = 0; + + + +function init() { + ExtensionUtils.initTranslations(); +} + +function enable() { + // globally readable flag for other extensions + global.verticalWorkspacesEnabled = true; + + _enableTimeoutId = GLib.timeout_add( + GLib.PRIORITY_DEFAULT, + 200, + () => { + activate(); + log(`${Me.metadata.name}: enabled`); + _enableTimeoutId = 0; + return GLib.SOURCE_REMOVE; + } + ); +} + +function disable() { + if (_enableTimeoutId) { + GLib.source_remove(_enableTimeoutId); + _enableTimeoutId = 0; + } else { + reset(); + } + global.verticalWorkspacesEnabled = undefined; + log(`${Me.metadata.name}: disabled`); +} + +//------------------------------------------------------------------------------------------ + +function activate() { + _enabled = true; + + _bgManagers = []; + + Settings.opt = new Settings.Options(); + opt = Settings.opt; + + _updateSettings(); + + opt.connect('changed', _updateSettings); + + _updateOverrides(); + + _prevDash = {}; + const dash = Main.overview.dash; + _prevDash.dash = dash; + _prevDash.position = dash.position; + + _monitorsChangedSigId = Main.layoutManager.connect('monitors-changed', () => _resetExtension(3000)); + + // static bg animations conflict with startup animation + // enable it on first hiding from the overview and disconnect the signal + _showingOverviewConId = Main.overview.connect('showing', _onShowingOverview); + + // if Dash to Dock detected force enable "Fix for DtD" option + if (_Util.dashIsDashToDock()) { + opt.set('fixUbuntuDock', true); + _fixUbuntuDock(true); + } else { + _fixUbuntuDock(opt.get('fixUbuntuDock')); + } + + // switch PageUp/PageDown workspace switcher shortcuts + _switchPageShortcuts(); + _setStaticBackground(!opt.SHOW_BG_IN_OVERVIEW); +} + +function reset() { + _enabled = 0; + + _fixUbuntuDock(false); + + const reset = true; + _updateOverrides(reset); + + if (_monitorsChangedSigId) { + Main.layoutManager.disconnect(_monitorsChangedSigId); + _monitorsChangedSigId = 0; + } + + _prevDash = null; + + // switch PageUp/PageDown workspace switcher shortcuts + _switchPageShortcuts(); + + _setStaticBackground(reset); + + // remove any position offsets from dash and ws thumbnails + if (!_Util.dashNotDefault()) { + Main.overview.dash.translation_x = 0; + Main.overview.dash.translation_y = 0; + } + Main.overview._overview._controls._thumbnailsBox.translation_x = 0; + Main.overview._overview._controls._thumbnailsBox.translation_y = 0; + Main.overview._overview._controls._searchEntryBin.translation_y = 0; + + Main.overview._overview._controls.set_child_above_sibling(Main.overview._overview._controls._workspacesDisplay, null); + + if (_showingOverviewConId) { + Main.overview.disconnect(_showingOverviewConId); + _showingOverviewConId = 0; + } + + St.Settings.get().slow_down_factor = 1; + + Main.overview.dash._background.set_style(''); + + opt.destroy(); + opt = null; +} + +function _updateOverrides(reset = false) { + WorkspacesViewOverride.update(reset); + WorkspaceThumbnailOverride.update(reset); + OverviewControlsOverride.update(reset); + OverviewOverride.update(reset); + + WorkspaceOverride.update(reset); + WindowPreviewOverride.update(reset); + WindowManagerOverride.update(reset); + + AppDisplayOverride.update(reset); + LayoutOverride.update(reset); + DashOverride.update(reset); + PanelOverride.update(reset); + + WorkspaceAnimationOverride.update(reset); + WorkspaceSwitcherPopupOverride.update(reset); + + SwipeTrackerOverride.update(reset); + + SearchOverride.update(reset); + WindowSearchProvider.update(reset); + RecentFilesSearchProvider.update(reset); +} + +function _onShowingOverview() { + // store pointer X coordinate for OVERVIEW_MODE 1 window spread - if mouse pointer is steady, don't spread + opt.showingPointerX = global.get_pointer()[0]; + + if (opt.FIX_UBUNTU_DOCK) { + // workaround for Ubuntu Dock breaking overview allocations after changing position + const dash = Main.overview.dash; + if (_prevDash.dash !== dash || _prevDash.position !== dash._position) { + _resetExtensionIfEnabled(0); + } + } +} + +function _resetExtension(timeout = 200) { + if (_resetTimeoutId) + GLib.source_remove(_resetTimeoutId); + _resetTimeoutId = GLib.timeout_add( + GLib.PRIORITY_DEFAULT, + timeout, + () => { + if (!_enabled) + return; + + const dash = Main.overview.dash; + if (!timeout && _prevDash.dash && dash !== _prevDash.dash) { // !timeout means DtD workaround callback + _prevDash.dash = dash; + log(`[${Me.metadata.name}]: Dash has been replaced, resetting extension...`); + reset(); + activate(); + } else if (timeout) { + log(`[${Me.metadata.name}]: resetting extension...`); + reset(); + activate(); + } + _resetTimeoutId = 0; + return GLib.SOURCE_REMOVE; + } + ); +} + +//----------------------------------------------------- + +function _fixUbuntuDock(activate = true) { + // Workaround for Ubuntu Dock breaking overview allocations after changing monitor configuration and deactivating dock + if (_shellSettings && _watchDockSigId) { + _shellSettings.disconnect(_watchDockSigId); + _watchDockSigId = 0; + } + _shellSettings = null; + + if (_resetTimeoutId) { + GLib.source_remove(_resetTimeoutId); + _resetTimeoutId = 0; + } + + _resetExtensionIfEnabled = () => {}; + + if (!activate) { + return; + } + + _shellSettings = ExtensionUtils.getSettings( 'org.gnome.shell'); + _watchDockSigId = _shellSettings.connect('changed::enabled-extensions', () => _resetExtension()); + _resetExtensionIfEnabled = _resetExtension; +} + +function _updateSettings(settings, key) { + opt._updateSettings(); + + opt.WORKSPACE_MIN_SPACING = Main.overview._overview._controls._thumbnailsBox.get_theme_node().get_length('spacing'); + // update variables that cannot be processed within settings + const dash = Main.overview.dash; + if (_Util.dashIsDashToDock()) { + opt.DASH_POSITION = dash._position; + opt.DASH_TOP = DASH_POSITION === 0; + opt.DASH_RIGHT = DASH_POSITION === 1; + opt.DASH_BOTTOM = DASH_POSITION === 2; + opt.DASH_LEFT = DASH_POSITION === 3; + opt.DASH_VERTICAL = DASH_LEFT || DASH_RIGHT; + } + + opt.MAX_ICON_SIZE = opt.get('dashMaxIconSize', true); + if (opt.MAX_ICON_SIZE < 16) { + opt.MAX_ICON_SIZE = 64; + opt.set('dashMaxIconSize', 64); + } + + imports.ui.workspace.WINDOW_PREVIEW_MAXIMUM_SCALE = 0.95; + + if (!_Util.dashIsDashToDock()) {// DtD has its own opacity control + Main.overview.dash._background.opacity = Math.round(opt.get('dashBgOpacity', true) * 2.5); // conversion % to 0-255 + const radius = opt.get('dashBgRadius', true); + if (radius) { + let style; + switch (opt.DASH_POSITION) { + case 1: + style = `border-radius: ${radius}px 0 0 ${radius}px;` + break; + case 3: + style = `border-radius: 0 ${radius}px ${radius}px 0;` + break; + default: + style = `border-radius: ${radius}px;` + } + Main.overview.dash._background.set_style(style); + } else { + Main.overview.dash._background.set_style(''); + } + } + + Main.overview.searchEntry.visible = opt.SHOW_SEARCH_ENTRY; + St.Settings.get().slow_down_factor = opt.ANIMATION_TIME_FACTOR; + imports.ui.search.MAX_LIST_SEARCH_RESULTS_ROWS = opt.SEARCH_MAX_ROWS; + opt.START_Y_OFFSET = (opt.PANEL_MODE === 1 && opt.PANEL_POSITION_TOP) ? Main.panel.height : 0; + + if (settings) + _applySettings(key); +} + +function _applySettings(key) { + _setStaticBackground(!opt.SHOW_BG_IN_OVERVIEW); + _updateOverviewTranslations(); + _switchPageShortcuts(); + + if (key === 'fix-ubuntu-dock') + _fixUbuntuDock(opt.get('fixUbuntuDock', true)); + if (key === 'ws-thumbnails-position') { + OverviewControlsOverride.update(); + WorkspaceThumbnailOverride.update(); + WorkspacesViewOverride.update(); + } + if (key?.includes('app-grid')) { + AppDisplayOverride.update(); + } + if (key?.includes('panel')) { + PanelOverride.update(); + } + if (key?.includes('dash') || key?.includes('app')) { + DashOverride.update(); + } + if (key === 'workspace-animation') { + WorkspaceAnimationOverride.update(); + } +} + +function _switchPageShortcuts() { + if (!opt.get('enablePageShortcuts', true)) + return; + + const vertical = global.workspaceManager.layout_rows === -1; + const schema = 'org.gnome.desktop.wm.keybindings'; + const settings = ExtensionUtils.getSettings(schema); + + const keyLeft = 'switch-to-workspace-left'; + const keyRight = 'switch-to-workspace-right'; + const keyUp = 'switch-to-workspace-up'; + const keyDown = 'switch-to-workspace-down'; + + const keyMoveLeft = 'move-to-workspace-left'; + const keyMoveRight = 'move-to-workspace-right'; + const keyMoveUp = 'move-to-workspace-up'; + const keyMoveDown = 'move-to-workspace-down'; + + const switchPrevSc = 'Page_Up'; + const switchNextSc = 'Page_Down'; + const movePrevSc = 'Page_Up'; + const moveNextSc = 'Page_Down'; + + let switchLeft = settings.get_strv(keyLeft); + let switchRight = settings.get_strv(keyRight); + let switchUp = settings.get_strv(keyUp); + let switchDown = settings.get_strv(keyDown); + + let moveLeft = settings.get_strv(keyMoveLeft); + let moveRight = settings.get_strv(keyMoveRight); + let moveUp = settings.get_strv(keyMoveUp); + let moveDown = settings.get_strv(keyMoveDown); + + if (vertical) { + switchLeft.includes(switchPrevSc) && switchLeft.splice(switchLeft.indexOf(switchPrevSc), 1); + switchRight.includes(switchNextSc) && switchRight.splice(switchRight.indexOf(switchNextSc), 1); + moveLeft.includes(movePrevSc) && moveLeft.splice(moveLeft.indexOf(movePrevSc), 1); + moveRight.includes(moveNextSc) && moveRight.splice(moveRight.indexOf(moveNextSc), 1); + + switchUp.includes(switchPrevSc) || switchUp.push(switchPrevSc); + switchDown.includes(switchNextSc) || switchDown.push(switchNextSc); + moveUp.includes(movePrevSc) || moveUp.push(movePrevSc); + moveDown.includes(moveNextSc) || moveDown.push(moveNextSc); + } else { + switchLeft.includes(switchPrevSc) || switchLeft.push(switchPrevSc); + switchRight.includes(switchNextSc) || switchRight.push(switchNextSc); + moveLeft.includes(movePrevSc) || moveLeft.push(movePrevSc); + moveRight.includes(moveNextSc) || moveRight.push(moveNextSc); + + switchUp.includes(switchPrevSc) && switchUp.splice(switchUp.indexOf(switchPrevSc), 1); + switchDown.includes(switchNextSc) && switchDown.splice(switchDown.indexOf(switchNextSc), 1); + moveUp.includes(movePrevSc) && moveUp.splice(moveUp.indexOf(movePrevSc), 1); + moveDown.includes(moveNextSc) && moveDown.splice(moveDown.indexOf(moveNextSc), 1); + } + + settings.set_strv(keyLeft, switchLeft); + settings.set_strv(keyRight, switchRight); + settings.set_strv(keyUp, switchUp); + settings.set_strv(keyDown, switchDown); + + settings.set_strv(keyMoveLeft, moveLeft); + settings.set_strv(keyMoveRight, moveRight); + settings.set_strv(keyMoveUp, moveUp); + settings.set_strv(keyMoveDown, moveDown); +} + + +function _shouldAnimateOverview() { + return !opt.SHOW_WS_PREVIEW_BG || opt.OVERVIEW_MODE2; +} + +function _updateOverviewTranslations(dash = null, tmbBox = null, searchEntryBin = null) { + dash = dash ?? Main.overview.dash; + tmbBox = tmbBox ?? Main.overview._overview._controls._thumbnailsBox; + searchEntryBin = searchEntryBin ?? Main.overview._overview._controls._searchEntryBin; + + if (!_shouldAnimateOverview()) { + tmbBox.translation_x = 0; + tmbBox.translation_y = 0; + dash.translation_x = 0; + dash.translation_y = 0; + searchEntryBin.translation_x = 0; + searchEntryBin.translation_y = 0; + return; + } + + const [tmbTranslation_x, tmbTranslation_y, dashTranslation_x, dashTranslation_y, searchTranslation_y] = _Util.getOverviewTranslations(opt, dash, tmbBox, searchEntryBin); + tmbBox.translation_x = tmbTranslation_x; + tmbBox.translation_y = tmbTranslation_y; + if (!_Util.dashNotDefault()) { // only if dash is not dash to dock + dash.translation_x = dashTranslation_x; + dash.translation_y = dashTranslation_y; + } + searchEntryBin.translation_y = searchTranslation_y; +} + +function _setStaticBackground(reset = false) { + _bgManagers.forEach((bg)=> { + Main.overview._overview._controls._stateAdjustment.disconnect(bg._fadeSignal); + bg.destroy(); + }); + + _bgManagers = []; + // if (!SHOW_BG_IN_OVERVIEW && SHOW_WS_PREVIEW_BG) the background is used for static transition from wallpaper to empty bg in the overview + if (reset || (!opt.SHOW_BG_IN_OVERVIEW && opt.SHOW_WS_PREVIEW_BG)) + return; + + for (const monitor of Main.layoutManager.monitors) { + const bgManager = new Background.BackgroundManager({ + monitorIndex: monitor.index, + container: Main.layoutManager.overviewGroup, + vignette: true, + }); + + bgManager.backgroundActor.content.vignette_sharpness = 0; + bgManager.backgroundActor.content.brightness = 1; + + + bgManager._fadeSignal = Main.overview._overview._controls._stateAdjustment.connect('notify::value', (v) => { + _updateStaticBackground(bgManager, v.value, v); + }); + + if (monitor.index === global.display.get_primary_monitor()) { + bgManager._primary = true; + _bgManagers.unshift(bgManager); // primary monitor first + } else { + bgManager._primary = false; + _bgManagers.push(bgManager); + } + } +} + +function _updateStaticBackground(bgManager, stateValue, stateAdjustment = null) { + if (!opt.SHOW_BG_IN_OVERVIEW && !opt.SHOW_WS_PREVIEW_BG) { + // if no bg shown in the overview, fade out the wallpaper + if (!(opt.OVERVIEW_MODE2 && opt.WORKSPACE_MODE && stateAdjustment?.getStateTransitionParams().finalState === 1)) + bgManager.backgroundActor.opacity = Util.lerp(255, 0, Math.min(stateValue, 1)); + } else { + let VIGNETTE, BRIGHTNESS, bgValue; + if (opt.OVERVIEW_MODE2 && stateValue <= 1 && !opt.WORKSPACE_MODE) { + VIGNETTE = 0; + BRIGHTNESS = 1; + bgValue = stateValue; + } else { + VIGNETTE = 0.2; + BRIGHTNESS = 0.95; + if (opt.OVERVIEW_MODE2 && stateValue > 1 && !opt.WORKSPACE_MODE) { + bgValue = stateValue - 1; + } else { + bgValue = stateValue; + } + } + + let blurEffect = bgManager.backgroundActor.get_effect('blur'); + if (!blurEffect) { + blurEffect = new Shell.BlurEffect({ + brightness: 1, + sigma: 0, + mode: Shell.BlurMode.ACTOR, + }) + bgManager.backgroundActor.add_effect_with_name('blur', blurEffect); + } + + bgManager.backgroundActor.content.vignette_sharpness = VIGNETTE; + bgManager.backgroundActor.content.brightness = BRIGHTNESS; + + let vignetteInit, brightnessInit, sigmaInit; + if (opt.SHOW_BG_IN_OVERVIEW && opt.SHOW_WS_PREVIEW_BG) { + vignetteInit = VIGNETTE; + brightnessInit = BRIGHTNESS; + sigmaInit = opt.OVERVIEW_BG_BLUR_SIGMA; + } else { + vignetteInit = 0; + brightnessInit = 1; + sigmaInit = 0 + } + + if (opt.OVERVIEW_MODE2) { + bgManager.backgroundActor.content.vignette_sharpness = Util.lerp(vignetteInit, VIGNETTE, bgValue); + bgManager.backgroundActor.content.brightness = Util.lerp(brightnessInit, BRIGHTNESS, bgValue); + } else { + bgManager.backgroundActor.content.vignette_sharpness = Util.lerp(vignetteInit, VIGNETTE, Math.min(stateValue, 1)); + bgManager.backgroundActor.content.brightness = Util.lerp(brightnessInit, BRIGHTNESS, Math.min(stateValue, 1)); + } + + if (opt.OVERVIEW_BG_BLUR_SIGMA || opt.APP_GRID_BG_BLUR_SIGMA) { + // reduce number of steps of blur transition to improve performance + const step = opt.SMOOTH_BLUR_TRANSITIONS ? 0.05 : 0.2; + const progress = stateValue - (stateValue % step); + if (opt.SHOW_WS_PREVIEW_BG && stateValue < 1) { // no need to animate transition, unless appGrid state is involved, static bg is covered by the ws preview bg + if (blurEffect.sigma !== opt.OVERVIEW_BG_BLUR_SIGMA) + blurEffect.sigma = opt.OVERVIEW_BG_BLUR_SIGMA; + } else if (stateValue < 1) { + const sigma = Math.round(Util.lerp(0, opt.OVERVIEW_BG_BLUR_SIGMA, progress)); + if (sigma !== blurEffect.sigma) { + blurEffect.sigma = sigma; + } + } else if (stateValue > 1 && bgManager._primary) { + const sigma = Math.round(Util.lerp(opt.OVERVIEW_BG_BLUR_SIGMA, opt.APP_GRID_BG_BLUR_SIGMA, progress - 1)); + if (sigma !== blurEffect.sigma) { + blurEffect.sigma = sigma; + } + } else if (stateValue === 1) { + blurEffect.sigma = opt.OVERVIEW_BG_BLUR_SIGMA; + } else if (stateValue === 0) { + blurEffect.sigma = 0; + } + } + } +} diff --git a/extensions/vertical-workspaces/iconGrid.js b/extensions/vertical-workspaces/iconGrid.js new file mode 100644 index 0000000..2b93efd --- /dev/null +++ b/extensions/vertical-workspaces/iconGrid.js @@ -0,0 +1,26 @@ +/** + * Vertical Workspaces + * iconGrid.js + * + * @author GdH + * @copyright 2022 - 2023 + * @license GPL-3.0 + * + */ + +'use strict'; + +// ------------------ IconGrid - override ------------------------------------------------------------------------- + +// workaround - silence page -2 error on gnome 43 during cleaning appgrid + +var IconGrid = { + getItemsAtPage: function(page) { + if (page < 0 || page > this.nPages) + return []; + //throw new Error(`Page ${page} does not exist at IconGrid`); + + const layoutManager = this.layout_manager; + return layoutManager.getItemsAtPage(page); + } +} \ No newline at end of file diff --git a/extensions/vertical-workspaces/layout.js b/extensions/vertical-workspaces/layout.js new file mode 100644 index 0000000..29d97ad --- /dev/null +++ b/extensions/vertical-workspaces/layout.js @@ -0,0 +1,71 @@ +/** + * Vertical Workspaces + * layout.js + * + * panel barrier should follow panel position + * or disable it to not collide with Custom Hot Corners barriers + * + * @author GdH + * @copyright 2022 - 2023 + * @license GPL-3.0 + * + */ + +'use strict'; + +const { Meta } = imports.gi; + +const Main = imports.ui.main; +const Layout = imports.ui.layout; + +const Me = imports.misc.extensionUtils.getCurrentExtension(); +const _Util = Me.imports.util; + +let _overrides; +let opt; + +function update(reset = false) { + if (_overrides) { + _overrides.removeAll(); + } + + if (reset) { + _overrides = null; + opt = null; + return; + } + + opt = Me.imports.settings.opt; + + _overrides = new _Util.Overrides(); + + _overrides.addOverride('LayoutManager', Layout.LayoutManager.prototype, LayoutManager); + + Main.layoutManager._updatePanelBarrier(); +} + +var LayoutManager = { + _updatePanelBarrier: function() { + if (this._rightPanelBarrier) { + this._rightPanelBarrier.destroy(); + this._rightPanelBarrier = null; + } + + // disable the barrier + return; + + if (!this.primaryMonitor) + return; + + if (this.panelBox.height) { + let primary = this.primaryMonitor; + + this._rightPanelBarrier = new Meta.Barrier({ + display: global.display, + x1: primary.x + primary.width, y1: opt.PANEL_POSITION_TOP ? primary.y : primary.y + primary.height - this.panelBox.height, + x2: primary.x + primary.width, y2: opt.PANEL_POSITION_TOP ? primary.y + this.panelBox.height : primary.y + primary.height, + directions: Meta.BarrierDirection.NEGATIVE_X, + }); + } + } +} diff --git a/extensions/vertical-workspaces/metadata.json b/extensions/vertical-workspaces/metadata.json new file mode 100644 index 0000000..ddc48be --- /dev/null +++ b/extensions/vertical-workspaces/metadata.json @@ -0,0 +1,13 @@ +{ + "name": "Vertical Workspaces", + "uuid": "vertical-workspaces@G-dH.github.com", + "description": "A extension that allows you to customize your desktop interface to suit your workflow and eyes. You can change the horizontal stacking of workspaces to vertical, but also change layout, content, appearance and behavior of Activities overview and workspace switcher.", + "shell-version": [ + "42", + "43" + ], + "url": "https://github.com/G-dH/vertical-workspaces", + "gettext-domain": "vertical-workspaces", + "settings-schema": "org.gnome.shell.extensions.vertical-workspaces", + "version": 23.5 +} diff --git a/extensions/vertical-workspaces/optionsFactory.js b/extensions/vertical-workspaces/optionsFactory.js new file mode 100644 index 0000000..bfaaec6 --- /dev/null +++ b/extensions/vertical-workspaces/optionsFactory.js @@ -0,0 +1,552 @@ +/** + * Vertical Workspaces + * optionsFactory.js + * + * @author GdH + * @copyright 2022 - 2023 + * @license GPL-3.0 + */ + +'use strict'; + +const { Gtk, Gio, GObject } = imports.gi; + +const ExtensionUtils = imports.misc.extensionUtils; +const Me = ExtensionUtils.getCurrentExtension(); +const Settings = Me.imports.settings; + +const shellVersion = Settings.shellVersion; + +// gettext +const _ = Settings._; + +// libadwaita is available starting with GNOME Shell 42. +let Adw = null; +try { Adw = imports.gi.Adw; } catch (e) {} + +function _newImageFromIconName(name) { + return Gtk.Image.new_from_icon_name(name); +} + +var ItemFactory = class ItemFactory { + constructor(gOptions) { + this._gOptions = gOptions; + this._settings = this._gOptions._gsettings; + } + + getRowWidget(text, caption, widget, variable, options = []) { + + let item = []; + let label; + if (widget) { + label = new Gtk.Box({ + orientation: Gtk.Orientation.VERTICAL, + spacing: 4, + halign: Gtk.Align.START, + valign: Gtk.Align.CENTER, + }); + const option = new Gtk.Label({ + halign: Gtk.Align.START, + }); + option.set_text(text); + label.append(option); + + if (caption) { + const captionLabel = new Gtk.Label({ + halign: Gtk.Align.START, + wrap: true, + /*width_chars: 80,*/ + xalign: 0 + }) + const context = captionLabel.get_style_context(); + context.add_class('dim-label'); + context.add_class('caption'); + captionLabel.set_text(caption); + label.append(captionLabel); + } + label._title = text; + } else { + label = text; + } + item.push(label); + item.push(widget); + + let key; + + if (variable && this._gOptions.options[variable]) { + const opt = this._gOptions.options[variable]; + key = opt[1]; + } + + if (widget) { + if (widget._is_switch) { + this._connectSwitch(widget, key, variable); + } else if (widget._is_spinbutton || widget._is_scale) { + this._connectSpinButton(widget, key, variable); + } else if (widget._is_combo_box) { + this._connectComboBox(widget, key, variable, options); + } else if (widget._is_drop_down) { + this._connectDropDown(widget, key, variable, options); + } + } + + return item; + } + + _connectSwitch(widget, key, variable) { + this._settings.bind(key, widget, 'active', Gio.SettingsBindFlags.DEFAULT); + } + + _connectSpinButton(widget, key, variable) { + this._settings.bind(key, widget.adjustment, 'value', Gio.SettingsBindFlags.DEFAULT); + } + + _connectComboBox(widget, key, variable, options) { + let model = widget.get_model(); + widget._comboMap = {}; + const currentValue = this._gOptions.get(variable); + for (const [label, value] of options) { + let iter; + model.set(iter = model.append(), [0, 1], [label, value]); + if (value === currentValue) { + widget.set_active_iter(iter); + } + widget._comboMap[value] = iter; + } + this._gOptions.connect(`changed::${key}`, () => { + widget.set_active_iter(widget._comboMap[this._gOptions.get(variable, true)]); + }); + widget.connect('changed', () => { + const [success, iter] = widget.get_active_iter(); + + if (!success) return; + + this._gOptions.set(variable, model.get_value(iter, 1)); + }); + } + + _connectDropDown(widget, key, variable, options) { + const model = widget.get_model(); + const currentValue = this._gOptions.get(variable); + for (let i = 0; i < options.length; i++) { + const text = options[i][0]; + const id = options[i][1]; + model.append(new DropDownItem({ text, id })); + if (id === currentValue) { + widget.set_selected(i); + } + } + + const factory = new Gtk.SignalListItemFactory(); + factory.connect("setup", (factory, list_item) => { + const label = new Gtk.Label({xalign: 0}); + list_item.set_child(label); + }); + factory.connect("bind", (factory, list_item) => { + const label = list_item.get_child(); + const item = list_item.get_item(); + label.set_text(item.text); + }); + + widget.connect("notify::selected-item", (dropDown) => { + const item = dropDown.get_selected_item(); + this._gOptions.set(variable, item.id); + }); + + this._gOptions.connect(`changed::${key}`, () => { + const newId = this._gOptions.get(variable, true); + for (let i = 0; i < options.length; i++) { + const id = options[i][1]; + if (id === newId) { + widget.set_selected(i); + } + } + }); + + widget.set_factory(factory); + } + + newSwitch() { + let sw = new Gtk.Switch({ + halign: Gtk.Align.END, + valign: Gtk.Align.CENTER, + hexpand: true, + }); + sw._is_switch = true; + return sw; + } + + newSpinButton(adjustment) { + let spinButton = new Gtk.SpinButton({ + halign: Gtk.Align.END, + valign: Gtk.Align.CENTER, + hexpand: true, + vexpand: false, + xalign: 0.5, + }); + spinButton.set_adjustment(adjustment); + spinButton._is_spinbutton = true; + return spinButton; + } + + newComboBox() { + const model = new Gtk.ListStore(); + model.set_column_types([GObject.TYPE_STRING, GObject.TYPE_INT]); + const comboBox = new Gtk.ComboBox({ + model, + halign: Gtk.Align.END, + valign: Gtk.Align.CENTER, + hexpand: true, + }); + const renderer = new Gtk.CellRendererText(); + comboBox.pack_start(renderer, true); + comboBox.add_attribute(renderer, 'text', 0); + comboBox._is_combo_box = true; + return comboBox; + } + + newDropDown() { + const dropDown = new Gtk.DropDown({ + model: new Gio.ListStore({ + item_type: DropDownItem + }), + halign: Gtk.Align.END, + valign: Gtk.Align.CENTER, + hexpand: true, + }); + dropDown._is_drop_down = true; + return dropDown; + } + + newScale(adjustment) { + const scale = new Gtk.Scale({ + orientation: Gtk.Orientation.HORIZONTAL, + draw_value: true, + has_origin: false, + value_pos: Gtk.PositionType.LEFT, + digits: 0, + halign: Gtk.Align.END, + valign: Gtk.Align.CENTER, + hexpand: true, + vexpand: false, + }); + scale.set_size_request(300, -1); + scale.set_adjustment(adjustment); + scale._is_scale = true; + return scale; + } + + newLabel(text = '') { + const label = new Gtk.Label({ + label: text, + halign: Gtk.Align.END, + valign: Gtk.Align.CENTER, + hexpand: true, + }); + label._activatable = false; + return label; + } + + newLinkButton(uri) { + const linkBtn = new Gtk.LinkButton({ + label: shellVersion < 42 ? 'Click Me!' : '', + uri, + halign: Gtk.Align.END, + valign: Gtk.Align.CENTER, + hexpand: true, + }); + return linkBtn; + } + + newResetButton(callback) { + const btn = new Gtk.Button({ + halign: Gtk.Align.END, + valign: Gtk.Align.CENTER, + hexpand: true, + css_classes: ['destructive-action'], + icon_name: 'view-refresh-symbolic' + }); + + btn.connect('clicked', callback); + btn._activatable = false; + return btn; + } + + newOptionsResetButton() { + const btn = new Gtk.Button({ + halign: Gtk.Align.END, + valign: Gtk.Align.CENTER, + hexpand: true, + css_classes: ['destructive-action'], + icon_name: 'view-refresh-symbolic' + }); + + btn.connect('clicked', () => { + const settings = this._settings; + settings.list_keys().forEach( + key => settings.reset(key) + ); + }); + btn._activatable = false; + return btn; + } +} + +var AdwPrefs = class { + constructor(gOptions) { + this._gOptions = gOptions; + } + + getFilledWindow(window, pages) { + for (let page of pages) { + const title = page.title; + const icon_name = page.iconName; + const optionList = page.optionList; + + window.add( + this._getAdwPage(optionList, { + title, + icon_name + }) + ); + } + + window.set_search_enabled(true); + + return window; + } + + _getAdwPage(optionList, pageProperties = {}) { + pageProperties.width_request = 840; + const page = new Adw.PreferencesPage(pageProperties); + let group; + for (let item of optionList) { + // label can be plain text for Section Title + // or GtkBox for Option + const option = item[0]; + const widget = item[1]; + if (!widget) { + if (group) { + page.add(group); + } + group = new Adw.PreferencesGroup({ + title: option, + hexpand: true, + width_request: 700 + }); + continue; + } + + const row = new Adw.ActionRow({ + title: option._title, + }); + + const grid = new Gtk.Grid({ + column_homogeneous: false, + column_spacing: 20, + margin_start: 8, + margin_end: 8, + margin_top: 8, + margin_bottom: 8, + hexpand: true, + }) + /*for (let i of item) { + box.append(i);*/ + grid.attach(option, 0, 0, 1, 1); + if (widget) { + grid.attach(widget, 1, 0, 1, 1); + } + row.set_child(grid); + if (widget._activatable === false) { + row.activatable = false; + } else { + row.activatable_widget = widget; + } + group.add(row); + } + page.add(group); + return page; + } +} + +var LegacyPrefs = class { + constructor(gOptions) { + this._gOptions = gOptions; + } + + getPrefsWidget(pages) { + const prefsWidget = new Gtk.Box({ + orientation: Gtk.Orientation.VERTICAL + }); + const stack = new Gtk.Stack({ + hexpand: true + }); + const stackSwitcher = new Gtk.StackSwitcher({ + halign: Gtk.Align.CENTER, + hexpand: true + }); + + const context = stackSwitcher.get_style_context(); + context.add_class('caption'); + + stackSwitcher.set_stack(stack); + stack.set_transition_duration(300); + stack.set_transition_type(Gtk.StackTransitionType.SLIDE_LEFT_RIGHT); + + const pageProperties = { + hscrollbar_policy: Gtk.PolicyType.NEVER, + vscrollbar_policy: Gtk.PolicyType.AUTOMATIC, + vexpand: true, + hexpand: true, + visible: true + }; + + const pagesBtns = []; + + for (let page of pages) { + const name = page.name; + const title = page.title; + const iconName = page.iconName; + const optionList = page.optionList; + + stack.add_named(this._getLegacyPage(optionList, pageProperties), name); + pagesBtns.push( + [new Gtk.Label({ label: title}), _newImageFromIconName(iconName, Gtk.IconSize.BUTTON)] + ); + } + + let stBtn = stackSwitcher.get_first_child ? stackSwitcher.get_first_child() : null; + for (let i = 0; i < pagesBtns.length; i++) { + const box = new Gtk.Box({orientation: Gtk.Orientation.VERTICAL, spacing: 6, visible: true}); + const icon = pagesBtns[i][1]; + icon.margin_start = 30; + icon.margin_end = 30; + box.append(icon); + box.append(pagesBtns[i][0]); + if (stackSwitcher.get_children) { + stBtn = stackSwitcher.get_children()[i]; + stBtn.add(box); + } else { + stBtn.set_child(box); + stBtn.visible = true; + stBtn = stBtn.get_next_sibling(); + } + } + + stack.show_all && stack.show_all(); + stackSwitcher.show_all && stackSwitcher.show_all(); + + prefsWidget.append(stack); + + prefsWidget.show_all && prefsWidget.show_all(); + + prefsWidget._stackSwitcher = stackSwitcher; + + return prefsWidget; + } + + _getLegacyPage(optionList, pageProperties) { + const page = new Gtk.ScrolledWindow(pageProperties); + const mainBox = new Gtk.Box({ + orientation: Gtk.Orientation.VERTICAL, + spacing: 5, + homogeneous: false, + margin_start: 30, + margin_end: 30, + margin_top: 12, + margin_bottom: 12, + }); + + const context = page.get_style_context(); + context.add_class('background'); + + let frame; + let frameBox; + for (let item of optionList) { + // label can be plain text for Section Title + // or GtkBox for Option + const option = item[0]; + const widget = item[1]; + + if (!widget) { + const lbl = new Gtk.Label({ + label: option, + xalign: 0, + margin_bottom: 4 + }); + + const context = lbl.get_style_context(); + context.add_class('heading'); + + mainBox.append(lbl); + + frame = new Gtk.Frame({ + margin_bottom: 16 + }); + + frameBox = new Gtk.ListBox({ + selection_mode: null + }); + + mainBox.append(frame); + frame.set_child(frameBox); + continue; + } + + const grid = new Gtk.Grid({ + column_homogeneous: false, + column_spacing: 20, + margin_start: 8, + margin_end: 8, + margin_top: 8, + margin_bottom: 8, + hexpand: true + }) + + grid.attach(option, 0, 0, 5, 1); + + if (widget) { + grid.attach(widget, 5, 0, 2, 1); + } + frameBox.append(grid); + } + page.set_child(mainBox); + + return page; + } +} + +const DropDownItem = GObject.registerClass({ + GTypeName: 'DropdownItem', + Properties: { + 'text': GObject.ParamSpec.string( + 'text', + 'Text', + 'DropDown item text', + GObject.ParamFlags.READWRITE, + '' + ), + 'id': GObject.ParamSpec.int( + 'id', + 'Id', + 'Item id stored in settings', + GObject.ParamFlags.READWRITE, + 0, 100, 0 + ), + }, +}, class DropDownItem extends GObject.Object { + get text() { + return this._text; + } + set text(text) { + this._text = text; + } + + get id() { + return this._id; + } + set id(id) { + this._id = id; + } +} +); diff --git a/extensions/vertical-workspaces/overview.js b/extensions/vertical-workspaces/overview.js new file mode 100644 index 0000000..db267b6 --- /dev/null +++ b/extensions/vertical-workspaces/overview.js @@ -0,0 +1,68 @@ +/** + * Vertical Workspaces + * overview.js + * + * panel barrier should follow panel position + * or disable it to not collide with Custom Hot Corners barriers + * + * @author GdH + * @copyright 2022 - 2023 + * @license GPL-3.0 + * + */ + +'use strict'; + +const { Meta, Clutter } = imports.gi; + +const Main = imports.ui.main; +const Overview = imports.ui.overview; + +const Me = imports.misc.extensionUtils.getCurrentExtension(); +const _Util = Me.imports.util; + +let _overrides; +let opt; + +function update(reset = false) { + if (_overrides) { + _overrides.removeAll(); + } + + if (reset) { + _overrides = null; + opt = null; + return; + } + + opt = Me.imports.settings.opt; + + _overrides = new _Util.Overrides(); + + _overrides.addOverride('Overview', Overview.Overview.prototype, OverviewCommon); +} + + +const OverviewCommon = { + _showDone: function() { + this._animationInProgress = false; + this._coverPane.hide(); + + this.emit('shown'); + // Handle any calls to hide* while we were showing + if (!this._shown) + this._animateNotVisible(); + + this._syncGrab(); + + // if user activates overview during startup animation, transition needs to be shifted to the state 2 here + const controls = this._overview._controls; + if (controls._searchController._searchActive && controls._stateAdjustment.value === 1) { + if (opt.SEARCH_VIEW_ANIMATION) { + controls._onSearchChanged(); + } else { + controls._stateAdjustment.value = 2; + } + } + } +} diff --git a/extensions/vertical-workspaces/overviewControls.js b/extensions/vertical-workspaces/overviewControls.js new file mode 100644 index 0000000..ffe0f89 --- /dev/null +++ b/extensions/vertical-workspaces/overviewControls.js @@ -0,0 +1,1464 @@ +/** + * Vertical Workspaces + * overviewControls.js + * + * @author GdH + * @copyright 2022 - 2023 + * @license GPL-3.0 + * + */ + +'use strict'; + +const { Clutter, GLib, GObject, Graphene, Meta, Shell, St } = imports.gi; +const Main = imports.ui.main; +const Util = imports.misc.util; +const OverviewControls = imports.ui.overviewControls; +const WorkspaceThumbnail = imports.ui.workspaceThumbnail; + +const ControlsState = imports.ui.overviewControls.ControlsState; +const FitMode = imports.ui.workspacesView.FitMode; + +const ExtensionUtils = imports.misc.extensionUtils; +const Me = ExtensionUtils.getCurrentExtension(); + +const _Util = Me.imports.util; +let _overrides; + +const ANIMATION_TIME = imports.ui.overview.ANIMATION_TIME; +const DASH_MAX_SIZE_RATIO = 0.15; + +let _originalSearchControllerSigId; +let _searchControllerSigId; +let _startupAnimTimeoutId1; +let _startupAnimTimeoutId2; +let _updateAppGridTimeoutId; +let _startupInitComplete = false; + +let opt; + + +function update(reset = false) { + + if (_overrides) { + _overrides.removeAll(); + } + + _replaceOnSearchChanged(reset); + + if (reset) { + _overrides = null; + opt = null; + return; + } + + opt = Me.imports.settings.opt; + + _overrides = new _Util.Overrides(); + + _overrides.addOverride('ControlsManager', OverviewControls.ControlsManager.prototype, ControlsManager); + + if (opt.ORIENTATION === Clutter.Orientation.VERTICAL) { + _overrides.addOverride('ControlsManagerLayout', OverviewControls.ControlsManagerLayout.prototype, ControlsManagerLayoutVertical); + } else { + _overrides.addOverride('ControlsManagerLayout', OverviewControls.ControlsManagerLayout.prototype, ControlsManagerLayoutHorizontal); + } +} + +function _dashNotDefault() { + return Main.overview.dash !== Main.overview._overview._controls.layoutManager._dash; +} + +function _dashIsDashToDock() { + return Main.overview.dash._isHorizontal !== undefined; +} + +function _replaceOnSearchChanged(reset = false) { + const searchController = Main.overview._overview.controls._searchController; + if (reset) { + if (_searchControllerSigId) { + searchController.disconnect(_searchControllerSigId); + _searchControllerSigId = 0; + } + if (_originalSearchControllerSigId) { + searchController.unblock_signal_handler(_originalSearchControllerSigId); + _originalSearchControllerSigId = 0; + } + } else { + // reconnect signal to use custom function (callbacks cannot be overridden in class prototype, they are already in memory as a copy for the given callback) + _originalSearchControllerSigId = GObject.signal_handler_find(searchController, { signalId: 'notify', detail: 'search-active' }); + if (_originalSearchControllerSigId) { + searchController.block_signal_handler(_originalSearchControllerSigId); + } + _searchControllerSigId = searchController.connect('notify::search-active', ControlsManager._onSearchChanged.bind(Main.overview._overview.controls)); + } + +} + +var ControlsManager = { + // this function is used as a callback by a signal handler, needs to be reconnected after modification as the original callback uses a copy of the original function + /*_update: function() { + ... + }*/ + + // this function has duplicate in WorkspaceView so we use one function for both to avoid issues with syncing them + _getFitModeForState: function(state) { + return _getFitModeForState(state); + }, + + _updateThumbnailsBox: function() { + const { shouldShow } = this._thumbnailsBox; + const thumbnailsBoxVisible = shouldShow; + this._thumbnailsBox.visible = thumbnailsBoxVisible; + + // this call should be directly in _update(), but it's used as a callback function and it would require to reconnect the signal + this._updateWorkspacesDisplay(); + }, + + // this function is pure addition to the original code and handles wsDisp transition to APP_GRID view + _updateWorkspacesDisplay: function() { + this._workspacesDisplay.translation_x = 0; + this._workspacesDisplay.translation_y = 0; + this._workspacesDisplay.scale_x = 1; + this._workspacesDisplay.scale_y = 1; + const { initialState, finalState, progress, currentState } = this._stateAdjustment.getStateTransitionParams(); + const { searchActive } = this._searchController; + + const paramsForState = s => { + let opacity; + switch (s) { + case ControlsState.HIDDEN: + case ControlsState.WINDOW_PICKER: + opacity = 255; + break; + case ControlsState.APP_GRID: + opacity = 0; + break; + default: + opacity = 255; + break; + } + return { opacity }; + }; + + let initialParams = paramsForState(initialState); + let finalParams = paramsForState(finalState); + + let opacity = Math.round(Util.lerp(initialParams.opacity, finalParams.opacity, progress)); + + let workspacesDisplayVisible = (opacity != 0)/* && !(searchActive)*/; + + // improve transition from search results to desktop + if (finalState === 0 && this._searchController._searchResults.visible) { + this._searchController.hide(); + } + + // reset Static Workspace window picker mode + if (currentState === 0/*finalState === 0 && progress === 1*/ && opt.OVERVIEW_MODE && opt.WORKSPACE_MODE) { + opt.WORKSPACE_MODE = 0; + } + + if (!opt.WS_ANIMATION || !opt.SHOW_WS_TMB) { + this._workspacesDisplay.opacity = opacity; + } else if (!opt.SHOW_WS_TMB_BG) { + // fade out ws wallpaper during transition to ws switcher if ws switcher background disabled + const ws = this._workspacesDisplay._workspacesViews[global.display.get_primary_monitor()]._workspaces[this._workspaceAdjustment.value]; + if (ws) + ws._background.opacity = opacity; + } + + // if ws preview background is disabled, animate tmb box and dash + const tmbBox = this._thumbnailsBox; + const dash = this.dash; + const searchEntryBin = this._searchEntryBin; + // this dash transition collides with startup animation and freezes GS for good, needs to be delayed (first Main.overview 'hiding' event enables it) + const skipDash = _dashNotDefault(); + + // OVERVIEW_MODE 2 should animate dash and wsTmbBox only if WORKSPACE_MODE === 0 (windows not spread) + const animateOverviewMode2 = opt.OVERVIEW_MODE2 && !(finalState === 1 && opt.WORKSPACE_MODE); + if (!Main.layoutManager._startingUp && ((!opt.SHOW_WS_PREVIEW_BG && !(opt.OVERVIEW_MODE2)) || animateOverviewMode2)) { + if (!tmbBox._translationOriginal || Math.abs(tmbBox._translationOriginal[0]) > 500) { // swipe gesture can call this calculation before tmbBox is finalized, giving nonsense width + const [tmbTranslation_x, tmbTranslation_y, dashTranslation_x, dashTranslation_y, searchTranslation_y] = _Util.getOverviewTranslations(opt, dash, tmbBox, searchEntryBin); + tmbBox._translationOriginal = [tmbTranslation_x, tmbTranslation_y]; + dash._translationOriginal = [dashTranslation_x, dashTranslation_y]; + searchEntryBin._translationOriginal = searchTranslation_y; + } + if (finalState === 0 || initialState === 0) { + const prg = Math.abs((finalState == 0 ? 0 : 1) - progress); + tmbBox.translation_x = Math.round(prg * tmbBox._translationOriginal[0]); + tmbBox.translation_y = Math.round(prg * tmbBox._translationOriginal[1]); + if (!skipDash) { + dash.translation_x = Math.round(prg * dash._translationOriginal[0]); + dash.translation_y = Math.round(prg * dash._translationOriginal[1]); + } + searchEntryBin.translation_y = Math.round(prg * searchEntryBin._translationOriginal); + } + if (progress === 1) { + tmbBox._translationOriginal = 0; + if (!skipDash) { + dash._translationOriginal = 0; + } + searchEntryBin._translationOriginal = 0; + } + } else if (!Main.layoutManager._startingUp && (tmbBox.translation_x || tmbBox.translation_y)) { + tmbBox.translation_x = 0; + tmbBox.translation_y = 0; + if (!skipDash) { + dash.translation_x = 0; + dash.translation_y = 0; + } + searchEntryBin.translation_y = 0; + } + + if (!Main.layoutManager._startingUp) { + if (initialState === ControlsState.HIDDEN && finalState === ControlsState.APP_GRID) { + this._appDisplay.opacity = Math.round(progress * 255); + } else { + this._appDisplay.opacity = 255 - opacity; + } + } + + if (currentState === ControlsState.APP_GRID) { + // in app grid hide workspaces so they're not blocking app grid or ws thumbnails + this._workspacesDisplay.scale_x = 0; + } else { + this._workspacesDisplay.scale_x = 1; + } + this._workspacesDisplay.setPrimaryWorkspaceVisible(workspacesDisplayVisible); + + if (!this.dash._isAbove && progress > 0 && opt.OVERVIEW_MODE2) { + // set searchEntry above appDisplay + this.set_child_above_sibling(this._searchEntryBin, null); + // move dash above wsTmb for case that dash and wsTmb animate from the same side + this.set_child_above_sibling(dash, null); + this.set_child_below_sibling(this._thumbnailsBox, null); + this.set_child_below_sibling(this._workspacesDisplay, null); + this.set_child_below_sibling(this._appDisplay, null); + } else if (!this.dash._isAbove && progress === 1 && finalState > ControlsState.HIDDEN) { + // set dash above workspace in the overview + if (!_dashNotDefault()) { + this.set_child_above_sibling(this._thumbnailsBox, null); + this.set_child_above_sibling(this._searchEntryBin, null); + this.set_child_above_sibling(this.dash, null); + this.dash._isAbove = true; + } + + // update max tmb scale in case some other extension changed it + WorkspaceThumbnail.MAX_THUMBNAIL_SCALE = opt.MAX_THUMBNAIL_SCALE; + + } else if (this.dash._isAbove && progress < 1) { + // keep dash below for ws transition between the overview and hidden state + this.set_child_above_sibling(this._workspacesDisplay, null); + this.dash._isAbove = false; + } + }, + + // fix for upstream bug - appGrid.visible after transition from APP_GRID to HIDDEN + _updateAppDisplayVisibility: function(stateTransitionParams = null) { + if (!stateTransitionParams) + stateTransitionParams = this._stateAdjustment.getStateTransitionParams(); + + const { currentState } = stateTransitionParams; + if (this.dash.showAppsButton.checked) + this._searchTransition = false; + + // if !APP_GRID_ANIMATION, appGrid needs to be hidden in WINDOW_PICKER mode (1) + // but needs to be visible for transition from HIDDEN (0) to APP_GRID (2) + this._appDisplay.visible = + currentState > ControlsState.HIDDEN && + !this._searchController.searchActive && + !(currentState === ControlsState.WINDOW_PICKER && !opt.APP_GRID_ANIMATION) && + !this._searchTransition; + }, + + _onSearchChanged: function() { + // if user start typing or activated search provider during overview animation, this switcher will be called again after animation ends + if (opt.SEARCH_VIEW_ANIMATION && Main.overview._animationInProgress) return; + + const { finalState, currentState } = this._stateAdjustment.getStateTransitionParams(); + const { searchActive } = this._searchController; + const SIDE_CONTROLS_ANIMATION_TIME = 250; // OverviewControls.SIDE_CONTROLS_ANIMATION_TIME = Overview.ANIMATION_TIME = 250 + + if (!searchActive) { + this._workspacesDisplay.reactive = true; + this._workspacesDisplay.setPrimaryWorkspaceVisible(true); + } else { + this._searchController.show(); + } + + this._searchTransition = true; + + this._searchController._searchResults.translation_x = 0; + this._searchController._searchResults.translation_y = 0; + this._searchController.visible = true; + + if (opt.SEARCH_VIEW_ANIMATION && !this.dash.showAppsButton.checked && ![4, 8].includes(opt.WS_TMB_POSITION) /*&& !opt.OVERVIEW_MODE2*/) { + this._updateAppDisplayVisibility(); + + this._searchController.opacity = searchActive ? 255 : 0; + let translation_x = 0; + let translation_y = 0; + const geometry = global.display.get_monitor_geometry(global.display.get_primary_monitor()); + + + if (currentState < ControlsState.APP_GRID) { + switch (opt.SEARCH_VIEW_ANIMATION) { + case 0: + translation_x = 0; + translation_y = 0; + break; + case 1: + // make it longer to cover the delay before results appears + translation_x = geometry.x + geometry.width - this._searchController.x + this._workspacesDisplay.width; + translation_y = 0; + break; + case 2: + translation_x = - this._searchController.x - 2 * this._workspacesDisplay.width; + translation_y = 0; + break; + case 3: + translation_x = 0; + translation_y = geometry.y + geometry.height + this._searchController.y + this._workspacesDisplay.height; + break; + case 5: + translation_x = 0; + translation_y = - this._searchController.y - 2 * this._workspacesDisplay.height; + break; + } + } + + if (searchActive) { + this._searchController._searchResults.translation_x = translation_x; + this._searchController._searchResults.translation_y = translation_y; + } else { + this._searchController._searchResults.translation_x = 0; + this._searchController._searchResults.translation_y = 0; + } + + this._searchController._searchResults.ease({ + //opacity: searchActive ? 255 : 0, + translation_x: searchActive ? 0 : translation_x, + translation_y: searchActive ? 0 : translation_y, + duration: SIDE_CONTROLS_ANIMATION_TIME, + mode: Clutter.AnimationMode.EASE_OUT_QUAD, + onComplete: () => { + this._searchController.visible = searchActive; + this._searchTransition = false; + } + }); + + this._workspacesDisplay.opacity = 255; + } else { + this._appDisplay.ease({ + opacity: (searchActive || currentState < 2) ? 0 : 255, + duration: SIDE_CONTROLS_ANIMATION_TIME / 2, + mode: Clutter.AnimationMode.EASE_OUT_QUAD, + onComplete: () => this._updateAppDisplayVisibility(), + }); + + //this._updateAppDisplayVisibility(); + this._workspacesDisplay.setPrimaryWorkspaceVisible(true); + this._workspacesDisplay.ease({ + opacity: searchActive ? 0 : 255, + duration: SIDE_CONTROLS_ANIMATION_TIME / 2, + mode: Clutter.AnimationMode.EASE_OUT_QUAD, + onComplete: () => { + this._workspacesDisplay.reactive = !searchActive; + this._workspacesDisplay.setPrimaryWorkspaceVisible(!searchActive); + }, + }); + + this._searchController.ease({ + opacity: searchActive ? 255 : 0, + duration: SIDE_CONTROLS_ANIMATION_TIME / 2, + mode: Clutter.AnimationMode.EASE_OUT_QUAD, + onComplete: () => (this._searchController.visible = searchActive), + }); + } + + // reuse already tuned overview transition, just replace APP_GRID with the search view + if (!Main.overview._animationInProgress && finalState !== ControlsState.HIDDEN && !this.dash.showAppsButton.checked) { + this._stateAdjustment.ease(searchActive ? ControlsState.APP_GRID : ControlsState.WINDOW_PICKER, { + // shorter animation time when entering search view can avoid stuttering in transition + // collecting search results take some time and the problematic part is the realization of the object on the screen + // if the ws animation ends before this event, the whole transition is smoother + // removing the ws transition (duration: 0) seems like the best solution here + duration: searchActive ? 0 : SIDE_CONTROLS_ANIMATION_TIME, + mode: Clutter.AnimationMode.EASE_OUT_QUAD, + onComplete: () => { + this._workspacesDisplay.setPrimaryWorkspaceVisible(!searchActive); + } + }); + } + + const entry = this._searchEntry; + if (opt.SHOW_SEARCH_ENTRY) { + entry.visible = true; + entry.opacity = 255; + } else { + entry.visible = true; + entry.opacity = searchActive ? 0 : 255; + // show search entry only if the user starts typing, and hide it when leaving the search mode + entry.ease({ + opacity: searchActive ? 255 : 0, + duration: SIDE_CONTROLS_ANIMATION_TIME / 2, + mode: Clutter.AnimationMode.EASE_OUT_QUAD, + onComplete: () => { + entry.visible = searchActive; + }, + }); + } + }, + + runStartupAnimation: async function(callback) { + // fix for upstream bug - overview always shows workspace 1 instead of the active one after restart + this._workspaceAdjustment.set_value(global.workspace_manager.get_active_workspace_index()); + this._ignoreShowAppsButtonToggle = true; + + this._searchController.prepareToEnterOverview(); + this._workspacesDisplay.prepareToEnterOverview(); + + this._stateAdjustment.value = ControlsState.HIDDEN; + this._stateAdjustment.ease(ControlsState.WINDOW_PICKER, { + duration: ANIMATION_TIME, + mode: Clutter.AnimationMode.EASE_OUT_QUAD, + }); + + this.dash.showAppsButton.checked = false; + this._ignoreShowAppsButtonToggle = false; + + // Set the opacity here to avoid a 1-frame flicker + this.opacity = 0; + + // We can't run the animation before the first allocation happens + await this.layout_manager.ensureAllocation(); + + const { STARTUP_ANIMATION_TIME } = imports.ui.layout; + + // Opacity + this.ease({ + opacity: 255, + duration: STARTUP_ANIMATION_TIME, + mode: Clutter.AnimationMode.LINEAR, + onComplete: () => { + // part of the workaround for stuttering first app grid animation + this._appDisplay.visible = true; + } + }); + + const dash = this.dash; + const tmbBox = this._thumbnailsBox; + + // Set the opacity here to avoid a 1-frame flicker + dash.opacity = 0; + for (const view of this._workspacesDisplay._workspacesViews) { + if (view._monitorIndex !== global.display.get_primary_monitor()) + view._thumbnails.opacity = 0; + } + + const searchEntryBin = this._searchEntryBin; + const [tmbTranslation_x, tmbTranslation_y, dashTranslation_x, dashTranslation_y, searchTranslation_y] = + _Util.getOverviewTranslations(opt, dash, tmbBox, searchEntryBin); + + const onComplete = function() { + // running init callback again causes issues (multiple connections) + if (!_startupInitComplete) + callback(); + _startupInitComplete = true; + + // force app grid to build before the first visible animation to remove possible stuttering + this._appDisplay.opacity = 1; + + const [x, y] = this._appDisplay.get_position(); + const translation_x = - x; + const translation_y = - y; + this._appDisplay.translation_x = translation_x; + this._appDisplay.translation_y = translation_y; + + // let the main loop realize previous changes before continuing + _startupAnimTimeoutId1 = GLib.timeout_add( + GLib.PRIORITY_DEFAULT, + 10, + () => { + this._appDisplay.translation_x = 0; + this._appDisplay.translation_y = 0; + this._appDisplay.visible = false; + if (opt.STARTUP_STATE === 1) { + Main.overview.hide(); + } else if (opt.STARTUP_STATE === 2) { + this._appDisplay.opacity = 255; + this.dash.showAppsButton.checked = true; + } + _startupAnimTimeoutId1 = 0; + return GLib.SOURCE_REMOVE; + } + ); + }.bind(this); + + if (dash.visible && !_dashNotDefault()) { + dash.translation_x = dashTranslation_x; + dash.translation_y = dashTranslation_y; + dash.opacity = 255; + dash.ease({ + translation_x: 0, + translation_y: 0, + delay: STARTUP_ANIMATION_TIME / 2, + duration: STARTUP_ANIMATION_TIME, + mode: Clutter.AnimationMode.EASE_OUT_QUAD, + onComplete: () => { + onComplete(); + }, + }); + } else { + // set dash opacity to make it visible if user enable it later + dash.opacity = 255; + // if dash is hidden, substitute the ease timeout with GLib.timeout + _startupAnimTimeoutId2 = GLib.timeout_add( + GLib.PRIORITY_DEFAULT, + // delay + animation time + STARTUP_ANIMATION_TIME * 2 * opt.ANIMATION_TIME_FACTOR, + () => { + onComplete(); + _startupAnimTimeoutId2 = 0; + return GLib.SOURCE_REMOVE; + } + ); + } + + if (searchEntryBin.visible) { + searchEntryBin.translation_y = searchTranslation_y; + searchEntryBin.ease({ + translation_y: 0, + delay: STARTUP_ANIMATION_TIME / 2, + duration: STARTUP_ANIMATION_TIME, + mode: Clutter.AnimationMode.EASE_OUT_QUAD, + }); + } + + if (tmbBox.visible) { + tmbBox.translation_x = tmbTranslation_x; + tmbBox.translation_y = tmbTranslation_y; + tmbBox.ease({ + translation_x: 0, + translation_y: 0, + delay: STARTUP_ANIMATION_TIME / 2, + duration: STARTUP_ANIMATION_TIME, + mode: Clutter.AnimationMode.EASE_OUT_QUAD, + }); + } + + // upstream bug - following animation will be cancelled, don't know where + // needs further investigation + const workspacesViews = this._workspacesDisplay._workspacesViews; + if (workspacesViews.length > 1) { + for (const view of workspacesViews) { + if (view._monitorIndex !== global.display.get_primary_monitor() && view._thumbnails.visible) { + const tmbBox = view._thumbnails; + + _Util.getOverviewTranslations(opt, dash, tmbBox, searchEntryBin); + if (opt.SEC_WS_TMB_LEFT) { + tmbBox.translation_x = - (tmbBox.width + 12); // compensate for padding + } else if (opt.SEC_WS_TMB_RIGHT) { + tmbBox.translation_x = (tmbBox.width + 12); + } else if (opt.SEC_WS_TMB_TOP) { + tmbBox.translation_y = - (tmbBox.height + 12); + } else if (opt.SEC_WS_TMB_BOTTOM) { + tmbBox.translation_y = (tmbBox.height + 12); + } + tmbBox.opacity = 255; + + tmbBox.ease({ + translation_y: 0, + delay: STARTUP_ANIMATION_TIME / 2, + duration: STARTUP_ANIMATION_TIME, + mode: Clutter.AnimationMode.EASE_OUT_QUAD, + }); + } + } + } + }, + + animateToOverview: function(state, callback) { + // don't enter overview during updating appDisplay properties + if (_updateAppGridTimeoutId) + Main.overview.hide(); + this._ignoreShowAppsButtonToggle = true; + this._searchTransition = false; + + this._searchController.prepareToEnterOverview(); + this._workspacesDisplay.prepareToEnterOverview(); + + this._stateAdjustment.value = ControlsState.HIDDEN; + + // building window thumbnails takes some time and with many windows on the workspace + // the time can be close to or longer than ANIMATION_TIME + // in which case the the animation is greatly delayed, stuttering, or even skipped + // for user it is more acceptable to watch delayed smooth animation, + // even if it takes little more time, than jumping frames + const delay = global.display.get_tab_list(0, global.workspace_manager.get_active_workspace()).length * 3; + this._stateAdjustment.ease(state, { + delay, + duration: 250, //Overview.ANIMATION_TIME, + mode: Clutter.AnimationMode.EASE_OUT_QUAD, + onStopped: () => { + if (callback) + callback(); + }, + }); + + this.dash.showAppsButton.checked = + state === ControlsState.APP_GRID; + + this._ignoreShowAppsButtonToggle = false; + }, +} + +var ControlsManagerLayoutVertical = { + _computeWorkspacesBoxForState: function(state, box, workAreaBox, dashWidth, dashHeight, thumbnailsWidth, searchHeight, startY) { + const workspaceBox = box.copy(); + let [width, height] = workspaceBox.get_size(); + const { x1: startX,/* y1: startY*/ } = workAreaBox; + const { spacing } = this; + //const { expandFraction } = this._workspacesThumbnails; + + const dash = Main.overview.dash; + // including Dash to Dock and clones properties for compatibility + + if (_dashIsDashToDock()) { + // Dash to Dock also always affects workAreaBox + Main.layoutManager._trackedActors.forEach((actor) => { + if (actor.affectsStruts && actor.actor.width === dash.width) { + if (dash._isHorizontal) { + // disabled inteli-hide don't needs compensation + // startY needs to be corrected in allocate() + if (dash.get_parent()?.get_parent()?.get_parent()?._intellihideIsEnabled) { + height += dash.height; + } + } else { + width += dash.width; + } + } + }); + } + + let wWidth; + let wHeight; + let wsBoxY; + + switch (state) { + case ControlsState.HIDDEN: + // if PANEL_MODE == 2 (overview only) the affectStruts property stays on false to avoid stuttering + // therefore we added panel height to startY for the overview allocation, + // but here we need to remove the correction since the panel will be in the hidden state + if (opt.START_Y_OFFSET) { + let [x, y] = workAreaBox.get_origin(); + y -= opt.START_Y_OFFSET; + workspaceBox.set_origin(x, y); + } else { + workspaceBox.set_origin(...workAreaBox.get_origin()); + } + workspaceBox.set_size(...workAreaBox.get_size()); + break; + case ControlsState.WINDOW_PICKER: + case ControlsState.APP_GRID: + if (opt.WS_ANIMATION && opt.SHOW_WS_TMB && state === ControlsState.APP_GRID) { + workspaceBox.set_origin(...this._workspacesThumbnails.get_position()); + workspaceBox.set_size(...this._workspacesThumbnails.get_size()); + } else if (opt.OVERVIEW_MODE2 && !opt.WORKSPACE_MODE) { + if (opt.START_Y_OFFSET) { + let [x, y] = workAreaBox.get_origin(); + y -= opt.START_Y_OFFSET; + workspaceBox.set_origin(x, y); + } else { + workspaceBox.set_origin(...workAreaBox.get_origin()); + } + workspaceBox.set_size(...workAreaBox.get_size()); + } else { + // in PANEL_MODE 2 panel don't affects workArea height (affectStruts === false), it needs to be compensated + height = opt.PANEL_POSITION_TOP ? height : height - Main.panel.height; + searchHeight = opt.SHOW_SEARCH_ENTRY ? searchHeight : 0; + wWidth = width + - (opt.DASH_VERTICAL ? dash.width : 0) + - (thumbnailsWidth) + - 4 * spacing + wHeight = height + - (opt.DASH_VERTICAL ? 0 : dashHeight) + - searchHeight + - 4 * spacing; + + const ratio = width / height; + let wRatio = wWidth / wHeight; + let scale = ratio / wRatio; + + if (scale > 1) { + wHeight = wHeight / scale; + wWidth = wHeight * ratio; + } else { + wWidth = wWidth * scale; + wHeight = wWidth / ratio; + } + + // height decides the actual size, ratio is given by the workarea + wHeight *= opt.WS_PREVIEW_SCALE; + wWidth *= opt.WS_PREVIEW_SCALE; + + let xOffset = 0; + let yOffset = 0; + + const yOffsetT = (opt.DASH_TOP ? dashHeight : 0) + searchHeight; + const yOffsetB = (opt.DASH_BOTTOM ? dashHeight : 0); + const yAvailableSpace = (height - yOffsetT - wHeight - yOffsetB) / 2; + yOffset = yOffsetT + yAvailableSpace; + + const centeredBoxX = (width - wWidth) / 2; + + const xOffsetL = (opt.DASH_LEFT ? dashWidth : 0) + (opt.WS_TMB_LEFT ? thumbnailsWidth : 0) + 2 * spacing; + const xOffsetR = (opt.DASH_RIGHT ? dashWidth : 0) + (opt.WS_TMB_RIGHT ? thumbnailsWidth : 0) + 2 * spacing; + + this._xAlignCenter = false; + if (centeredBoxX < Math.max(xOffsetL, xOffsetR)) { + xOffset = xOffsetL + spacing + (width - xOffsetL - wWidth - xOffsetR - 2 * spacing) / 2; + } else { + xOffset = centeredBoxX; + this._xAlignCenter = true; + } + + const wsBoxX = /*startX + */xOffset; + wsBoxY = Math.round(startY + yOffset); + workspaceBox.set_origin(Math.round(wsBoxX), Math.round(wsBoxY)); + workspaceBox.set_size(Math.round(wWidth), Math.round(wHeight)); + } + } + + return workspaceBox; + }, + + _getAppDisplayBoxForState: function(state, box, workAreaBox, searchHeight, dashWidth, dashHeight, thumbnailsWidth, startY) { + const [width] = box.get_size(); + const { x1: startX } = workAreaBox; + //const { y1: startY } = workAreaBox; + let height = workAreaBox.get_height(); + // in PANEL_MODE 2 panel don't affects workArea height (affectStruts === false), it needs to be compensated + height = opt.PANEL_MODE === 2 ? height - Main.panel.height : height; + const appDisplayBox = new Clutter.ActorBox(); + const { spacing } = this; + + searchHeight = opt.SHOW_SEARCH_ENTRY ? searchHeight : 0; + + const xOffsetL = (opt.WS_TMB_LEFT ? thumbnailsWidth : 0) + (opt.DASH_LEFT ? dashWidth : 0); + const xOffsetR = (opt.WS_TMB_RIGHT ? thumbnailsWidth : 0) + (opt.DASH_RIGHT ? dashWidth : 0); + const yOffsetT = (opt.DASH_TOP ? dashHeight : 0) + (opt.SHOW_SEARCH_ENTRY ? searchHeight : 0); + const yOffsetB = (opt.DASH_BOTTOM ? dashHeight : 0); + const adWidth = opt.CENTER_APP_GRID ? (width - 2 * Math.max (xOffsetL, xOffsetR) - 4 * spacing) : (width - xOffsetL - xOffsetR - 4 * spacing); + const adHeight = height - yOffsetT - yOffsetB - 4 * spacing; + + const appDisplayX = opt.CENTER_APP_GRID ? ((width - adWidth) / 2) : (xOffsetL + 2 * spacing); + const appDisplayY = startY + yOffsetT + 2 * spacing; + + switch (state) { + case ControlsState.HIDDEN: + case ControlsState.WINDOW_PICKER: + // 1 - left, 2 - right, 3 - bottom, 5 - top + switch (opt.APP_GRID_ANIMATION) { + case 0: + appDisplayBox.set_origin(appDisplayX, appDisplayY); + break; + case 1: + appDisplayBox.set_origin(startX + width, appDisplayY); + break; + case 2: + appDisplayBox.set_origin(startX - adWidth, appDisplayY); + break; + case 3: + appDisplayBox.set_origin(appDisplayX, workAreaBox.y2); + break; + case 5: + appDisplayBox.set_origin(appDisplayX, workAreaBox.y1 - adHeight); + break; + } + break; + case ControlsState.APP_GRID: + appDisplayBox.set_origin(appDisplayX, appDisplayY); + break; + } + + appDisplayBox.set_size(adWidth, adHeight); + return appDisplayBox; + }, + + vfunc_allocate: function(container, box) { + const childBox = new Clutter.ActorBox(); + + const { spacing } = this; + + const monitor = Main.layoutManager.findMonitorForActor(this._container); + const workArea = Main.layoutManager.getWorkAreaForMonitor(monitor.index); + const startX = workArea.x - monitor.x; + // if PANEL_MODE == 2 (overview only) the affectStruts property stays on false to avoid stuttering + // therefore we need to add panel height to startY + let startY = workArea.y - monitor.y + opt.START_Y_OFFSET; + + const workAreaBox = new Clutter.ActorBox(); + workAreaBox.set_origin(startX, startY); + workAreaBox.set_size(workArea.width, workArea.height); + box.y1 += startY; + box.x1 += startX; + let [width, height] = box.get_size(); + // if panel is at bottom position, + // compensate the height of the available box (the box size is calculated for top panel) + height = opt.PANEL_POSITION_TOP ? height : height - Main.panel.height; + let availableHeight = height; + + // Dash + const maxDashHeight = Math.round(box.get_height() * DASH_MAX_SIZE_RATIO); + const maxDashWidth = maxDashHeight * 0.8; + let dashHeight = 0; + let dashWidth = 0; + + // dash cloud be overridden by the Dash to Dock clone + const dash = Main.overview.dash; + if (_dashIsDashToDock()) { + // if Dash to Dock replaced the default dash and its inteli-hide id disabled we need to compensate for affected startY + if (!Main.overview.dash.get_parent()?.get_parent()?.get_parent()?._intellihideIsEnabled) { + if (Main.panel.y === monitor.y) + startY = Main.panel.height + spacing; + } + dashHeight = dash.height; + dashWidth = dash.width; + opt.DASH_VERTICAL = [1, 3].includes(dash._position); + this._dash.allocate(childBox); + } else if (this._dash.visible) { + // default dock + if (opt.DASH_VERTICAL) { + this._dash.setMaxSize(maxDashWidth, height); + [, dashWidth] = this._dash.get_preferred_width(height); + [, dashHeight] = this._dash.get_preferred_height(dashWidth); + dashWidth = Math.min(dashWidth, maxDashWidth); + dashHeight = Math.min(dashHeight, height); + + } else if (!opt.WS_TMB_FULL) { + this._dash.setMaxSize(width, maxDashHeight); + [, dashHeight] = this._dash.get_preferred_height(width); + [, dashWidth] = this._dash.get_preferred_width(dashHeight); + dashHeight = Math.min(dashHeight, maxDashHeight); + dashWidth = Math.min(dashWidth, width); + } + } + + // Workspace Thumbnails + let wsTmbWidth = 0; + let wsTmbHeight = 0; + + if (this._workspacesThumbnails.visible) { + //const REDUCE_WS_TMB_IF_NEEDED = (this._searchController._searchActive && opt.CENTER_SEARCH_VIEW) || opt.CENTER_APP_GRID; + + const { expandFraction } = this._workspacesThumbnails; + const dashHeightReservation = (!opt.WS_TMB_FULL && !opt.DASH_VERTICAL) ? dashHeight : 0; + wsTmbHeight = opt.WS_TMB_FULL + ? height - spacing + : height - (opt.DASH_VERTICAL ? 0 : dashHeightReservation) - spacing; + + wsTmbWidth = this._workspacesThumbnails.get_preferred_custom_width(wsTmbHeight)[0]; + wsTmbWidth = Math.round(Math.min( + wsTmbWidth * expandFraction, + width * opt.MAX_THUMBNAIL_SCALE + )); + + /*if (opt.REDUCE_WS_TMB_IF_NEEDED) { + const searchAllocation = this._searchController._searchResults._content.allocation; + const searchWidth = searchAllocation.x2 - searchAllocation.x1; + wsTmbWidth = Math.clamp((width - searchWidth) / 2 - spacing, width * 0.05, wsTmbWidth); + }*/ + + wsTmbHeight = Math.round(Math.min(this._workspacesThumbnails.get_preferred_custom_height(wsTmbWidth)[1], wsTmbHeight)); + + let wsTmbX; + if (opt.WS_TMB_RIGHT) { + wsTmbX = Math.round(startX + width - (opt.DASH_RIGHT ? dashWidth : 0) - wsTmbWidth - spacing / 2); + } else { + wsTmbX = Math.round((opt.DASH_LEFT ? dashWidth : 0) + spacing / 2); + } + + let wstOffset = (height - wsTmbHeight - (opt.DASH_VERTICAL ? 0 : dashHeightReservation)) / 2; + wstOffset = wstOffset - opt.WS_TMB_POSITION_ADJUSTMENT * (wstOffset - spacing / 2); + let wsTmbY = Math.round(startY + ((dashHeightReservation && opt.DASH_TOP) ? dashHeight : 0) + wstOffset); + + childBox.set_origin(wsTmbX, wsTmbY); + childBox.set_size(wsTmbWidth, wsTmbHeight); + + this._workspacesThumbnails.allocate(childBox); + } + + + if (this._dash.visible) { + const wMaxWidth = width - spacing - wsTmbWidth - 2 * spacing - (opt.DASH_VERTICAL ? dashWidth + spacing : 0); + if (opt.WS_TMB_FULL && !opt.DASH_VERTICAL) { + this._dash.setMaxSize(wMaxWidth, maxDashHeight); + [, dashHeight] = this._dash.get_preferred_height(wMaxWidth); + [, dashWidth] = this._dash.get_preferred_width(dashHeight); + dashHeight = Math.round(Math.min(dashHeight, maxDashHeight)); + dashWidth = Math.round(Math.min(dashWidth, wMaxWidth)); + } + + let dashX, dashY, offset; + if (opt.DASH_RIGHT) + dashX = width - dashWidth; + else if (opt.DASH_LEFT) { + dashX = 0; + } + else if (opt.DASH_TOP) + dashY = startY; + else + dashY = startY + height - dashHeight; + + if (!opt.DASH_VERTICAL) { + offset = (width - (((opt.WS_TMB_FULL || opt.CENTER_DASH_WS) && !this._xAlignCenter) ? wsTmbWidth : 0) - dashWidth) / 2; + offset = offset - opt.DASH_POSITION_ADJUSTMENT * (offset - spacing / 2); + dashX = offset; + + if ((opt.WS_TMB_FULL || opt.CENTER_DASH_WS) && !this._xAlignCenter) { + if (opt.WS_TMB_RIGHT) { + //dashX = Math.min(dashX, width - dashWidth - (wsTmbWidth ? wsTmbWidth : 0)); + } else { + dashX = (wsTmbWidth ? wsTmbWidth : 0) + offset; + dashX = Math.max(dashX, wsTmbWidth ? wsTmbWidth + spacing : 0); + dashX = Math.min(dashX, width - dashWidth - spacing); + } + } + if (opt.WS_TMB_FULL && !opt.CENTER_DASH_WS) { + dashX = opt.WS_TMB_RIGHT + ? Math.min(width - wsTmbWidth - dashWidth, dashX + (wsTmbWidth) / 2 * (1 - Math.abs(opt.DASH_POSITION_ADJUSTMENT))) + : Math.max(wsTmbWidth, dashX - (wsTmbWidth) / 2 * (1 - Math.abs(opt.DASH_POSITION_ADJUSTMENT))); + } + } else { + const offset = (height - dashHeight) / 2; + dashY = startY + (offset - opt.DASH_POSITION_ADJUSTMENT * offset); + } + + childBox.set_origin(Math.round(startX + dashX), Math.round(dashY)); + childBox.set_size(dashWidth, dashHeight); + this._dash.allocate(childBox); + } + + availableHeight -= (opt.DASH_VERTICAL ? 0 : dashHeight + spacing); + + let [searchHeight] = this._searchEntry.get_preferred_height(width - wsTmbWidth); + + // Workspaces + let params = [box, workAreaBox, dashWidth, dashHeight, wsTmbWidth, searchHeight, startY]; + const transitionParams = this._stateAdjustment.getStateTransitionParams(); + + // Update cached boxes + for (const state of Object.values(ControlsState)) { + this._cachedWorkspaceBoxes.set( + state, this._computeWorkspacesBoxForState(state, ...params)); + } + + let workspacesBox; + if (!transitionParams.transitioning) { + workspacesBox = this._cachedWorkspaceBoxes.get(transitionParams.currentState); + } + if (!workspacesBox) { + const initialBox = this._cachedWorkspaceBoxes.get(transitionParams.initialState); + const finalBox = this._cachedWorkspaceBoxes.get(transitionParams.finalState); + workspacesBox = initialBox.interpolate(finalBox, transitionParams.progress); + } + + this._workspacesDisplay.allocate(workspacesBox); + + // Search entry + const searchXoffset = (opt.DASH_LEFT ? dashWidth : 0) + spacing + (opt.WS_TMB_RIGHT ? 0 : wsTmbWidth + spacing); + //let [searchHeight] = this._searchEntry.get_preferred_height(width - wsTmbWidth); + + // Y position under top Dash + let searchEntryX, searchEntryY; + /*if (opt.OVERVIEW_MODE2 && !opt.DASH_TOP && !opt.WS_TMB_TOP) { + searchEntryY = 7; + } else*/ if (opt.DASH_TOP) { + searchEntryY = startY + dashHeight - spacing; + } else { + searchEntryY = startY; + } + + searchEntryX = searchXoffset; + let searchWidth = width - 2 * spacing - wsTmbWidth - (opt.DASH_VERTICAL ? dashWidth : 0); // xAlignCenter is given by wsBox + searchWidth = this._xAlignCenter ? width - 2 * (wsTmbWidth + spacing) : searchWidth; + + if (opt.CENTER_SEARCH_VIEW) { + childBox.set_origin(0, searchEntryY); + childBox.set_size(width, searchHeight); + } else { + childBox.set_origin(this._xAlignCenter ? 0 : searchEntryX, searchEntryY); + childBox.set_size(this._xAlignCenter ? width : searchWidth - spacing, searchHeight); + } + + this._searchEntry.allocate(childBox); + + availableHeight -= searchHeight + spacing; + + // AppDisplay - state, box, workAreaBox, searchHeight, dashHeight, appGridBox, wsTmbWidth + //if (this._appDisplay.visible) { + + params = [box, workAreaBox, searchHeight, dashWidth, dashHeight, wsTmbWidth, startY]; // send startY, can be compensated + let appDisplayBox; + if (!transitionParams.transitioning) { + appDisplayBox = + this._getAppDisplayBoxForState(transitionParams.currentState, ...params); + } else { + const initialBox = + this._getAppDisplayBoxForState(transitionParams.initialState, ...params); + const finalBox = + this._getAppDisplayBoxForState(transitionParams.finalState, ...params); + + appDisplayBox = initialBox.interpolate(finalBox, transitionParams.progress); + } + this._appDisplay.allocate(appDisplayBox); + //} + + // Search + if (opt.CENTER_SEARCH_VIEW) { + const dashW = (opt.DASH_VERTICAL ? dashWidth : 0) + spacing; + searchWidth = width - 2 * wsTmbWidth - 2 * dashW; + childBox.set_origin(wsTmbWidth + dashW, startY + (opt.DASH_TOP ? dashHeight : spacing) + searchHeight); + } else { + childBox.set_origin(this._xAlignCenter ? wsTmbWidth + spacing : searchXoffset, startY + (opt.DASH_TOP ? dashHeight : spacing) + searchHeight); + } + + childBox.set_size(searchWidth, availableHeight); + this._searchController.allocate(childBox); + + this._runPostAllocation(); + } +} + +var ControlsManagerLayoutHorizontal = { + _computeWorkspacesBoxForState: function(state, box, workAreaBox, dashWidth, dashHeight, thumbnailsHeight, searchHeight, startY) { + const workspaceBox = box.copy(); + let [width, height] = workspaceBox.get_size(); + let { x1: startX/*, y1: startY*/ } = workAreaBox; + const { spacing } = this; + //const { expandFraction } = this._workspacesThumbnails; + + const dash = Main.overview.dash; + // including Dash to Dock and clones properties for compatibility + if (_dashIsDashToDock()) { + // Dash to Dock always affects workAreaBox + Main.layoutManager._trackedActors.forEach((actor) => { + if (actor.affectsStruts && actor.actor.width === dash.width) { + if (dash._isHorizontal) { + // disabled inteli-hide don't need compensation + // startY needs to be corrected in allocate() + if (dash.get_parent()?.get_parent()?.get_parent()?._intellihideIsEnabled) { + height += dash.height; + } else if (opt.DASH_TOP) { + height += dash.height; + } + } else { + width += dash.width; + } + } + }); + } + + let wWidth, wHeight, wsBoxY, wsBoxX; + + switch (state) { + case ControlsState.HIDDEN: + // if PANEL_MODE == 2 (overview only) the affectStruts property stays on false to avoid stuttering + // therefore we added panel height to startY for the overview allocation, + // but here we need to remove the correction since the panel will be in the hidden state + if (opt.START_Y_OFFSET) { + let [x, y] = workAreaBox.get_origin(); + y -= opt.START_Y_OFFSET; + workspaceBox.set_origin(x, y); + } else { + workspaceBox.set_origin(...workAreaBox.get_origin()); + } + workspaceBox.set_size(...workAreaBox.get_size()); + break; + case ControlsState.WINDOW_PICKER: + case ControlsState.APP_GRID: + if (opt.WS_ANIMATION && opt.SHOW_WS_TMB && state === ControlsState.APP_GRID) { + workspaceBox.set_origin(...this._workspacesThumbnails.get_position()); + workspaceBox.set_size(...this._workspacesThumbnails.get_size()); + } else if (opt.OVERVIEW_MODE2 && !opt.WORKSPACE_MODE) { + if (opt.START_Y_OFFSET) { + let [x, y] = workAreaBox.get_origin(); + y -= opt.START_Y_OFFSET; + workspaceBox.set_origin(x, y); + } else { + workspaceBox.set_origin(...workAreaBox.get_origin()); + } + workspaceBox.set_size(...workAreaBox.get_size()); + } else { + // in PANEL_MODE 2 panel don't affects workArea height (affectStruts === false), it needs to be compensated + height = opt.PANEL_POSITION_TOP ? height : height - Main.panel.height; + searchHeight = opt.SHOW_SEARCH_ENTRY ? searchHeight : 0; + wWidth = width + - spacing + - (opt.DASH_VERTICAL ? dashWidth : 0) + - 4 * spacing; + wHeight = height + - (opt.DASH_VERTICAL ? spacing : (dashHeight ? dashHeight : 0)) + - (thumbnailsHeight ? thumbnailsHeight : 0) + - searchHeight + - 4 * spacing; + + const ratio = width / height; + let wRatio = wWidth / wHeight; + let scale = ratio / wRatio; + + if (scale > 1) { + wHeight = wHeight / scale; + wWidth = wHeight * ratio; + } else { + wWidth = wWidth * scale; + wHeight = wWidth / ratio; + } + + // height decides the actual size, ratio is given by the workarea + wHeight *= opt.WS_PREVIEW_SCALE; + wWidth *= opt.WS_PREVIEW_SCALE; + + let xOffset = 0; + let yOffset = 0; + + const yOffsetT = (opt.DASH_TOP ? dashHeight : 0) + (opt.WS_TMB_TOP ? thumbnailsHeight : 0) + searchHeight; + const yOffsetB = (opt.DASH_BOTTOM ? dashHeight : 0) + (opt.WS_TMB_BOTTOM ? thumbnailsHeight : 0); + + const yAvailableSpace = (height - yOffsetT - wHeight - yOffsetB) / 2; + yOffset = yOffsetT + yAvailableSpace; + + const xOffsetL = (opt.DASH_LEFT ? dashWidth : 0) + spacing; + const xOffsetR = (opt.DASH_RIGHT ? dashWidth : 0) + spacing; + const centeredBoxX = (width - wWidth) / 2; + + this._xAlignCenter = false; + if (centeredBoxX < Math.max(xOffsetL, xOffsetR)) { + xOffset = xOffsetL + spacing + (width - xOffsetL - wWidth - xOffsetR) / 2; + } else { + xOffset = centeredBoxX; + this._xAlignCenter = true; + } + + wsBoxX = /*startX + */xOffset; + wsBoxY = Math.round(startY + yOffset) + workspaceBox.set_origin(Math.round(wsBoxX), Math.round(wsBoxY)); + workspaceBox.set_size(Math.round(wWidth), Math.round(wHeight)); + } + } + + return workspaceBox; + }, + + _getAppDisplayBoxForState: function(state, box, workAreaBox, searchHeight, dashWidth, dashHeight, thumbnailsHeight, startY) { + const [width] = box.get_size(); + const { x1: startX } = workAreaBox; + //const { y1: startY } = workAreaBox; + let height = workAreaBox.get_height(); + // in PANEL_MODE 2 panel don't affects workArea height (affectStruts === false), it needs to be compensated + height = opt.PANEL_MODE === 2 ? height - Main.panel.height : height; + const appDisplayBox = new Clutter.ActorBox(); + const { spacing } = this; + + const yOffsetT = (opt.WS_TMB_TOP ? thumbnailsHeight : 0) + (opt.DASH_TOP ? dashHeight : 0) + (opt.SHOW_SEARCH_ENTRY ? searchHeight : 0); + const yOffsetB = (opt.WS_TMB_BOTTOM ? thumbnailsHeight : 0) + (opt.DASH_BOTTOM ? dashHeight : 0); + const xOffsetL = (opt.DASH_LEFT ? dashWidth : 0); + const xOffsetR = (opt.DASH_RIGHT ? dashWidth : 0); + const adWidth = opt.CENTER_APP_GRID ? (width - 2 * Math.max (xOffsetL, xOffsetR) - 4 * spacing) : (width - xOffsetL - xOffsetR - 4 * spacing); + const adHeight = height - yOffsetT - yOffsetB - 4 * spacing; + + const appDisplayX = opt.CENTER_APP_GRID ? ((width - adWidth) / 2) : (xOffsetL + 2 * spacing); + const appDisplayY = startY + yOffsetT + 2 * spacing; + + switch (state) { + case ControlsState.HIDDEN: + case ControlsState.WINDOW_PICKER: + // 1 - left, 2 - right, 3 - bottom, 5 - top + switch (opt.APP_GRID_ANIMATION) { + case 0: + appDisplayBox.set_origin(appDisplayX, appDisplayY); + break; + case 1: + appDisplayBox.set_origin(startX + width, appDisplayY); + break; + case 2: + appDisplayBox.set_origin(startX - adWidth, appDisplayY); + break; + case 3: + appDisplayBox.set_origin(appDisplayX, workAreaBox.y2); + break; + case 5: + appDisplayBox.set_origin(appDisplayX, workAreaBox.y1 - adHeight); + break; + } + break; + case ControlsState.APP_GRID: + appDisplayBox.set_origin(appDisplayX, appDisplayY); + break; + } + + appDisplayBox.set_size(adWidth, adHeight); + return appDisplayBox; + }, + + vfunc_allocate: function(container, box) { + const childBox = new Clutter.ActorBox(); + + const { spacing } = this; + + const monitor = Main.layoutManager.findMonitorForActor(this._container); + const workArea = Main.layoutManager.getWorkAreaForMonitor(monitor.index); + const startX = workArea.x - monitor.x; + // if PANEL_MODE == 2 (overview only) the affectStruts property stays on false to avoid stuttering + // therefore we need to add panel height to startY + let startY = workArea.y - monitor.y + opt.START_Y_OFFSET; + const workAreaBox = new Clutter.ActorBox(); + workAreaBox.set_origin(startX, startY); + workAreaBox.set_size(workArea.width, workArea.height); + box.y1 += startY; + box.x1 += startX; + let [width, height] = box.get_size(); + // if panel is at bottom position, + // compensate the height of the available box (the box size is calculated for top panel) + height = opt.PANEL_POSITION_TOP ? height : height - Main.panel.height; + let availableHeight = height; + + // Dash + const maxDashHeight = Math.round(box.get_height() * DASH_MAX_SIZE_RATIO); + const maxDashWidth = maxDashHeight * 0.8; + let dashHeight = 0; + let dashWidth = 0; + + // dash cloud be overridden by the Dash to Dock clone + const dash = Main.overview.dash; + if (_dashIsDashToDock()) { + // if Dash to Dock replaced the default dash and its inteli-hide is disabled we need to compensate for affected startY + if (!Main.overview.dash.get_parent()?.get_parent()?.get_parent()?._intellihideIsEnabled) { + if (Main.panel.y === monitor.y) + startY = Main.panel.height + spacing; + } + dashHeight = dash.height; + dashWidth = dash.width; + opt.DASH_TOP = dash._position === 0; + opt.DASH_VERTICAL = [1, 3].includes(dash._position); + this._dash.allocate(childBox); + } else if (this._dash.visible) { + // default dock + if (!opt.DASH_VERTICAL) { + this._dash.setMaxSize(width, maxDashHeight); + [, dashHeight] = this._dash.get_preferred_height(width); + [, dashWidth] = this._dash.get_preferred_width(dashHeight); + dashHeight = Math.min(dashHeight, maxDashHeight); + dashWidth = Math.min(dashWidth, width - spacing); + + } else if (!opt.WS_TMB_FULL) { + this._dash.setMaxSize(maxDashWidth, height); + [, dashWidth] = this._dash.get_preferred_width(height); + [, dashHeight] = this._dash.get_preferred_height(dashWidth); + dashHeight = Math.min(dashHeight, height - spacing); + dashWidth = Math.min(dashWidth, width); + } + } + + let [searchHeight] = this._searchEntry.get_preferred_height(width); + + let wsTmbWidth = 0; + let wsTmbHeight = 0; + + if (this._workspacesThumbnails.visible) { + const { expandFraction } = this._workspacesThumbnails; + const dashWidthReservation = (!opt.WS_TMB_FULL && opt.DASH_VERTICAL) ? dashWidth : 0; + + wsTmbWidth = opt.WS_TMB_FULL + ? width + : width - (opt.DASH_VERTICAL ? 0 : dashWidthReservation); + + wsTmbHeight = this._workspacesThumbnails.get_preferred_height(wsTmbWidth)[0]; + wsTmbHeight = Math.round(Math.min( + wsTmbHeight * expandFraction, + height * opt.MAX_THUMBNAIL_SCALE + )); + + wsTmbWidth = Math.round(Math.min(this._workspacesThumbnails.get_preferred_custom_width(wsTmbHeight)[1], wsTmbWidth)); + + let wsTmbY; + if (opt.WS_TMB_TOP) { + wsTmbY = Math.round(startY + /*searchHeight + */(opt.DASH_TOP ? dashHeight : spacing / 2)); + } else { + //const boxY = workArea.y - monitor.y; // startY might be compensated + //wsTmbY = Math.round(boxY + height - (DASH_BOTTOM ? dashHeight : 0) - wsTmbHeight); + wsTmbY = Math.round(startY + height - (opt.DASH_BOTTOM ? dashHeight : 0) - wsTmbHeight); + } + + let wstOffset = (width - wsTmbWidth) / 2; + wstOffset = wstOffset - opt.WS_TMB_POSITION_ADJUSTMENT * wstOffset; + let wsTmbX = Math.round(Math.clamp( + startX + wstOffset, + startX + (opt.DASH_LEFT ? dashWidthReservation + spacing / 2 : spacing / 2), + width - wsTmbWidth - startX - (opt.DASH_RIGHT ? dashWidthReservation + spacing / 2 : spacing / 2) + )); + + childBox.set_origin(wsTmbX, wsTmbY); + childBox.set_size(wsTmbWidth, wsTmbHeight); + + this._workspacesThumbnails.allocate(childBox); + + availableHeight -= wsTmbHeight + spacing; + } + + + if (this._dash.visible) { + //const wMaxHeight = height - spacing - wsTmbHeight - 2 * spacing - (DASH_VERTICAL ? 0 : dashHeight + spacing); + if (opt.WS_TMB_FULL && opt.DASH_VERTICAL) { + const wMaxHeight = height - spacing - wsTmbHeight; + this._dash.setMaxSize(maxDashWidth, wMaxHeight); + [, dashWidth] = this._dash.get_preferred_width(wMaxHeight); + [, dashHeight] = this._dash.get_preferred_height(dashWidth); + dashWidth = Math.round(Math.min(dashWidth, maxDashWidth)); + dashHeight = Math.round(Math.min(dashHeight, wMaxHeight)); + } + + let dashX, dashY, offset; + if (opt.DASH_RIGHT) { + dashX = width - dashWidth; + } else if (opt.DASH_LEFT) { + dashX = 0; + } else if (opt.DASH_TOP) { + dashY = startY; + } else { + dashY = startY + height - dashHeight; + } + + if (opt.DASH_VERTICAL) { + if (opt.WS_TMB_FULL) { + offset = (height - dashHeight - wsTmbHeight) / 2; + if (opt.WS_TMB_TOP) { + offset = offset - opt.DASH_POSITION_ADJUSTMENT * (offset - spacing / 2); + dashY = startY + offset + wsTmbHeight; + //dashY = Math.max(dashY, startY + wsTmbHeight); + } else { + offset = offset - opt.DASH_POSITION_ADJUSTMENT * (offset - spacing / 2); + dashY = startY + offset; + //dashY = Math.max(dashY, height - wsTmbHeight - dashHeight - 3 * spacing); + } + } else { + offset = (height - dashHeight) / 2; + offset = offset - opt.DASH_POSITION_ADJUSTMENT * (offset - spacing / 2); + dashY = startY + offset; + } + } else { + offset = (width - dashWidth) / 2; + dashX = startX + (offset - opt.DASH_POSITION_ADJUSTMENT * (offset - spacing)); + } + + childBox.set_origin(Math.round(startX + dashX), Math.round(dashY)); + childBox.set_size(dashWidth, dashHeight); + this._dash.allocate(childBox); + } + + availableHeight -= (opt.DASH_VERTICAL ? 0 : dashHeight); + + /*let [searchHeight] = this._searchEntry.get_preferred_height(width);*/ + + // Workspaces + let params = [box, workAreaBox, dashWidth, dashHeight, wsTmbHeight, searchHeight, startY]; + const transitionParams = this._stateAdjustment.getStateTransitionParams(); + + // Update cached boxes + for (const state of Object.values(ControlsState)) { + this._cachedWorkspaceBoxes.set( + state, this._computeWorkspacesBoxForState(state, ...params)); + } + + let workspacesBox; + if (!transitionParams.transitioning) { + workspacesBox = this._cachedWorkspaceBoxes.get(transitionParams.currentState); + } + if (!workspacesBox) { + const initialBox = this._cachedWorkspaceBoxes.get(transitionParams.initialState); + const finalBox = this._cachedWorkspaceBoxes.get(transitionParams.finalState); + workspacesBox = initialBox.interpolate(finalBox, transitionParams.progress); + } + + this._workspacesDisplay.allocate(workspacesBox); + + // Search entry + const searchXoffset = (opt.DASH_LEFT ? dashWidth : 0) + spacing; + //let [searchHeight] = this._searchEntry.get_preferred_height(width - wsTmbWidth); + + // Y position under top Dash + let searchEntryX, searchEntryY; + /*if (opt.OVERVIEW_MODE2 && !opt.DASH_TOP && !opt.WS_TMB_TOP) { + searchEntryY = 7; + } else */if (opt.DASH_TOP) { + searchEntryY = startY + (opt.WS_TMB_TOP ? wsTmbHeight : 0) + dashHeight - spacing; + } else { + searchEntryY = startY + (opt.WS_TMB_TOP ? wsTmbHeight + spacing : 0); + } + + searchEntryX = searchXoffset; + let searchWidth = width - 2 * spacing - (opt.DASH_VERTICAL ? dashWidth : 0); // xAlignCenter is given by wsBox + searchWidth = this._xAlignCenter ? width : searchWidth; + + if (opt.CENTER_SEARCH_VIEW) { + childBox.set_origin(0, searchEntryY); + childBox.set_size(width, searchHeight); + } else { + childBox.set_origin(this._xAlignCenter ? 0 : searchEntryX, searchEntryY); + childBox.set_size(this._xAlignCenter ? width : searchWidth - spacing, searchHeight); + } + + this._searchEntry.allocate(childBox); + + availableHeight -= searchHeight + spacing; + + // AppDisplay - state, box, workAreaBox, searchHeight, dashHeight, appGridBox, wsTmbWidth + //if (this._appDisplay.visible) { + params = [box, workAreaBox, searchHeight, dashWidth, dashHeight, wsTmbHeight, startY]; + let appDisplayBox; + if (!transitionParams.transitioning) { + appDisplayBox = + this._getAppDisplayBoxForState(transitionParams.currentState, ...params); + } else { + const initialBox = + this._getAppDisplayBoxForState(transitionParams.initialState, ...params); + const finalBox = + this._getAppDisplayBoxForState(transitionParams.finalState, ...params); + + appDisplayBox = initialBox.interpolate(finalBox, transitionParams.progress); + } + this._appDisplay.allocate(appDisplayBox); + //} + + // Search + if (opt.CENTER_SEARCH_VIEW) { + const dashW = (opt.DASH_VERTICAL ? dashWidth : 0) + spacing; + searchWidth = width - 2 * dashW; + childBox.set_origin(dashW, startY + (opt.DASH_TOP ? dashHeight : spacing) + (opt.WS_TMB_TOP ? wsTmbHeight + spacing : 0) + searchHeight); + } else { + childBox.set_origin(this._xAlignCenter ? spacing : searchXoffset, startY + (opt.DASH_TOP ? dashHeight : spacing) + (opt.WS_TMB_TOP ? wsTmbHeight + spacing : 0) + searchHeight); + } + + childBox.set_size(searchWidth, availableHeight); + this._searchController.allocate(childBox); + + this._runPostAllocation(); + } +} + +// same copy of this function should be available in OverviewControls and WorkspacesView +function _getFitModeForState(state) { + switch (state) { + case ControlsState.HIDDEN: + case ControlsState.WINDOW_PICKER: + return FitMode.SINGLE; + case ControlsState.APP_GRID: + if (opt.WS_ANIMATION && opt.SHOW_WS_TMB) + return FitMode.ALL; + else + return FitMode.SINGLE; + default: + return FitMode.SINGLE; + } +} diff --git a/extensions/vertical-workspaces/panel.js b/extensions/vertical-workspaces/panel.js new file mode 100644 index 0000000..2f7143d --- /dev/null +++ b/extensions/vertical-workspaces/panel.js @@ -0,0 +1,178 @@ +/** + * Vertical Workspaces + * panel.js + * + * @author GdH + * @copyright 2022 - 2023 + * @license GPL-3.0 + * + */ + +'use strict'; + +const Main = imports.ui.main; +const Me = imports.misc.extensionUtils.getCurrentExtension(); + +const ANIMATION_TIME = imports.ui.overview.ANIMATION_TIME; + +let opt; +let _showingOverviewConId; +let _hidingOverviewConId; +let _styleChangedConId; + +function update(reset = false) { + opt = Me.imports.settings.opt; + const panelBox = Main.layoutManager.panelBox; + const panelHeight = Main.panel.height; // panelBox height can be 0 after shell start + + const geometry = global.display.get_monitor_geometry(global.display.get_primary_monitor()); + if (reset || opt.PANEL_POSITION_TOP) { + panelBox.set_position(geometry.x, geometry.y); + } else { + panelBox.set_position(geometry.x, geometry.y + geometry.height - panelHeight); + } + + if (!_styleChangedConId) { + Main.panel.connect('style-changed', ()=> Main.panel.remove_style_pseudo_class('overview')); + } + + if (reset || opt.PANEL_MODE === 0) { + //_disconnectPanel(); + _disconnectOverview() + _reparentPanel(false); + _showPanel(); + + if (_styleChangedConId) { + Main.panel.disconnect(_styleChangedConId); + _styleChangedConId = 0; + } + + panelBox.translation_y = 0; + panelBox.opacity = 255; + } else if (opt.PANEL_MODE === 1) { + if (opt.SHOW_WS_PREVIEW_BG) { + _reparentPanel(true); + if (opt.OVERVIEW_MODE2) { + // in OM2 if the panel has been moved to the overviewGroup move panel above all + Main.layoutManager.overviewGroup.set_child_above_sibling(panelBox, null); + } else { + // otherwise move the panel below overviewGroup so it can get below workspacesDisplay + Main.layoutManager.overviewGroup.set_child_below_sibling(panelBox, Main.overview._overview); + } + _showPanel(true); + } else { + // if ws preview bg is disabled, panel can stay in uiGroup + _reparentPanel(false); + _showPanel(false); + if (!_hidingOverviewConId) + _hidingOverviewConId = Main.overview.connect('hiding', () => { + if ((!opt.SHOW_WS_PREVIEW_BG || opt.OVERVIEW_MODE2)) { + _showPanel(false); + } + }); + if (!_showingOverviewConId) + _showingOverviewConId = Main.overview.connect('showing', () => { + if ((!opt.SHOW_WS_PREVIEW_BG || opt.OVERVIEW_MODE2)) { + _showPanel(true); + } + }); + } + + _connectPanel(); + } else if (opt.PANEL_MODE === 2) { + _disconnectOverview(); + _reparentPanel(false); + _showPanel(false); + _connectPanel(); + } + _setPanelStructs(reset || opt.PANEL_MODE === 0); +} + +function _disconnectOverview() { + if (_hidingOverviewConId) { + Main.overview.disconnect(_hidingOverviewConId); + _hidingOverviewConId = 0; + } + if (_showingOverviewConId) { + Main.overview.disconnect(_showingOverviewConId); + _showingOverviewConId = 0; + } +} + +function _reparentPanel(reparent = false) { + const panel = Main.layoutManager.panelBox; + if (reparent && panel.get_parent() === Main.layoutManager.uiGroup) { + Main.layoutManager.uiGroup.remove_child(panel); + Main.layoutManager.overviewGroup.add_child(panel); + } else if (!reparent && panel.get_parent() === Main.layoutManager.overviewGroup) { + Main.layoutManager.overviewGroup.remove_child(panel); + // return the panel at default position, pane shouldn't cover objects that should be above + Main.layoutManager.uiGroup.insert_child_at_index(panel, 4); + } +} + +function _setPanelStructs(state) { + Main.layoutManager._trackedActors.forEach(a => { + if (a.actor === Main.layoutManager.panelBox) + a.affectsStruts = state; + }); + + // workaround to force maximized windows to resize after removing affectsStruts + // simulation of minimal swipe gesture to the opposite direction + // todo - needs better solution!!!!!!!!!!! + /*const direction = _getAppGridAnimationDirection() === 2 ? 1 : -1; + Main.overview._swipeTracker._beginTouchSwipe(null, global.get_current_time(), 1, 1); + Main.overview._swipeTracker._updateGesture(null, global.get_current_time(), direction, 1); + GLib.timeout_add(0, 50, () => Main.overview._swipeTracker._endGesture(global.get_current_time(), 1, true));*/ +} + +function _showPanel(show = true) { + if (show) { + Main.panel.opacity = 255; + Main.layoutManager.panelBox.ease({ + duration: ANIMATION_TIME, + translation_y: 0, + onComplete: () => { + _setPanelStructs(opt.PANEL_MODE === 0); + } + }); + + } else { + const panelHeight = Main.panel.height; + Main.layoutManager.panelBox.ease({ + duration: ANIMATION_TIME, + translation_y: opt.PANEL_POSITION_TOP ? -panelHeight + 1 : panelHeight - 1, + onComplete: () => { + Main.panel.opacity = 0; + _setPanelStructs(opt.PANEL_MODE === 0); + } + }); + } +} + +function _connectPanel() { + // not reliable, disabled for now + /*if (!_panelEnterSigId) { + _panelEnterSigId = Main.panel.connect('enter-event', () => { + if (!Main.overview._shown) + _showPanel(true); + }); + } + if (!_panelLeaveSigId) { + _panelLeaveSigId = Main.panel.connect('leave-event', () => { + if (!Main.overview._shown) + _showPanel(false); + }); + }*/ +} + +function _disconnectPanel() { + /*if (_panelEnterSigId) { + Main.panel.disconnect(_panelEnterSigId); + _panelEnterSigId = 0; + } + if (_panelLeaveSigId) { + Main.panel.disconnect(_panelLeaveSigId); + _panelLeaveSigId = 0; + }*/ +} diff --git a/extensions/vertical-workspaces/prefs.js b/extensions/vertical-workspaces/prefs.js new file mode 100644 index 0000000..1870ea7 --- /dev/null +++ b/extensions/vertical-workspaces/prefs.js @@ -0,0 +1,1183 @@ +/** + * Vertical Workspaces + * prefs.js + * + * @author GdH + * @copyright 2022 - 2023 + * @license GPL-3.0 + */ + +'use strict'; + +const { Gtk, GLib } = imports.gi; + +const ExtensionUtils = imports.misc.extensionUtils; +const Me = ExtensionUtils.getCurrentExtension(); +const Settings = Me.imports.settings; + +const ItemFactory = Me.imports.optionsFactory.ItemFactory; +const AdwPrefs = Me.imports.optionsFactory.AdwPrefs; +const LegacyPrefs = Me.imports.optionsFactory.LegacyPrefs; + +const shellVersion = Settings.shellVersion; + +// gettext +const _ = Settings._; + +// libadwaita is available starting with GNOME Shell 42. +let Adw = null; +try { Adw = imports.gi.Adw; } catch (e) {} + +let gOptions; +let pageList; +let itemFactory; + + +function init() { + ExtensionUtils.initTranslations(Me.metadata['gettext-domain']); + gOptions = new Settings.Options(); + + itemFactory = new ItemFactory(gOptions); + + pageList = [ + { + name: 'layout', + title: _('Layout'), + iconName: 'view-grid-symbolic', + optionList: _getLayoutOptionList() + }, + { + name: 'appearance', + title: _('Appearance'), + iconName: 'view-reveal-symbolic', + optionList: _getAppearanceOptionList() + }, + { + name: 'behavior', + title: _('Behavior'), + iconName: 'preferences-other-symbolic', + optionList: _getBehaviorOptionList() + }, + { + name: 'misc', + title: _('Misc'), + iconName: 'input-keyboard-symbolic', + optionList: _getMiscOptionList() + }, + { + name: 'about', + title: _('About'), + iconName: 'preferences-system-details-symbolic', + optionList: _getAboutOptionList() + } + ]; +} + +function fillPreferencesWindow(window) { + window = new AdwPrefs(gOptions).getFilledWindow(window, pageList); + window.connect('close-request', () => { + gOptions.destroy(); + gOptions = null; + itemFactory = null; + pageList = null; + }); + + window.set_default_size(800, 800); +} + +function buildPrefsWidget() { + const prefsWidget = new LegacyPrefs(gOptions).getPrefsWidget(pageList); + + prefsWidget.connect('realize', (widget) => { + const window = widget.get_root ? widget.get_root() : widget.get_toplevel(); + const width = 800; + const height = 800; + window.set_default_size(width, height); + const headerbar = window.get_titlebar(); + headerbar.title_widget = prefsWidget._stackSwitcher; + + const signal = Gtk.get_major_version() === 3 ? 'destroy' : 'close-request'; + window.connect(signal, () => { + gOptions.destroy(); + gOptions = null; + }); + }); + + return prefsWidget; +} + +////////////////////////////////////////////////////////////////////// +function _getLayoutOptionList() { + const optionList = []; + // options item format: + // [text, caption, widget, settings-variable, options for combo] + + optionList.push( + itemFactory.getRowWidget( + _('Dash'), + ) + ); + + optionList.push( + itemFactory.getRowWidget( + _('Dash Position'), + null, + itemFactory.newComboBox(), + //itemFactory.newDropDown(), + 'dashPosition', + [ [_('Top'), 0], + [_('Right'), 1], + [_('Bottom'), 2], + [_('Left'), 3], + [_('Hide'), 4], + ] + ) + ); + + optionList.push( + itemFactory.getRowWidget( + _('Center Horizontal Dash to Workspace'), + _('If the Dash Position is set to Top or Bottom, the position will be recalculated relative to the workspace preview instead of the screen. Works only with the default Dash.'), + itemFactory.newSwitch(), + 'centerDashToWs', + ) + ); + + const dashPositionAdjustment = new Gtk.Adjustment({ + upper: 100, + lower: -100, + step_increment: 1, + page_increment: 10, + }); + + const dashPositionScale = itemFactory.newScale(dashPositionAdjustment); + dashPositionScale.add_mark(0, Gtk.PositionType.TOP, null); + optionList.push( + itemFactory.getRowWidget( + _('Fine Tune Dash Position'), + _('Adjusts position of the dock on chosen axis. Works only with the default Dash.'), + dashPositionScale, + 'dashPositionAdjust' + ) + ); + + optionList.push( + itemFactory.getRowWidget( + _('Show Apps Icon Position'), + _('Sets the position of the "Show Applications" icon in the Dash.'), + itemFactory.newComboBox(), + //itemFactory.newDropDown(), + 'showAppsIconPosition', + [ + [_('Hide'), 2], + [_('Start'), 0], + [_('End'), 1], + ] + ) + ); + + optionList.push( + itemFactory.getRowWidget( + _('Open Windows Icon Position'), + _('This option adds "Search Open Windows" icon into dash so you can directly toggle window search provider results. Even if you disable this icon, you can use the secondary mouse button click on the Show Apps Icon, or the Space hotkey to access this feature.'), + itemFactory.newComboBox(), + //itemFactory.newDropDown(), + 'dashShowWindowsIcon', + [ [_('Hide'), 0], + [_('Start'), 1], + [_('End'), 2], + ] + ) + ); + + optionList.push( + itemFactory.getRowWidget( + _('Recent Files Icon Position'), + _('This option adds "Search Recent Files" icon into dash so you can directly toggle recent files search provider results. Even if you disable this icon, you can use the secondary mouse button click on the Show Apps Icon, or the Ctrl + Space hotkey to access this feature.'), + itemFactory.newComboBox(), + //itemFactory.newDropDown(), + 'dashShowRecentFilesIcon', + [ [_('Hide'), 0], + [_('Start'), 1], + [_('End'), 2], + ] + ) + ); + + optionList.push( + itemFactory.getRowWidget( + _('Dash Max Icon Size'), + _('Maximum size of Dash icons in pixels. Works only with default Dash.'), + itemFactory.newComboBox(), + //itemFactory.newDropDown(), + 'dashMaxIconSize', + [ [_('128'), 128], + [_('112'), 112], + [_('96'), 96], + [_('80'), 80], + [_('64'), 64], + [_('48'), 48], + [_('32'), 32], + [_('24'), 24], + [_('16'), 16], + ] + ) + ); + + + optionList.push( + itemFactory.getRowWidget( + _('Workspaces Thumbnails / Orientation'), + ) + ); + + optionList.push( + itemFactory.getRowWidget( + _('Thumbnails Position / Workspaces Orientation'), + _('Position of the workspaces thumbnails on the screen also sets orientation of the workspaces to vertical or horizontal. You have two options to disable workspaces thumbnails, one sets workspaces to the vertical orientation, the second one to horizontal.'), + itemFactory.newComboBox(), + //itemFactory.newDropDown(), + 'workspaceThumbnailsPosition', + // this mess is just because of backward compatibility + [ [_('Left \t Vertical Orientation'), 0], + [_('Right \t Vertical Orientation'), 1], + [_('Hide \t Set Vertical Orientation'), 4], + [_('Top \t Horizontal Orientation'), 5], + [_('Bottom \t Horizontal Orientation'), 6], + [_('Hide \t Set Horizontal Orientation'), 9], + ] + ) + ); + + const wstPositionAdjustment = new Gtk.Adjustment({ + upper: 100, + lower: -100, + step_increment: 1, + page_increment: 10, + }); + + const wstPositionScale = itemFactory.newScale(wstPositionAdjustment); + wstPositionScale.add_mark(0, Gtk.PositionType.TOP, null); + optionList.push( + itemFactory.getRowWidget( + _('Fine Tune Workspaces Thumbnails Position'), + _('Adjusts workspaces thumbnails vertical position.'), + wstPositionScale, + 'wsTmbPositionAdjust' + ) + ); + + optionList.push( + itemFactory.getRowWidget( + _('Reserve Full Screen Height/Width for Thumbnails'), + _('The whole screen height/width will be reserved for workspaces thumbnails at the expense of space available for Dash (if the Dash is oriented in a different axis).'), + itemFactory.newSwitch(), + 'WsThumbnailsFull', + ) + ); + + optionList.push( + itemFactory.getRowWidget( + _('Workspaces Thumbnails Position on Secondary Monitor'), + _('Allows you to place workspaces thumbnails of secondary monitors on the opposite side than on the primary monitor.'), + itemFactory.newComboBox(), + //itemFactory.newDropDown(), + 'secondaryWsThumbnailsPosition', + [ [_('Left / Top'), 0], + [_('Right / Bottom'), 1], + [_('Same as Primary'), 2], + [_('Disable'), 3], + ] + ) + ); + + const SecWstPositionAdjustment = new Gtk.Adjustment({ + upper: 100, + lower: -100, + step_increment: 1, + page_increment: 10, + }); + + const SecWstPositionScale = itemFactory.newScale(SecWstPositionAdjustment); + SecWstPositionScale.add_mark(0, Gtk.PositionType.TOP, null); + optionList.push( + itemFactory.getRowWidget( + _('Fine Tune Secondary Workspaces Thumbnails Position'), + _('Adjusts secondary monitors workspaces thumbnails vertical position.'), + SecWstPositionScale, + 'SecWsTmbPositionAdjust' + ) + ); + + const wsThumbnailScaleAdjustment = new Gtk.Adjustment({ + upper: 30, + lower: 5, + step_increment: 1, + page_increment: 1, + }); + + const wsThumbnailScale = itemFactory.newScale(wsThumbnailScaleAdjustment); + wsThumbnailScale.add_mark(13, Gtk.PositionType.TOP, null); + optionList.push( + itemFactory.getRowWidget( + _('Workspaces Thumbnails Max Scale'), + _('Adjusts maximum size of the workspaces thumbnails (% relative to display width).'), + wsThumbnailScale, + 'wsThumbnailScale' + ) + ); + + + optionList.push( + itemFactory.getRowWidget( + _('Workspace Preview'), + ) + ); + + const wsScaleAdjustment = new Gtk.Adjustment({ + upper: 100, + lower: 30, + step_increment: 1, + page_increment: 10, + }); + + const wsScaleScale = itemFactory.newScale(wsScaleAdjustment); + wsScaleScale.add_mark(100, Gtk.PositionType.TOP, null); + optionList.push( + itemFactory.getRowWidget( + _('Workspaces Scale'), + _('Scales down workspaces preview so you can fit more of the adjacent workspaces on the screen. Default size is calculated to use all available space.'), + wsScaleScale, + 'wsPreviewScale' + ) + ); + + const wsSpacingAdjustment = new Gtk.Adjustment({ + upper: 500, + lower: 10, + step_increment: 1, + page_increment: 10, + }); + + const wsSpacingScale = itemFactory.newScale(wsSpacingAdjustment); + wsSpacingScale.add_mark(350, Gtk.PositionType.TOP, null); + optionList.push( + itemFactory.getRowWidget( + _('Workspaces Spacing'), + _('Adjusts spacing between workspaces previews so you can control how much of the adjacent workspaces overlap to the current workspace overview. Default value should set the adjacent workspaces out of the screen.'), + wsSpacingScale, + 'wsMaxSpacing' + ) + ); + + + optionList.push( + itemFactory.getRowWidget( + _('App Grid'), + ) + ); + + optionList.push( + itemFactory.getRowWidget( + _('Center App Grid'), + _('App grid in app view page will be centered to the display instead of the available space. This option may have impact on the size of the grid, more for narrower and small resolution displays, especially if workspaces thumbnails are bigger.'), + itemFactory.newSwitch(), + 'centerAppGrid', + ) + ); + + optionList.push( + itemFactory.getRowWidget( + _('Icon Size'), + _('Allows to force fixed icon size and bypass the default adaptive algorithm.'), + itemFactory.newComboBox(), + //itemFactory.newDropDown(), + 'appGridIconSize', + [ [_('Adaptive (Default)'), -1], + [_('128'), 128], + [_('112'), 112], + [_('96'), 96], + [_('80'), 80], + [_('64'), 64], + [_('48'), 48], + [_('32'), 32], + ] + ) + ); + + optionList.push( + itemFactory.getRowWidget( + _('Folder Icon Size'), + _('Allows to disable the default adaptive algorithm and set a fixed size of icons inside folders.'), + itemFactory.newComboBox(), + //itemFactory.newDropDown(), + 'appGridFolderIconSize', + [ [_('Adaptive (Default)'), -1], + [_('128'), 128], + [_('112'), 112], + [_('96'), 96], + [_('80'), 80], + [_('64'), 64], + [_('48'), 48], + [_('32'), 32], + ] + ) + ); + + const customGridSwitch = itemFactory.newSwitch(); + optionList.push( + itemFactory.getRowWidget( + _('Enable Custom Grid Size'), + _('Apply following grid parameters.'), + customGridSwitch, + //itemFactory.newDropDown(), + 'appGridAllowCustom' + ) + ); + + const columnsAdjustment = new Gtk.Adjustment({ + upper: 15, + lower: 2, + step_increment: 1, + page_increment: 1, + }); + + const columnsSpinBtn = itemFactory.newSpinButton(columnsAdjustment); + optionList.push(itemFactory.getRowWidget( + _('Columns per Page'), + _('Number of columns in application grid.'), + columnsSpinBtn, + 'appGridColumns' + )); + + const rowsAdjustment = new Gtk.Adjustment({ + upper: 15, + lower: 2, + step_increment: 1, + page_increment: 1, + }); + + const rowsSpinBtn = itemFactory.newSpinButton(rowsAdjustment); + optionList.push(itemFactory.getRowWidget( + _('Rows per Page'), + _('Number of rows in application grid.'), + rowsSpinBtn, + 'appGridRows' + )); + + const folderColumnsAdjustment = new Gtk.Adjustment({ + upper: 8, + lower: 2, + step_increment: 1, + page_increment: 1, + }); + + const folderColumnsSpinBtn = itemFactory.newSpinButton(folderColumnsAdjustment); + optionList.push(itemFactory.getRowWidget( + _('Folder Columns per Page'), + _('Number of columns in folder grid.'), + folderColumnsSpinBtn, + 'appGridFolderColumns' + )); + + const folderRowsAdjustment = new Gtk.Adjustment({ + upper: 8, + lower: 2, + step_increment: 1, + page_increment: 1, + }); + + const folderRowsSpinBtn = itemFactory.newSpinButton(folderRowsAdjustment); + optionList.push(itemFactory.getRowWidget( + _('Folder Rows per Page'), + _('Number of rows in folder grid.'), + folderRowsSpinBtn, + 'appGridFolderRows' + )); + + const _setOptionsSensitivity = () => { + columnsSpinBtn.sensitive = customGridSwitch.active; + rowsSpinBtn.sensitive = customGridSwitch.active; + folderColumnsSpinBtn.sensitive = customGridSwitch.active; + folderRowsSpinBtn.sensitive = customGridSwitch.active; + }; + _setOptionsSensitivity(); + customGridSwitch.connect('notify::active', () => { + _setOptionsSensitivity(); + }); + + + optionList.push( + itemFactory.getRowWidget( + _('Search View'), + ) + ); + + optionList.push( + itemFactory.getRowWidget( + _('Center Search View'), + _('Search view will be centered to the display instead of the available space. If needed, workspaces thumbnails will be temporarily scaled down to fit the search box. This option has bigger impact for narrower and small resolution displays.'), + itemFactory.newSwitch(), + 'centerSearch', + ) + ); + + optionList.push( + itemFactory.getRowWidget( + _('Always Show Search Entry'), + _('If disabled, the search entry field will be hidden when not in use, so the workspace preview and app grid may take up more space.'), + itemFactory.newSwitch(), + 'showSearchEntry', + ) + ); + + const searchViewScaleAdjustment = new Gtk.Adjustment({ + upper: 150, + lower: 50, + step_increment: 1, + page_increment: 1, + }); + + const searchViewScale = itemFactory.newScale(searchViewScaleAdjustment); + searchViewScale.add_mark(100, Gtk.PositionType.TOP, null); + optionList.push( + itemFactory.getRowWidget( + _('Search Results Width'), + _('Adjusts maximum width of search results view (% relative to default). This allows you to fit more (or less) app icons into app search result.'), + searchViewScale, + 'searchViewScale' + ) + ); + + optionList.push( + itemFactory.getRowWidget( + _('App Search Icon Size'), + _('Size of results provided by the App Search Provider.'), + itemFactory.newComboBox(), + //itemFactory.newDropDown(), + 'searchIconSize', + [[_('128'), 128], + [_('112'), 112], + [_('96'), 96], + [_('80'), 80], + [_('64'), 64], + [_('48'), 48], + [_('32'), 32],] + ) + ); + + optionList.push( + itemFactory.getRowWidget( + _('Panel'), + ) + ); + + optionList.push( + itemFactory.getRowWidget( + _('Main Panel Position'), + _('Allows you to place the main panel at the bottom of your monitor.'), + itemFactory.newComboBox(), + //itemFactory.newDropDown(), + 'panelPosition', + [ [_('Top (Default)'), 0], + [_('Bottom'), 1], + ] + ) + ); + + optionList.push( + itemFactory.getRowWidget( + _('Main Panel Visibility'), + _('Main panel can be visible always, only in the overview or never.'), + itemFactory.newComboBox(), + //itemFactory.newDropDown(), + 'panelVisibility', + [ [_('Always Visible (Default)'), 0], + [_('Overview Only'), 1], + [_('Always Hidden'), 2], + //[_('Desktop View Only'), 3], + ] + ) + ); + + return optionList; +} + +function _getAppearanceOptionList() { + const optionList = []; + // options item format: + // [text, caption, widget, settings-variable, options for combo] + + //---------------------------------------------------------------- + optionList.push( + itemFactory.getRowWidget( + _('Dash'), + ) + ); + + const dashBgAdjustment = new Gtk.Adjustment({ + upper: 100, + lower: 0, + step_increment: 1, + page_increment: 10, + }); + + const dashBgOpacityScale = itemFactory.newScale(dashBgAdjustment); + optionList.push( + itemFactory.getRowWidget( + _('Dash Background Opacity'), + _('Adjusts the opacity of the dash background.'), + dashBgOpacityScale, + 'dashBgOpacity' + ) + ); + + const dashRadAdjustment = new Gtk.Adjustment({ + upper: 50, + lower: 0, + step_increment: 1, + page_increment: 1, + }); + + const dashBgRadiusScale = itemFactory.newScale(dashRadAdjustment); + optionList.push( + itemFactory.getRowWidget( + _('Dash Background Radius'), + _('Adjusts the border radius of the dash background in pixels. 0 means default value.'), + dashBgRadiusScale, + 'dashBgRadius' + ) + ); + + optionList.push( + itemFactory.getRowWidget( + _('Workspaces Thumbnails'), + ) + ); + + optionList.push( + itemFactory.getRowWidget( + _('Show Workspaces Thumbnails Labels'), + _('Each workspace thumbnails can show its index and name (if defined in the system settings) or name/title of its most recently used app/window.'), + itemFactory.newComboBox(), + //itemFactory.newDropDown(), + 'showWsTmbLabels', + [ [_('Disable'), 0], + [_('Index'), 1], + [_('Index + WS Name'), 2], + [_('Index + App Name'), 3], + [_('Index + Window Title'), 4], + ] + ) + ); + + optionList.push( + itemFactory.getRowWidget( + _('Show WS Thumbnail Label on Hover'), + _('Show label only when the mouse pointer hovers over a thumbnail'), + itemFactory.newSwitch(), + 'showWsTmbLabelsOnHover', + ) + ); + + optionList.push( + itemFactory.getRowWidget( + _('Show Wallpaper in Workspaces Thumbnails'), + _('All workspace thumbnails will include the current desktop background.'), + itemFactory.newSwitch(), + 'showWsSwitcherBg', + ) + ); + + optionList.push( + itemFactory.getRowWidget( + _('Window Preview'), + ) + ); + + optionList.push( + itemFactory.getRowWidget( + _('Window Preview App Icon Size'), + _('Default size is 64.'), + itemFactory.newComboBox(), + //itemFactory.newDropDown(), + 'winPreviewIconSize', + [ [_('64'), 0], + [_('48'), 1], + [_('32'), 2], + [_('22'), 3], + [_('Disable'), 4] + ] + ) + ); + + optionList.push( + itemFactory.getRowWidget( + _('Always Show Window Titles'), + _('All windows on the workspace preview will show their titles, not only the one with the mouse pointer.'), + itemFactory.newSwitch(), + 'alwaysShowWinTitles', + ) + ); + + + optionList.push( + itemFactory.getRowWidget( + _('Workspace Preview'), + ) + ); + + optionList.push( + itemFactory.getRowWidget( + _('Show Workspace Preview Background'), + _('Allows you to hide the scaling background of the workspace preview.'), + itemFactory.newSwitch(), + 'showWsPreviewBg', + ) + ); + + + optionList.push( + itemFactory.getRowWidget( + _('Overview Background'), + ) + ); + + optionList.push( + itemFactory.getRowWidget( + _('Show Static Background'), + _('Show static background wallpaper instead of the solid grey color.'), + itemFactory.newSwitch(), + 'showBgInOverview', + ) + ); + + const blurBgAdjustment = new Gtk.Adjustment({ + upper: 100, + lower: 0, + step_increment: 1, + page_increment: 10, + }); + + const bgBlurScale = itemFactory.newScale(blurBgAdjustment); + optionList.push( + itemFactory.getRowWidget( + _('Blur Window Picker Background'), + _('Blur background wallpaper (if enabled) in the window picker view.'), + bgBlurScale, + 'overviewBgBlurSigma' + ) + ); + + const blurAppBgAdjustment = new Gtk.Adjustment({ + upper: 100, + lower: 0, + step_increment: 1, + page_increment: 10, + }); + + const bgAppBlurScale = itemFactory.newScale(blurAppBgAdjustment); + optionList.push( + itemFactory.getRowWidget( + _('Blur App Grid/Search View Background'), + _('Blur background wallpaper (if enabled) in the app grid and search results views.'), + bgAppBlurScale, + 'appGridBgBlurSigma' + ) + ); + + optionList.push( + itemFactory.getRowWidget( + _('Smooth Blur Transitions'), + _('Makes blur transitions smoother but can impact overall smoothness of overview animations.'), + itemFactory.newSwitch(), + 'smoothBlurTransitions', + ) + ); + + return optionList; +} + //---------------------------------------------------------------- + +function _getBehaviorOptionList() { + const optionList = []; + + optionList.push( + itemFactory.getRowWidget( + _('Overview'), + ) + ); + + optionList.push( + itemFactory.getRowWidget( + _('Overview Mode'), + _('The Expose Windows on Hover mode do not expose the workspace preview windows until the mouse pointer enters any window.\nThe Static Workspace mode does not scale the workspace preview, it only shows Dash and workspaces thumbnails over the desktop. Clicking on a workspace thumbnail scales the ws preview and exposes its windows like in the default overview mode.'), + itemFactory.newComboBox(), + //itemFactory.newDropDown(), + 'overviewMode', + [ [_('Default'), 0], + [_('Expose Windows on Hover'), 1], + [_('Static Workspace'), 2] + ] + ) + ); + + optionList.push( + itemFactory.getRowWidget( + _('Startup State'), + _('Allows to change the state in which GNOME Shell starts a session.'), + itemFactory.newComboBox(), + //itemFactory.newDropDown(), + 'startupState', + [ [_('Overview'), 0], + [_('Desktop'), 1], + [_('App Grid'), 2], + ] + ) + ); + + + optionList.push( + itemFactory.getRowWidget( + _('Dash'), + ) + ); + + optionList.push( + itemFactory.getRowWidget( + _('Dash Icon Click'), + _('if the app you clicked on has more than one window and the recently used window is not on the current workspace, the overview can switch to the workspace with the recent window.'), + itemFactory.newComboBox(), + //itemFactory.newDropDown(), + 'dashShowWindowsBeforeActivation', + [ [_('Activate Last Used Window Immediately'), 0], + [_('Switch to Workspace with Recently Used Window'), 1], + ] + ) + ); + + + optionList.push( + itemFactory.getRowWidget( + _('App Grid'), + ) + ); + + optionList.push( + itemFactory.getRowWidget( + _('Apps Order'), + _('Choose sorting method for the app grid. Note that sorting by alphabet and usage ignores folders.'), + itemFactory.newComboBox(), + //itemFactory.newDropDown(), + 'appGridOrder', + [ [_('Default'), 0], + [_('Alphabet'), 1], + [_('Usage'), 2], + ] + ) + ); + + optionList.push( + itemFactory.getRowWidget( + _('Include Dash Items'), + _('Include favorite / running apps currently present in the Dash in the app grid.'), + itemFactory.newComboBox(), + //itemFactory.newDropDown(), + 'appGridIncludeDash', + [ [_('Disable'), 0], + [_('Enable'), 1], + [_('Enable - Sort First'), 2], + ] + ) + ); + + optionList.push( + itemFactory.getRowWidget( + _('Allow Incomplete Pages'), + _('If disabled, icons from the next page (if any) are automatically moved to fill any empty slot left after an icon was (re)moved (to a folder for example).'), + itemFactory.newSwitch(), + //itemFactory.newDropDown(), + 'appGridIncompletePages' + ) + ); + + optionList.push( + itemFactory.getRowWidget( + _('Search'), + ) + ); + + const maxSearchResultsAdjustment = new Gtk.Adjustment({ + upper: 50, + lower: 5, + step_increment: 1, + page_increment: 5, + }); + + const maxSearchResultsSpinButton = itemFactory.newScale(maxSearchResultsAdjustment); + maxSearchResultsSpinButton.add_mark(10, Gtk.PositionType.TOP, null); + maxSearchResultsSpinButton.add_mark(20, Gtk.PositionType.TOP, null); + maxSearchResultsSpinButton.add_mark(30, Gtk.PositionType.TOP, null); + maxSearchResultsSpinButton.add_mark(40, Gtk.PositionType.TOP, null); + optionList.push( + itemFactory.getRowWidget( + _('Max Search Results Rows'), + _('Sets the maximum number of rows for result lists of all search providers except window search provider which always lists all results.'), + maxSearchResultsSpinButton, + 'searchMaxResultsRows' + ) + ); + + + /*optionList.push( + itemFactory.getRowWidget( + _('Window Search Provider'), + ) + );*/ + + optionList.push( + itemFactory.getRowWidget( + _('Enable Window Search Provider'), + _('Activates the window search provider that adds open windows to the search results. You can search app names and window titles. You can also use "wq/" prefix to suppress results from other search providers.'), + itemFactory.newSwitch(), + 'searchWindowsEnable' + ) + ); + + optionList.push( + itemFactory.getRowWidget( + _('Enable Recent Files Search Provider'), + _('Activates the recent files search provider that can be triggered by a dash icon, Ctrl + Space hotkey or by typing "fq//" prefix in the search entry field. This option needs File History option enabled in the GNOME Privacy settings.'), + itemFactory.newSwitch(), + 'searchRecentFilesEnable' + ) + ); + + optionList.push( + itemFactory.getRowWidget( + _('Enable Fuzzy Match'), + _('Enabling the fuzzy match allows you to skip letters in the pattern you are searching for and find "Firefox" even if you type "ffx". Works only for the Window and Recent files search providers.'), + itemFactory.newSwitch(), + 'searchFuzzy' + ) + ); + + /*const wspCommandSwitch = itemFactory.newSwitch(); + optionList.push( + itemFactory.getRowWidget( + _('Enable Commands in Search Entry'), + _('You can use following commands separated by the space at the end of entered pattern:\n/x! \t\t\t- close selected window\n/xa! \t\t\t- close all found windows\n/m[number] \t\t- (e.g. /m6) move selected window to workspace with given index\n/ma[number] \t- move all found windows to workspace with given index'), + wspCommandSwitch, + 'searchWindowsCommands' + ) + );*/ + + + optionList.push( + itemFactory.getRowWidget( + _('Animations'), + ) + ); + + optionList.push( + itemFactory.getRowWidget( + _('App Grid Animation'), + _(`When entering the App Grid view, the app grid animates from the edge of the screen. You can choose direction, keep it Default (direction will be chosen automatically) or disable the animation if you don't like it.`), + itemFactory.newComboBox(), + //itemFactory.newDropDown(), + 'appGridAnimation', + [ + [_('Default'), 4], + [_('Disable'), 0], + [_('Right to Left'), 1], + [_('Left to Right'), 2], + [_('Bottom to Top'), 3], + [_('Top to Bottom'), 5], + ] + ) + ); + + optionList.push( + itemFactory.getRowWidget( + _('Search View Animation'), + _(`When search is activated the search view with search results can animate from the edge of the screen. You can choose direction, keep it Default (currently Bottom to Top) or disable the animation if you don't like it.`), + itemFactory.newComboBox(), + //itemFactory.newDropDown(), + 'searchViewAnimation', + [ + [_('Default'), 4], + [_('Disable'), 0], + [_('Right to Left'), 1], + [_('Left to Right'), 2], + [_('Bottom to Top'), 3], + [_('Top to Bottom'), 5], + ] + ) + ); + + + optionList.push( + itemFactory.getRowWidget( + _('Workspace Preview Animation'), + _(`When entering / leaving the App Grid / Search view, the workspace preview can animate to/from workspace thumbnail.`), + itemFactory.newComboBox(), + //itemFactory.newDropDown(), + 'workspaceAnimation', + [ [_('Disable'), 0], + [_('Enable'), 1], + ] + ) + ); + + optionList.push( + itemFactory.getRowWidget( + _('Workspace Switcher Animation'), + _('Allows you to disable movement of the desktop background during workspace switcher animation outside of the overview.'), + itemFactory.newComboBox(), + //itemFactory.newDropDown(), + 'workspaceSwitcherAnimation', + [ [_('Default'), 0], + [_('Static Background'), 1], + ] + ) + ); + + const animationSpeedAdjustment = new Gtk.Adjustment({ + upper: 500, + lower: 1, + step_increment: 10, + page_increment: 100, + }); + + const animationSpeedScale = itemFactory.newScale(animationSpeedAdjustment); + animationSpeedScale.add_mark(100, Gtk.PositionType.TOP, null); + optionList.push( + itemFactory.getRowWidget( + _('Animation Speed'), + _('Adjusts the global animation speed in % of the default duration - higher value means slower animation.'), + animationSpeedScale, + 'animationSpeedFactor' + ) + ); + + return optionList; +} + +function _getMiscOptionList() { + const optionList = []; + // options item format: + // [text, caption, widget, settings-variable, options for combo] + + optionList.push( + itemFactory.getRowWidget( + _('Keyboard'), + ) + ); + + optionList.push( + itemFactory.getRowWidget( + _('Override Page Up/Down Shortcuts'), + _('This option automatically overrides the (Shift +) Super + Page Up/Down keyboard shortcuts for the current workspace orientation. If you encounter any issues, check the configuration in the dconf editor.'), + itemFactory.newSwitch(), + 'enablePageShortcuts', + ) + ); + + optionList.push( + itemFactory.getRowWidget( + _('App Grid'), + ) + ); + + optionList.push(itemFactory.getRowWidget( + _('Reset App Grid Layout'), + _('Removes all stored app grid icons positions, after the reset icons will be ordered alphabetically.'), + itemFactory.newResetButton(() => { + const settings = ExtensionUtils.getSettings('org.gnome.shell'); + settings.set_value('app-picker-layout', new GLib.Variant('aa{sv}', [])); + }), + )); + + optionList.push(itemFactory.getRowWidget( + _('Remove App Grid Folders'), + _('Removes all folders, folder apps move to root grid.'), + itemFactory.newResetButton(() => { + const settings = ExtensionUtils.getSettings('org.gnome.desktop.app-folders'); + settings.set_strv('folder-children', []); + }), + )); + + optionList.push( + itemFactory.getRowWidget( + _('Compatibility'), + ) + ); + + optionList.push( + itemFactory.getRowWidget( + _('Fix for Dash to Dock'), + _('With the default Ubuntu Dock and other Dash To Dock forks, you may experience issues with Activities overview after you change Dock position or change monitors configuration. If you are experiencing such issues, try to enable this option, or disable/replace the dock extension.'), + itemFactory.newSwitch(), + 'fixUbuntuDock', + ) + ); + + return optionList; +} + +function _getAboutOptionList() { + const optionList = []; + + optionList.push(itemFactory.getRowWidget( + Me.metadata.name + )); + + optionList.push(itemFactory.getRowWidget( + _('Version'), + null, + itemFactory.newLabel(Me.metadata.version.toString()), + )); + + optionList.push(itemFactory.getRowWidget( + _('Reset all options'), + _('Set all options to default values.'), + itemFactory.newOptionsResetButton(), + )); + + + optionList.push(itemFactory.getRowWidget( + _('Links') + )); + + optionList.push(itemFactory.getRowWidget( + _('Homepage'), + _('Source code and more info about this extension'), + itemFactory.newLinkButton('https://github.com/G-dH/vertical-workspaces'), + )); + + optionList.push(itemFactory.getRowWidget( + _('Changelog'), + _("See what's changed."), + itemFactory.newLinkButton('https://github.com/G-dH/vertical-workspaces/blob/main/CHANGELOG.md'), + )); + + optionList.push(itemFactory.getRowWidget( + _('GNOME Extensions'), + _('Rate and comment the extension on GNOME Extensions site.'), + itemFactory.newLinkButton('https://extensions.gnome.org/extension/5177'), + )); + + optionList.push(itemFactory.getRowWidget( + _('Report a bug or suggest new feature'), + null, + itemFactory.newLinkButton('https://github.com/G-dH/vertical-workspaces/issues'), + )); + + optionList.push(itemFactory.getRowWidget( + _('Buy Me a Coffee'), + _('If you like this extension, you can help me with my coffee expenses.'), + itemFactory.newLinkButton('https://buymeacoffee.com/georgdh'), + )); + + return optionList; +} diff --git a/extensions/vertical-workspaces/recentFilesSearchProvider.js b/extensions/vertical-workspaces/recentFilesSearchProvider.js new file mode 100644 index 0000000..b94d696 --- /dev/null +++ b/extensions/vertical-workspaces/recentFilesSearchProvider.js @@ -0,0 +1,324 @@ +/** + * Vertical Workspaces + * recentFilesSearchProvider.js + * + * @author GdH + * @copyright 2022 - 2023 + * @license GPL-3.0 + */ + +'use strict'; + +const { GLib, GObject, Gio, Gtk, Meta, St, Shell } = imports.gi; + +const Main = imports.ui.main; +const ExtensionUtils = imports.misc.extensionUtils; +const Me = ExtensionUtils.getCurrentExtension(); +const Settings = Me.imports.settings; +const _ = Me.imports.settings._; + +const shellVersion = Settings.shellVersion; + +const ModifierType = imports.gi.Clutter.ModifierType; + +let recentFilesSearchProvider; +let _enableTimeoutId = 0; + +// prefix helps to eliminate results from other search providers +// so it needs to be something less common +// needs to be accessible from vw module +var prefix = 'fq//'; + +var opt; + +const Action = { + NONE: 0, + CLOSE: 1, + CLOSE_ALL: 2, + MOVE_TO_WS: 3, + MOVE_ALL_TO_WS: 4 +} + +function init() { +} + +function getOverviewSearchResult() { + return Main.overview._overview.controls._searchController._searchResults; +} + + +function update(reset = false) { + opt = Me.imports.settings.opt; + if (!reset && opt.RECENT_FILES_SEARCH_PROVIDER_ENABLED && !recentFilesSearchProvider) { + enable(); + } else if (reset || !opt.RECENT_FILES_SEARCH_PROVIDER_ENABLED) { + disable(); + opt = null; + } +} + +function enable() { + // delay because Fedora had problem to register a new provider soon after Shell restarts + _enableTimeoutId = GLib.timeout_add( + GLib.PRIORITY_DEFAULT, + 2000, + () => { + if (recentFilesSearchProvider == null) { + recentFilesSearchProvider = new RecentFilesSearchProvider(opt); + getOverviewSearchResult()._registerProvider(recentFilesSearchProvider); + } + _enableTimeoutId = 0; + return GLib.SOURCE_REMOVE; + } + ); +} + +function disable() { + if (recentFilesSearchProvider) { + getOverviewSearchResult()._unregisterProvider(recentFilesSearchProvider); + recentFilesSearchProvider = null; + } + if (_enableTimeoutId) { + GLib.source_remove(_enableTimeoutId); + _enableTimeoutId = 0; + } +} + +function fuzzyMatch(term, text) { + let pos = -1; + const matches = []; + // convert all accented chars to their basic form and to lower case + const _text = text;//.normalize('NFD').replace(/[\u0300-\u036f]/g, '').toLowerCase(); + const _term = term.normalize('NFD').replace(/[\u0300-\u036f]/g, '').toLowerCase(); + + // if term matches the substring exactly, gains the highest weight + if (_text.includes(_term)) { + return 0; + } + + for (let i = 0; i < _term.length; i++) { + let c = _term[i]; + let p; + if (pos > 0) + p = _term[i - 1]; + while (true) { + pos += 1; + if (pos >= _text.length) { + return -1; + } + if (_text[pos] == c) { + matches.push(pos); + break; + } else if (_text[pos] == p) { + matches.pop(); + matches.push(pos); + } + } + } + + // add all position to get a weight of the result + // results closer to the beginning of the text and term characters closer to each other will gain more weight. + return matches.reduce((r, p) => r + p) - matches.length * matches[0] + matches[0]; +} + +function strictMatch(term, text) { + // remove diacritics and accents from letters + let s = text.normalize('NFD').replace(/[\u0300-\u036f]/g, '').toLowerCase(); + let p = term.toLowerCase(); + let ps = p.split(/ +/); + + // allows to use multiple exact patterns separated by a space in arbitrary order + for (let w of ps) { // escape regex control chars + if (!s.match(w.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'))) { + return -1; + } + } + return 0; +} + +function makeResult(window, i) { + const app = Shell.WindowTracker.get_default().get_window_app(window); + const appName = app ? app.get_name() : 'Unknown'; + const windowTitle = window.get_title(); + const wsIndex = window.get_workspace().index(); + + return { + 'id': i, + // convert all accented chars to their basic form and lower case for search + 'name': `${wsIndex + 1}: ${windowTitle} ${appName}`.normalize('NFD').replace(/[\u0300-\u036f]/g, '').toLowerCase(), + 'appName': appName, + 'windowTitle': windowTitle, + 'window': window + } +} + +const closeSelectedRegex = /^\/x!$/; +const closeAllResultsRegex = /^\/xa!$/; +const moveToWsRegex = /^\/m[0-9]+$/; +const moveAllToWsRegex = /^\/ma[0-9]+$/; + +var RecentFilesSearchProvider = class RecentFilesSearchProvider { + constructor(gOptions) { + this._gOptions = gOptions; + this.appInfo = Gio.AppInfo.create_from_commandline('/usr/bin/nautilus -ws recent:///', 'Recent Files', null); + //this.appInfo = Shell.AppSystem.get_default().lookup_app('org.gnome.Nautilus.desktop').appInfo; + this.appInfo.get_description = () => _('Search recent files'); + this.appInfo.get_name = () => _('Recent Files'); + this.appInfo.get_id = () => 'org.gnome.Nautilus.desktop'; + this.appInfo.get_icon = () => Gio.icon_new_for_string('document-open-recent-symbolic'); + this.appInfo.should_show = () => true; + this.title = _('Recent Files Search Provider'), + this.canLaunchSearch = true; + this.isRemoteProvider = false; + } + + _getResultSet (terms) { + if (!terms[0].startsWith(prefix)) + return []; + // do not modify original terms + let termsCopy = [...terms]; + // search for terms without prefix + termsCopy[0] = termsCopy[0].replace(prefix, ''); + + const candidates = this.files; + const _terms = [].concat(termsCopy); + let match; + + const term = _terms.join(' '); + match = (s) => { + return fuzzyMatch(term, s); + } + + const results = []; + let m; + for (let id in candidates) { + const file = this.files[id]; + const name = `${file.get_age()}d: ${file.get_display_name()} ${file.get_uri_display().replace(`\/${file.get_display_name()}`, '')}`; + if (this._gOptions.get('searchFuzzy')) { + m = fuzzyMatch(term, name); + } else { + m = strictMatch(term, name); + } + if (m !== -1) { + results.push({ weight: m, id: id}); + } + } + + results.sort((a, b) => this.files[a.id].get_visited() < this.files[b.id].get_visited()); + + this.resultIds = results.map((item) => item.id); + return this.resultIds; + } + + getResultMetas (resultIds, callback = null) { + const metas = resultIds.map((id) => this.getResultMeta(id)); + if (shellVersion >= 43) { + return new Promise(resolve => resolve(metas)); + } else { + callback(metas); + } + } + + getResultMeta (resultId) { + const result = this.files[resultId]; + return { + 'id': resultId, + 'name': `${result.get_age()}: ${result.get_display_name()}`, + 'description': `${result.get_uri_display().replace(`\/${result.get_display_name()}`, '')}`, + 'createIcon': (size) => { + let icon = this.getIcon(result, size); + return icon; + }, + } + } + + getIcon(result, size) { + let file = Gio.File.new_for_uri(result.get_uri()); + let info = file.query_info(Gio.FILE_ATTRIBUTE_THUMBNAIL_PATH, + Gio.FileQueryInfoFlags.NONE, null); + let path = info.get_attribute_byte_string( + Gio.FILE_ATTRIBUTE_THUMBNAIL_PATH); + + let icon, gicon; + + if (path) { + gicon = Gio.FileIcon.new(Gio.File.new_for_path(path)); + } else { + const appInfo = Gio.AppInfo.get_default_for_type(result.get_mime_type(), false); + if (appInfo) + gicon = appInfo.get_icon(); + } + + if (gicon) { + icon = new St.Icon({ gicon, icon_size: size }); + } else { + icon = new St.Icon({ icon_name: 'icon-missing', icon_size: size }); + } + + return icon; + } + + launchSearch(terms, timeStamp) { + this._openNautilus('recent:///') + } + + _openNautilus(uri) { + try { + GLib.spawn_command_line_async(`nautilus -ws ${uri}`); + } catch (e) { + log(e); + } + } + + activateResult (resultId, terms, timeStamp) { + const file = this.files[resultId]; + + const [,,state] = global.get_pointer(); + //const isCtrlPressed = (state & ModifierType.CONTROL_MASK) != 0; + const isShiftPressed = (state & ModifierType.SHIFT_MASK) != 0; + + if (isShiftPressed) { + Main.overview.toggle(); + this._openNautilus(file.get_uri()); + } else { + const appInfo = Gio.AppInfo.get_default_for_type(file.get_mime_type(), false); + if (!(appInfo && appInfo.launch_uris([file.get_uri()], null))) { + this._openNautilus(file.get_uri()); + } + } + } + + getInitialResultSet (terms, callback, cancellable = null) { + if (shellVersion >=43) { + cancellable = callback; + } + + const filesDict = {}; + const files = Gtk.RecentManager.get_default().get_items().filter((f)=> f.exists()); + + for (let file of files) { + filesDict[file.get_uri()] = file; + } + + this.files = filesDict; + + if (shellVersion >= 43) { + return new Promise(resolve => resolve(this._getResultSet(terms))); + } else { + callback(this._getResultSet(terms)); + } + } + + filterResults (results, maxResults) { + return results.slice(0, maxResults); + } + + getSubsearchResultSet (previousResults, terms, callback, cancellable) { + // if we return previous results, quick typers get non-actual results + callback(this._getResultSet(terms)); + } + + createResultOjbect(resultMeta) { + return this.files[resultMeta.id]; + } +} diff --git a/extensions/vertical-workspaces/schemas/org.gnome.shell.extensions.vertical-workspaces.gschema.xml b/extensions/vertical-workspaces/schemas/org.gnome.shell.extensions.vertical-workspaces.gschema.xml new file mode 100644 index 0000000..c29994d --- /dev/null +++ b/extensions/vertical-workspaces/schemas/org.gnome.shell.extensions.vertical-workspaces.gschema.xml @@ -0,0 +1,179 @@ + + + + + 0 + + + false + + + 2 + + + 350 + + + 100 + + + 0 + + + 0 + + + 1 + + + 1 + + + 1 + + + 0 + + + 3 + + + false + + + 0 + + + false + + + false + + + true + + + false + + + 13 + + + 48 + + + 40 + + + 0 + + + false + + + true + + + false + + + true + + + 0 + + + 40 + + + false + + + 4 + + + 4 + + + 1 + + + 1 + + + 100 + + + true + + + 1 + + + true + + + 2 + + + 0 + + + 64 + + + 103 + + + false + + + 80 + + + 8 + + + 4 + + + 0 + + + 0 + + + 80 + + + 3 + + + 3 + + + true + + + 1 + + + true + + + true + + + false + + + 10 + + + 0 + + + 0 + + + diff --git a/extensions/vertical-workspaces/screenshots/screenshot.jpg b/extensions/vertical-workspaces/screenshots/screenshot.jpg new file mode 100644 index 0000000..b10585e Binary files /dev/null and b/extensions/vertical-workspaces/screenshots/screenshot.jpg differ diff --git a/extensions/vertical-workspaces/screenshots/screenshot0.png b/extensions/vertical-workspaces/screenshots/screenshot0.png new file mode 100644 index 0000000..b6af4b9 Binary files /dev/null and b/extensions/vertical-workspaces/screenshots/screenshot0.png differ diff --git a/extensions/vertical-workspaces/screenshots/screenshot1.png b/extensions/vertical-workspaces/screenshots/screenshot1.png new file mode 100644 index 0000000..b2b10be Binary files /dev/null and b/extensions/vertical-workspaces/screenshots/screenshot1.png differ diff --git a/extensions/vertical-workspaces/screenshots/screenshot2.png b/extensions/vertical-workspaces/screenshots/screenshot2.png new file mode 100644 index 0000000..56b1ce9 Binary files /dev/null and b/extensions/vertical-workspaces/screenshots/screenshot2.png differ diff --git a/extensions/vertical-workspaces/screenshots/screenshot3.png b/extensions/vertical-workspaces/screenshots/screenshot3.png new file mode 100644 index 0000000..daa3ee5 Binary files /dev/null and b/extensions/vertical-workspaces/screenshots/screenshot3.png differ diff --git a/extensions/vertical-workspaces/screenshots/screenshot4.png b/extensions/vertical-workspaces/screenshots/screenshot4.png new file mode 100644 index 0000000..af37399 Binary files /dev/null and b/extensions/vertical-workspaces/screenshots/screenshot4.png differ diff --git a/extensions/vertical-workspaces/screenshots/screenshot5.png b/extensions/vertical-workspaces/screenshots/screenshot5.png new file mode 100644 index 0000000..8cd2a84 Binary files /dev/null and b/extensions/vertical-workspaces/screenshots/screenshot5.png differ diff --git a/extensions/vertical-workspaces/screenshots/vertical-workspaces.gif b/extensions/vertical-workspaces/screenshots/vertical-workspaces.gif new file mode 100644 index 0000000..c97c653 Binary files /dev/null and b/extensions/vertical-workspaces/screenshots/vertical-workspaces.gif differ diff --git a/extensions/vertical-workspaces/search.js b/extensions/vertical-workspaces/search.js new file mode 100644 index 0000000..3193eb2 --- /dev/null +++ b/extensions/vertical-workspaces/search.js @@ -0,0 +1,52 @@ +/** + * Vertical Workspaces + * search.js + * + * @author GdH + * @copyright 2022 - 2023 + * @license GPL-3.0 + * + */ + +'use strict'; + +const { Meta } = imports.gi; + +const Main = imports.ui.main; + +const Me = imports.misc.extensionUtils.getCurrentExtension(); +const _Util = Me.imports.util; + +let _overrides; +let opt; + +let SEARCH_MAX_WIDTH; + +function update(reset = false) { + opt = Me.imports.settings.opt; + _updateSearchViewWidth(reset); + + if (reset) { + Main.overview.searchEntry.visible = true; + Main.overview.searchEntry.opacity = 255; + _overrides = null; + opt = null; + return; + } +} + +function _updateSearchViewWidth(reset = false) { + const searchContent = Main.overview._overview._controls.layoutManager._searchController._searchResults._content; + if (!SEARCH_MAX_WIDTH) { // just store original value; + const themeNode = searchContent.get_theme_node(); + const width = themeNode.get_max_width(); + SEARCH_MAX_WIDTH = width; + } + + if (reset) { + searchContent.set_style(''); + } else { + let width = Math.round(SEARCH_MAX_WIDTH * opt.SEARCH_VIEW_SCALE); + searchContent.set_style(`max-width: ${width}px;`); + } +} diff --git a/extensions/vertical-workspaces/settings.js b/extensions/vertical-workspaces/settings.js new file mode 100644 index 0000000..feb285e --- /dev/null +++ b/extensions/vertical-workspaces/settings.js @@ -0,0 +1,310 @@ +/** + * Vertical Workspaces + * settings.js + * + * @author GdH + * @copyright 2022 - 2023 + * @license GPL-3.0 + */ + +'use strict'; + +const { GLib } = imports.gi; + +const ExtensionUtils = imports.misc.extensionUtils; +const Me = ExtensionUtils.getCurrentExtension(); + +const Config = imports.misc.config; +var shellVersion = parseFloat(Config.PACKAGE_VERSION); + +const Gettext = imports.gettext.domain(Me.metadata['gettext-domain']); +var _ = Gettext.gettext; +const _schema = Me.metadata['settings-schema']; + +// common instance of Options accessible from all modules +var opt; + + +var Options = class Options { + constructor() { + this._gsettings = ExtensionUtils.getSettings(_schema); + this._connectionIds = []; + this._writeTimeoutId = 0; + this._gsettings.delay(); + this.connect('changed', () => { + if (this._writeTimeoutId) + GLib.Source.remove(this._writeTimeoutId); + + this._writeTimeoutId = GLib.timeout_add( + GLib.PRIORITY_DEFAULT, + 100, + () => { + this._gsettings.apply(); + this._updateCachedSettings(); + this._writeTimeoutId = 0; + return GLib.SOURCE_REMOVE; + } + ); + }); + this.options = { + workspaceThumbnailsPosition: ['int', 'ws-thumbnails-position'], + wsMaxSpacing: ['int', 'ws-max-spacing'], + wsPreviewScale: ['int', 'ws-preview-scale'], + WsThumbnailsFull: ['bool', 'ws-thumbnails-full'], + secondaryWsThumbnailsPosition: ['int', 'secondary-ws-thumbnails-position'], + dashPosition: ['int', 'dash-position'], + dashPositionAdjust: ['int', 'dash-position-adjust'], + wsTmbPositionAdjust: ['int', 'wst-position-adjust'], + showWsTmbLabels: ['int', 'show-wst-labels'], + showWsTmbLabelsOnHover: ['boolean', 'show-wst-labels-on-hover'], + SecWsTmbPositionAdjust: ['int', 'sec-wst-position-adjust'], + dashMaxIconSize: ['int', 'dash-max-icon-size'], + dashShowWindowsIcon: ['int', 'dash-show-windows-icon'], + dashShowRecentFilesIcon: ['int', 'dash-show-recent-files-icon'], + centerDashToWs: ['boolean', 'center-dash-to-ws'], + showAppsIconPosition: ['int', 'show-app-icon-position'], + wsThumbnailScale: ['int', 'ws-thumbnail-scale'], + showSearchEntry: ['boolean', 'show-search-entry'], + centerSearch: ['boolean', 'center-search'], + centerAppGrid: ['boolean', 'center-app-grid'], + dashBgOpacity: ['int', 'dash-bg-opacity'], + dashBgRadius: ['int', 'dash-bg-radius'], + enablePageShortcuts: ['boolean', 'enable-page-shortcuts'], + showWsSwitcherBg: ['boolean', 'show-ws-switcher-bg'], + showWsPreviewBg: ['boolean', 'show-ws-preview-bg'], + showBgInOverview: ['boolean', 'show-bg-in-overview'], + overviewBgBlurSigma: ['int', 'overview-bg-blur-sigma'], + appGridBgBlurSigma: ['int', 'app-grid-bg-blur-sigma'], + smoothBlurTransitions: ['boolean', 'smooth-blur-transitions'], + appGridAnimation: ['int', 'app-grid-animation'], + searchViewAnimation: ['int', 'search-view-animation'], + workspaceAnimation: ['int', 'workspace-animation'], + animationSpeedFactor: ['int', 'animation-speed-factor'], + fixUbuntuDock: ['boolean', 'fix-ubuntu-dock'], + winPreviewIconSize: ['int', 'win-preview-icon-size'], + alwaysShowWinTitles: ['int', 'always-show-win-titles'], + startupState: ['int', 'startup-state'], + overviewMode: ['int', 'overview-mode'], + workspaceSwitcherAnimation: ['int', 'workspace-switcher-animation'], + searchIconSize: ['int', 'search-icon-size'], + searchViewScale: ['int', 'search-width-scale'], + appGridAllowCustom: ['int', 'app-grid-allow-custom'], + appGridIconSize: ['int', 'app-grid-icon-size'], + appGridColumns: ['int', 'app-grid-columns'], + appGridRows: ['int', 'app-grid-rows'], + appGridFolderIconSize: ['int', 'app-grid-folder-icon-size'], + appGridFolderColumns: ['int', 'app-grid-folder-columns'], + appGridFolderRows: ['int', 'app-grid-folder-rows'], + appGridIncludeDash: ['int', 'app-grid-include-dash'], + appGridIncompletePages: ['boolean', 'app-grid-incomplete-pages'], + appGridOrder: ['int', 'app-grid-order'], + searchWindowsEnable: ['boolean', 'search-windows-enable'], + searchRecentFilesEnable: ['boolean', 'search-recent-files-enable'], + searchFuzzy: ['boolean', 'search-fuzzy'], + searchMaxResultsRows: ['int', 'search-max-results-rows'], + dashShowWindowsBeforeActivation: ['int', 'dash-show-windows-before-activation'], + panelVisibility: ['int', 'panel-visibility'], + panelPosition: ['int', 'panel-position'], + } + this.cachedOptions = {}; + + this.shellVersion = shellVersion; + } + + connect(name, callback) { + const id = this._gsettings.connect(name, callback); + this._connectionIds.push(id); + return id; + } + + destroy() { + this._connectionIds.forEach(id => this._gsettings.disconnect(id)); + if (this._writeTimeoutId) { + GLib.source_remove(this._writeTimeoutId); + this._writeTimeoutId = 0; + } + } + + _updateCachedSettings(settings, key) { + Object.keys(this.options).forEach(v => this.get(v, true)); + } + + get(option, updateCache = false) { + if (!this.options[option]) { + log(`[${Me.metadata.name}] Error: Option ${option} is undefined.`); + return; + } + + if (updateCache || this.cachedOptions[option] === undefined) { + const [format, key, settings] = this.options[option]; + let gSettings; + if (settings !== undefined) { + gSettings = settings(); + } else { + gSettings = this._gsettings; + } + + this.cachedOptions[option] = gSettings.get_value(key).deep_unpack(); + } + + return this.cachedOptions[option]; + } + + set(option, value) { + const [format, key, settings] = this.options[option]; + + let gSettings = this._gsettings; + + if (settings !== undefined) { + gSettings = settings(); + } + + switch (format) { + case 'boolean': + gSettings.set_boolean(key, value); + break; + case 'int': + gSettings.set_int(key, value); + break; + case 'string': + gSettings.set_string(key, value); + break; + case 'strv': + gSettings.set_strv(key, value); + break; + } + } + + getDefault(option) { + const [format, key, settings] = this.options[option]; + + let gSettings = this._gsettings; + + if (settings !== undefined) { + gSettings = settings(); + } + + return gSettings.get_default_value(key).deep_unpack(); + } + + _updateSettings(settings, key) { + this.DASH_POSITION = this.get('dashPosition', true); + this.DASH_TOP = this.DASH_POSITION === 0; + this.DASH_RIGHT = this.DASH_POSITION === 1; + this.DASH_BOTTOM = this.DASH_POSITION === 2; + this.DASH_LEFT = this.DASH_POSITION === 3; + this.DASH_VERTICAL = this.DASH_LEFT || this.DASH_RIGHT; + this.DASH_VISIBLE = this.DASH_POSITION !== 4; // 4 - disable + this.DASH_FOLLOW_RECENT_WIN = false; + + this.DASH_POSITION_ADJUSTMENT = this.get('dashPositionAdjust', true); + this.DASH_POSITION_ADJUSTMENT = this.DASH_POSITION_ADJUSTMENT * -1 / 100; // range 1 to -1 + this.CENTER_DASH_WS = this.get('centerDashToWs', true); + + this.MAX_ICON_SIZE = 64; // updates from main module + this.SHOW_WINDOWS_ICON = this.get('dashShowWindowsIcon', true); + this.SHOW_RECENT_FILES_ICON = this.get('dashShowRecentFilesIcon', true); + + this.WS_TMB_POSITION = this.get('workspaceThumbnailsPosition', true); + this.ORIENTATION = this.WS_TMB_POSITION > 4 ? 0 : 1; + this.WORKSPACE_MAX_SPACING = this.get('wsMaxSpacing', true); + //ORIENTATION || DASH_LEFT || DASH_RIGHT ? 350 : 80; + this.SHOW_WS_TMB = ![4, 9].includes(this.WS_TMB_POSITION); // 4, 9 - disable + this.WS_TMB_FULL = this.get('WsThumbnailsFull', true); + // translate ws tmb position to 0 top, 1 right, 2 bottom, 3 left + //0L 1R, 2LF, 3RF, 4DV, 5T, 6B, 7TF, 8BF, 9DH + this.WS_TMB_POSITION = [3, 1, 3, 1, 4, 0, 2, 0, 2, 8][this.WS_TMB_POSITION]; + this.WS_TMB_TOP = this.WS_TMB_POSITION === 0; + this.WS_TMB_RIGHT = this.WS_TMB_POSITION === 1; + this.WS_TMB_BOTTOM = this.WS_TMB_POSITION === 2; + this.WS_TMB_LEFT = this.WS_TMB_POSITION === 3; + this.WS_TMB_POSITION_ADJUSTMENT = this.get('wsTmbPositionAdjust', true) * -1 / 100; // range 1 to -1 + this.SEC_WS_TMB_POSITION = this.get('secondaryWsThumbnailsPosition', true); + this.SEC_WS_TMB_TOP = (this.SEC_WS_TMB_POSITION === 0 && !this.ORIENTATION) || (this.SEC_WS_TMB_POSITION === 2 && this.WS_TMB_TOP); + this.SEC_WS_TMB_RIGHT = (this.SEC_WS_TMB_POSITION === 1 && this.ORIENTATION) || (this.SEC_WS_TMB_POSITION === 2 && this.WS_TMB_RIGHT); + this.SEC_WS_TMB_BOTTOM = (this.SEC_WS_TMB_POSITION === 1 && !this.ORIENTATION) || (this.SEC_WS_TMB_POSITION === 2 && this.WS_TMB_BOTTOM); + this.SEC_WS_TMB_LEFT = (this.SEC_WS_TMB_POSITION === 0 && this.ORIENTATION) || (this.SEC_WS_TMB_POSITION === 2 && this.WS_TMB_LEFT); + + this.SEC_WS_TMB_POSITION_ADJUSTMENT = this.get('SecWsTmbPositionAdjust', true) * -1 / 100; // range 1 to -1 + this.SHOW_WST_LABELS = this.get('showWsTmbLabels', true); + this.SHOW_WST_LABELS_ON_HOVER = this.get('showWsTmbLabelsOnHover', true); + + this.MAX_THUMBNAIL_SCALE = this.get('wsThumbnailScale', true) / 100; + + this.WS_PREVIEW_SCALE = this.get('wsPreviewScale', true) / 100; + // calculate number of possibly visible neighbor previews according to ws scale + this.NUMBER_OF_VISIBLE_NEIGHBORS = Math.round(1 + (100 - this.WS_PREVIEW_SCALE) / 40); + + this.SHOW_WS_TMB_BG = this.get('showWsSwitcherBg', true) && this.SHOW_WS_TMB; + this.SHOW_WS_PREVIEW_BG = this.get('showWsPreviewBg', true); + + this.CENTER_APP_GRID = this.get('centerAppGrid', true); + + this.SHOW_SEARCH_ENTRY = this.get('showSearchEntry', true); + this.CENTER_SEARCH_VIEW = this.get('centerSearch', true); + this.APP_GRID_ANIMATION = this.get('appGridAnimation', true); + if (this.APP_GRID_ANIMATION === 4) { + this.APP_GRID_ANIMATION = this._getAnimationDirection(); + } + this.SEARCH_VIEW_ANIMATION = this.get('searchViewAnimation', true); + if (this.SEARCH_VIEW_ANIMATION === 4) { + this.SEARCH_VIEW_ANIMATION = 3; + } + this.WS_ANIMATION = this.get('workspaceAnimation', true); + + this.WIN_PREVIEW_ICON_SIZE = [64, 48, 32, 22, 8][this.get('winPreviewIconSize', true)]; + this.ALWAYS_SHOW_WIN_TITLES = this.get('alwaysShowWinTitles', true); + + this.STARTUP_STATE = this.get('startupState', true); + this.SHOW_BG_IN_OVERVIEW = this.get('showBgInOverview', true); + this.OVERVIEW_BG_BLUR_SIGMA = this.get('overviewBgBlurSigma', true); + this.APP_GRID_BG_BLUR_SIGMA = this.get('appGridBgBlurSigma', true); + this.SMOOTH_BLUR_TRANSITIONS = this.get('smoothBlurTransitions', true); + + this.OVERVIEW_MODE = this.get('overviewMode', true); + this.OVERVIEW_MODE2 = this.OVERVIEW_MODE === 2; + this.WORKSPACE_MODE = this.OVERVIEW_MODE ? 0 : 1; + //Workspace.WINDOW_PREVIEW_MAXIMUM_SCALE = 0.95; + + this.STATIC_WS_SWITCHER_BG = this.get('workspaceSwitcherAnimation', true); + + this.ANIMATION_TIME_FACTOR = this.get('animationSpeedFactor', true) / 100; + //St.Settings.get().slow_down_factor = this.ANIMATION_TIME_FACTOR; + + this.SEARCH_ICON_SIZE = this.get('searchIconSize', true); + this.SEARCH_VIEW_SCALE = this.get('searchViewScale', true) / 100; + this.SEARCH_MAX_ROWS = this.get('searchMaxResultsRows', true); + //imports.ui.search.MAX_LIST_SEARCH_RESULTS_ROWS = this.SEARCH_MAX_ROWS; + + this.APP_GRID_ALLOW_INCOMPLETE_PAGES = false; + this.APP_GRID_ALLOW_CUSTOM = this.get('appGridAllowCustom', true); + this.APP_GRID_ICON_SIZE = this.get('appGridIconSize', true); + this.APP_GRID_COLUMNS = this.get('appGridColumns', true); + this.APP_GRID_ROWS = this.get('appGridRows', true); + this.APP_GRID_ORDER = this.get('appGridOrder', true); + this.APP_GRID_INCLUDE_DASH = this.get('appGridIncludeDash', true); + + this.APP_GRID_FOLDER_ICON_SIZE = this.get('appGridFolderIconSize', true); + this.APP_GRID_FOLDER_COLUMNS = this.get('appGridFolderColumns', true); + this.APP_GRID_FOLDER_ROWS = this.get('appGridFolderRows', true); + + this.DASH_SHOW_WINS_BEFORE = this.get('dashShowWindowsBeforeActivation', true); + this.DASH_SHIFT_CLICK_MV = true; + + this.WINDOW_SEARCH_PROVIDER_ENABLED = this.get('searchWindowsEnable', true); + this.RECENT_FILES_SEARCH_PROVIDER_ENABLED = this.get('searchRecentFilesEnable', true); + + this.PANEL_POSITION_TOP = this.get('panelPosition', true) === 0; + this.PANEL_MODE = this.get('panelVisibility', true); + this.START_Y_OFFSET = 0; // set from main module + } + + _getAnimationDirection() { + if (this.ORIENTATION) { + return (this.WS_TMB_LEFT || !this.SHOW_WS_TMB) ? 1 : 2; // 1 right, 2 left + } else { + return (this.WS_TMB_TOP || !this.SHOW_WS_TMB) ? 3 : 5; // 3 bottom, 5 top + } + } + +}; diff --git a/extensions/vertical-workspaces/stylesheet.css b/extensions/vertical-workspaces/stylesheet.css new file mode 100644 index 0000000..b43c192 --- /dev/null +++ b/extensions/vertical-workspaces/stylesheet.css @@ -0,0 +1,167 @@ +/* General dash */ +#dash.vertical-overview { + margin-right: 0px; + margin-left: 0px; + padding: 0px 0; +} + +#dash.vertical-overview .app-well-app, +#dash.vertical-overview .show-apps { + padding-right: 8px; + padding-left: 8px; + /*spacing between icons*/ + padding-top: 1px; + padding-bottom: 1px; + margin: 0px; +} + +#dash.vertical-overview .dash-separator { + height: 1px; + margin-right: 2px; + margin-left: 2px; + margin-top: 4px; + margin-bottom: 4px; + background-color: transparentize(#eeeeec, 0.7); +} + +#dash.vertical-overview .overview-icon { + padding: 5px 0; +} + +#dash.vertical-overview .app-well-app-running-dot { + margin: 4px 0px; + width: 2px; + height: 16px; +} + +#dash.vertical-overview .dash-background { + margin: 0; +} + +#dash.vertical-overview-left .dash-background { + border-radius: 0 18px 18px 0; + border-left: 0px; + padding: 8px 12px 8px 4px; +} + +#dash.vertical-overview-right .dash-background { + border-radius: 18px 0 0 18px; + border-right: 0px; + padding: 8px 4px 8px 12px; +} + +/* default horizontal dash */ +.dash-background { + padding: 6px; + border-radius: 17px; +} + +.app-well-app { + margin-left: 1px; + margin-right: 1px; +} + +.app-well-app-running-dot { + margin-bottom: 6px; + width: 16px; + height: 2px; +} + +/* add shadow to the app grid app label to be readable if it overlaps light icon below */ +.overview-icon-with-label { + text-shadow: 1px 1px 3px rgba(33, 33, 33, 1); +} + +.search-entry { + padding: 3px; + padding-left: 5px; + padding-right: 5px; +} + +/*adjustment for the vertical ws switcher indicator popup*/ +.ws-switcher-indicator { + padding: 3px; + margin: 5px; +} + +.ws-switcher-indicator:active { + padding: 5px; + margin: 3px; +} + +/*ws thumbnails captions*/ +.ws-tmb-label { + padding: 2px; + color: rgb(255, 255, 255); + background-color: rgba(10,10,10,0.8); + text-align: center; +} + +.ws-tmb, .ws-tmb-labeled { + border-radius: 6px; +} + +.ws-tmb-labeled { + border: 0px; +} + +/*app grid page indicatos*/ +.page-indicator-icon { + margin: 10px 10px 10px 10px; +} + +.page-indicator { + padding: 0px; +} + +/* GS 43 App Grid - indicators that show up when dragging icon */ +.prevPageIndicator { + background: rgba(255, 255, 255, 0.1); + background-gradient-start: rgba(255, 255, 255, 0.1); + background-gradient-end: transparent; + background-gradient-direction: vertical; + border-radius: 100px 100px 0px 0px; +} +.nextPageIndicator { + background: rgba(255, 255, 255, 0.1); + background-gradient-start: transparent; + background-gradient-end: rgba(255, 255, 255, 0.1); + background-gradient-direction: vertical; + border-radius: 0px 0px 100px 100px; + +} + +.search-section-content { + background-color: rgba(20, 20, 20, 0.8); + color: white; +} + +.transparent-panel { + background-color: transparent; +} + +/*reduce spacing between app icons in search results*/ +.grid-search-results { + spacing: 2px; +} + +/*.panel { + text-shadow: 1px 1px 3px rgba(33, 33, 33, 1); +}*/ + +/* hide vertical scroll bar, it's distracting in the search results */ +StButton#vhandle { + background-color: transparent; +} + +.show-apps-icon-horizontal-hide { + width: 0; + margin: 0; + spacing: 0; +} + +.show-apps-icon-vertical-hide { + height: 0; + margin: 0; + spacing: 0; +} diff --git a/extensions/vertical-workspaces/swipeTracker.js b/extensions/vertical-workspaces/swipeTracker.js new file mode 100644 index 0000000..d5c52da --- /dev/null +++ b/extensions/vertical-workspaces/swipeTracker.js @@ -0,0 +1,79 @@ +/** + * Vertical Workspaces + * swipeTracker.js + * + * @author GdH + * @copyright 2022 - 2023 + * @license GPL-3.0 + * + */ + +'use strict'; + +const { Clutter, GObject } = imports.gi; +const Main = imports.ui.main; +const SwipeTracker = imports.ui.swipeTracker; + +const Me = imports.misc.extensionUtils.getCurrentExtension(); +let opt; + +let _vwGestureUpdateId; +let _originalGestureUpdateId; + +function update(reset = false) { + opt = Me.imports.settings.opt; + + if (reset || !opt.ORIENTATION) { // 1-VERTICAL, 0-HORIZONTAL + // original swipeTrackers' orientation and updateGesture function + Main.overview._swipeTracker.orientation = Clutter.Orientation.VERTICAL; + Main.wm._workspaceAnimation._swipeTracker.orientation = Clutter.Orientation.HORIZONTAL; + Main.overview._swipeTracker._updateGesture = SwipeTracker.SwipeTracker.prototype._updateGesture; + if (_vwGestureUpdateId) { + Main.overview._swipeTracker._touchpadGesture.disconnect(_vwGestureUpdateId); + _vwGestureUpdateId = 0; + } + if (_originalGestureUpdateId) { + Main.overview._swipeTracker._touchpadGesture.unblock_signal_handler(_originalGestureUpdateId); + _originalGestureUpdateId = 0; + } + + opt = null; + return; + } + + if (opt.ORIENTATION) { // 1-VERTICAL, 0-HORIZONTAL + // reverse swipe gestures for enter/leave overview and ws switching + Main.overview._swipeTracker.orientation = Clutter.Orientation.HORIZONTAL; + Main.wm._workspaceAnimation._swipeTracker.orientation = Clutter.Orientation.VERTICAL; + // overview's updateGesture() function should reflect ws tmb position to match appGrid/ws animation direction + // function in connection cannot be overridden in prototype of its class because connected is actually another copy of the original function + if (!_originalGestureUpdateId) { + _originalGestureUpdateId = GObject.signal_handler_find(Main.overview._swipeTracker._touchpadGesture, { signalId: 'update' }); + Main.overview._swipeTracker._touchpadGesture.block_signal_handler(_originalGestureUpdateId); + Main.overview._swipeTracker._updateGesture = SwipeTrackerVertical._updateGesture; + _vwGestureUpdateId = Main.overview._swipeTracker._touchpadGesture.connect('update', SwipeTrackerVertical._updateGesture.bind(Main.overview._swipeTracker)); + } + } +} + +//---- SwipeTracker ----------------------------------------------------------------------------------- +// switch overview's state gesture direction +var SwipeTrackerVertical = { + _updateGesture: function(gesture, time, delta, distance) { + if (this._state !== 1) //State.SCROLLING) + return; + + if ((this._allowedModes & Main.actionMode) === 0 || !this.enabled) { + this._interrupt(); + return; + } + + if (opt.WS_TMB_RIGHT) + delta = -delta; + this._progress += delta / distance; + this._history.append(time, delta); + + this._progress = Math.clamp(this._progress, ...this._getBounds(this._initialProgress)); + this.emit('update', this._progress); + } +} diff --git a/extensions/vertical-workspaces/util.js b/extensions/vertical-workspaces/util.js new file mode 100644 index 0000000..e0a625b --- /dev/null +++ b/extensions/vertical-workspaces/util.js @@ -0,0 +1,270 @@ +/** + * Vertical Workspaces + * util.js + * + * @author GdH + * @copyright 2022 - 2023 + * @license GPL-3.0 + * + */ + +'use strict'; + +const Gi = imports._gi; +const { Shell, Meta } = imports.gi; + +const Config = imports.misc.config; +const Main = imports.ui.main; + +const ExtensionUtils = imports.misc.extensionUtils; +const Me = ExtensionUtils.getCurrentExtension(); + +var shellVersion = parseFloat(Config.PACKAGE_VERSION); + +var Overrides = class { + constructor() { + this._overrides = {}; + this._injections = {}; + } + + addOverride(name, prototype, overrideList) { + this._overrides[name] = { + originals: this.overrideProto(prototype, overrideList), + prototype, + }; + } + + removeOverride(name) { + const override = this._overrides[name]; + if (!override) + return false; + + this.overrideProto(override.prototype, override.originals); + this._overrides[name] = undefined; + return true; + } + + /* + className.prototype + .injections.funcName1 + .funcName2 + */ + addInjection(className, prototype, injections) { + if (!this._injections[className]) + this._injections[className] = { + prototype, + injections: {}, + }; + + for (let name in injections) { + this._injections[className].injections[name] = { + original: this.injectToFunction(prototype, name, injections[name]), + } + } + } + + removeInjection(className, funcName) { + if (this._injections[className]) return false; + const prototype = this._injections[className].prototype; + + const injection = this._injections[className].injections[funcName]; + if (!injection) return false; + + prototype[funcName] = injection.original; + this._injections[funcName] = undefined; + return true; + } + + removeAll() { + for (let name in this._overrides) { + this.removeOverride(name); + this._overrides[name] = undefined; + } + + for (let className in this._injections) { + const injt = this._injections[className]; + const prototype = injt.prototype; + for (let funcName in injt.injections) { + prototype[funcName] = injt.injections[funcName].original; + } + this._injections[className] = undefined; + } + } + + hookVfunc(proto, symbol, func) { + proto[Gi.hook_up_vfunc_symbol](symbol, func); + } + + overrideProto(proto, overrides) { + const backup = {}; + + for (let symbol in overrides) { + if (symbol.startsWith('after_')) { + const actualSymbol = symbol.slice('after_'.length); + const fn = proto[actualSymbol]; + const afterFn = overrides[symbol] + proto[actualSymbol] = function() { + const args = Array.prototype.slice.call(arguments); + const res = fn.apply(this, args); + afterFn.apply(this, args); + return res; + }; + backup[actualSymbol] = fn; + } + else { + backup[symbol] = proto[symbol]; + if (symbol.startsWith('vfunc')) { + if (shellVersion < 42) { + this.hookVfunc(proto, symbol.slice(6), overrides[symbol]); + } else { + this.hookVfunc(proto[Gi.gobject_prototype_symbol], symbol.slice(6), overrides[symbol]); + } + } + else { + proto[symbol] = overrides[symbol]; + } + } + } + return backup; + } + + injectToFunction(parent, name, func) { + let origin = parent[name]; + parent[name] = function() { + let ret; + ret = origin.apply(this, arguments); + func.apply(this, arguments); + return ret; + } + + return origin; + } +} + +//------- Common functions ----------------------------------------------------------------------- + +function getOverviewTranslations(opt, dash, tmbBox, searchEntryBin) { + //const tmbBox = Main.overview._overview._controls._thumbnailsBox; + let searchTranslation_y = 0; + if (searchEntryBin.visible) { + const offset = (dash.visible && (!opt.DASH_VERTICAL ? dash.height + 12 : 0)) + + (opt.WS_TMB_TOP ? tmbBox.height + 12 : 0); + searchTranslation_y = - searchEntryBin.height - offset - 30; + } + + let tmbTranslation_x = 0; + let tmbTranslation_y = 0; + let offset; + if (tmbBox.visible) { + switch (opt.WS_TMB_POSITION) { + case 3: // left + offset = 10 + ((dash?.visible && opt.DASH_LEFT) ? dash.width : 0); + tmbTranslation_x = - tmbBox.width - offset; + tmbTranslation_y = 0; + break; + case 1: // right + offset = 10 + ((dash?.visible && opt.DASH_RIGHT) ? dash.width : 0); + tmbTranslation_x = tmbBox.width + offset; + tmbTranslation_y = 0; + break; + case 0: // top + offset = 10 + ((dash?.visible && opt.DASH_TOP) ? dash.height : 0) + Main.panel.height; + tmbTranslation_x = 0; + tmbTranslation_y = - tmbBox.height - offset; + break; + case 2: // bottom + offset = 10 + ((dash?.visible && opt.DASH_BOTTOM) ? dash.height : 0) + Main.panel.height; // just for case the panel is at bottom + tmbTranslation_x = 0; + tmbTranslation_y = tmbBox.height + offset; + break; + } + } + + let dashTranslation_x = 0; + let dashTranslation_y = 0; + let position = opt.DASH_POSITION; + // if DtD replaced the original Dash, read its position + if (dashIsDashToDock()) { + position = dash._position; + } + if (dash?.visible) { + switch (position) { + case 0: // top + dashTranslation_x = 0; + dashTranslation_y = - dash.height - dash.margin_bottom - Main.panel.height; + break; + case 1: // right + dashTranslation_x = dash.width; + dashTranslation_y = 0; + break; + case 2: // bottom + dashTranslation_x = 0; + dashTranslation_y = dash.height + dash.margin_bottom + Main.panel.height; + break; + case 3: // left + dashTranslation_x = - dash.width; + dashTranslation_y = 0; + break; + } + } + + return [tmbTranslation_x, tmbTranslation_y, dashTranslation_x, dashTranslation_y, searchTranslation_y]; +} + +function openPreferences() { + const windows = global.display.get_tab_list(Meta.TabList.NORMAL_ALL, null); + let tracker = Shell.WindowTracker.get_default(); + let metaWin, isVW = null; + + for (let win of windows) { + const app = tracker.get_window_app(win); + if (win.get_title().includes(Me.metadata.name) && app.get_name() === 'Extensions') { + // this is our existing window + metaWin = win; + isVW = true; + break; + } else if (win.wm_class.includes('org.gnome.Shell.Extensions')) { + // this is prefs window of another extension + metaWin = win; + isVW = false; + } + } + + if (metaWin && !isVW) { + // other prefs window blocks opening another prefs window, so close it + metaWin.delete(global.get_current_time()); + } else if (metaWin && isVW) { + // if prefs window already exist, move it to the current WS and activate it + metaWin.change_workspace(global.workspace_manager.get_active_workspace()); + metaWin.activate(global.get_current_time()); + } + + if (!metaWin || (metaWin && !isVW)) { + try { + Main.extensionManager.openExtensionPrefs(Me.metadata.uuid, '', {}); + } catch (e) { + log(e); + } + } +} + +function activateSearchProvider(prefix = '') { + const searchEntry = Main.overview.searchEntry; + if (!searchEntry.get_text() || !searchEntry.get_text().startsWith(prefix)) { + prefix = _(prefix + ' '); + const position = prefix.length; + searchEntry.set_text(prefix); + searchEntry.get_first_child().set_cursor_position(position); + searchEntry.get_first_child().set_selection(position, position); + } else { + searchEntry.set_text(''); + } +} + +function dashNotDefault() { + return Main.overview.dash !== Main.overview._overview._controls.layoutManager._dash; +} + +function dashIsDashToDock() { + return Main.overview.dash._isHorizontal !== undefined; +} diff --git a/extensions/vertical-workspaces/windowManager.js b/extensions/vertical-workspaces/windowManager.js new file mode 100644 index 0000000..e931a67 --- /dev/null +++ b/extensions/vertical-workspaces/windowManager.js @@ -0,0 +1,208 @@ +/** + * Vertical Workspaces + * windowManager.js + * + * @author GdH + * @copyright 2022 - 2023 + * @license GPL-3.0 + * + */ + +'use strict'; + +const { GObject, Clutter, Meta, Shell } = imports.gi; + +const Main = imports.ui.main; +const WindowManager = imports.ui.windowManager; +const Me = imports.misc.extensionUtils.getCurrentExtension(); +const _Util = Me.imports.util; +let _overrides; + +const MINIMIZE_WINDOW_ANIMATION_TIME = WindowManager.MINIMIZE_WINDOW_ANIMATION_TIME; +const MINIMIZE_WINDOW_ANIMATION_MODE = WindowManager.MINIMIZE_WINDOW_ANIMATION_MODE; + +let opt; + +function update(reset = false) { + if (_overrides) { + _overrides.removeAll(); + } + + _replaceMinimizeFunction(reset); + + if (reset) { + _overrides = null; + opt = null; + return; + } + + opt = Me.imports.settings.opt; + + _overrides = new _Util.Overrides(); + + _overrides.addOverride('WindowManager', WindowManager.WindowManager.prototype, WindowManagerCommon); +} + +//------------- Fix and adapt minimize/unminimize animations -------------------------------------- + +let _originalMinimizeSigId; +let _minimizeSigId; +let _originalUnminimizeSigId; +let _unminimizeSigId; + +function _replaceMinimizeFunction(reset = false) { + if (reset) { + Main.wm._shellwm.disconnect(_minimizeSigId); + _minimizeSigId = 0; + Main.wm._shellwm.unblock_signal_handler(_originalMinimizeSigId); + _originalMinimizeSigId = 0; + + Main.wm._shellwm.disconnect(_unminimizeSigId); + _unminimizeSigId = 0; + Main.wm._shellwm.unblock_signal_handler(_originalUnminimizeSigId); + _originalUnminimizeSigId = 0; + + } else if (!_minimizeSigId) { + _originalMinimizeSigId = GObject.signal_handler_find(Main.wm._shellwm, { signalId: 'minimize' }); + if (_originalMinimizeSigId) { + Main.wm._shellwm.block_signal_handler(_originalMinimizeSigId); + _minimizeSigId = Main.wm._shellwm.connect('minimize', WindowManagerCommon._minimizeWindow.bind(Main.wm)); + } + + _originalUnminimizeSigId = GObject.signal_handler_find(Main.wm._shellwm, { signalId: 'unminimize' }); + if (_originalUnminimizeSigId) { + Main.wm._shellwm.block_signal_handler(_originalUnminimizeSigId); + _unminimizeSigId = Main.wm._shellwm.connect('unminimize', WindowManagerCommon._unminimizeWindow.bind(Main.wm)); + } + } +} + +// fix for mainstream bug - fullscreen windows should minimize using opacity transition +// but its being applied directly on window actor and that doesn't work +// anyway, animation is better, even if the Activities button is not visible... +// and also add support for bottom position of the panel +const WindowManagerCommon = { + _minimizeWindow: function(shellwm, actor) { + const types = [ + Meta.WindowType.NORMAL, + Meta.WindowType.MODAL_DIALOG, + Meta.WindowType.DIALOG, + ]; + if (!this._shouldAnimateActor(actor, types)) { + shellwm.completed_minimize(actor); + return; + } + + actor.set_scale(1.0, 1.0); + + this._minimizing.add(actor); + + if (false/*actor.meta_window.is_monitor_sized()*/) { + actor.get_first_child().ease({ + opacity: 0, + duration: MINIMIZE_WINDOW_ANIMATION_TIME, + mode: MINIMIZE_WINDOW_ANIMATION_MODE, + onStopped: () => this._minimizeWindowDone(shellwm, actor), + }); + } else { + let xDest, yDest, xScale, yScale; + let [success, geom] = actor.meta_window.get_icon_geometry(); + if (success) { + xDest = geom.x; + yDest = geom.y; + xScale = geom.width / actor.width; + yScale = geom.height / actor.height; + } else { + let monitor = Main.layoutManager.monitors[actor.meta_window.get_monitor()]; + if (!monitor) { + this._minimizeWindowDone(); + return; + } + xDest = monitor.x; + yDest = opt.PANEL_POSITION_TOP ? monitor.y : monitor.y + monitor.height; + if (Clutter.get_default_text_direction() == Clutter.TextDirection.RTL) + xDest += monitor.width; + xScale = 0; + yScale = 0; + } + + actor.ease({ + scale_x: xScale, + scale_y: yScale, + x: xDest, + y: yDest, + duration: MINIMIZE_WINDOW_ANIMATION_TIME, + mode: MINIMIZE_WINDOW_ANIMATION_MODE, + onStopped: () => this._minimizeWindowDone(shellwm, actor), + }); + } + }, + + _minimizeWindowDone: function(shellwm, actor) { + if (this._minimizing.delete(actor)) { + actor.remove_all_transitions(); + actor.set_scale(1.0, 1.0); + actor.get_first_child().set_opacity(255); + actor.set_pivot_point(0, 0); + + shellwm.completed_minimize(actor); + } + }, + + _unminimizeWindow: function(shellwm, actor) { + const types = [ + Meta.WindowType.NORMAL, + Meta.WindowType.MODAL_DIALOG, + Meta.WindowType.DIALOG, + ]; + if (!this._shouldAnimateActor(actor, types)) { + shellwm.completed_unminimize(actor); + return; + } + + this._unminimizing.add(actor); + + if (false/*actor.meta_window.is_monitor_sized()*/) { + actor.opacity = 0; + actor.set_scale(1.0, 1.0); + actor.ease({ + opacity: 255, + duration: MINIMIZE_WINDOW_ANIMATION_TIME, + mode: MINIMIZE_WINDOW_ANIMATION_MODE, + onStopped: () => this._unminimizeWindowDone(shellwm, actor), + }); + } else { + let [success, geom] = actor.meta_window.get_icon_geometry(); + if (success) { + actor.set_position(geom.x, geom.y); + actor.set_scale(geom.width / actor.width, + geom.height / actor.height); + } else { + let monitor = Main.layoutManager.monitors[actor.meta_window.get_monitor()]; + if (!monitor) { + actor.show(); + this._unminimizeWindowDone(); + return; + } + actor.set_position(monitor.x, opt.PANEL_POSITION_TOP ? monitor.y : monitor.y + monitor.height); + if (Clutter.get_default_text_direction() == Clutter.TextDirection.RTL) + actor.x += monitor.width; + actor.set_scale(0, 0); + } + + let rect = actor.meta_window.get_buffer_rect(); + let [xDest, yDest] = [rect.x, rect.y]; + + actor.show(); + actor.ease({ + scale_x: 1, + scale_y: 1, + x: xDest, + y: yDest, + duration: MINIMIZE_WINDOW_ANIMATION_TIME, + mode: MINIMIZE_WINDOW_ANIMATION_MODE, + onStopped: () => this._unminimizeWindowDone(shellwm, actor), + }); + } + } +} diff --git a/extensions/vertical-workspaces/windowPreview.js b/extensions/vertical-workspaces/windowPreview.js new file mode 100644 index 0000000..013f48c --- /dev/null +++ b/extensions/vertical-workspaces/windowPreview.js @@ -0,0 +1,335 @@ +/** + * Vertical Workspaces + * windowPreview.js + * + * @author GdH + * @copyright 2022 - 2023 + * @license GPL-3.0 + * + */ + +'use strict'; + +const { Clutter, GLib, Graphene, Meta, Shell, St } = imports.gi; + +const Main = imports.ui.main; +const WindowPreview = imports.ui.windowPreview; + +const ExtensionUtils = imports.misc.extensionUtils; +const Me = ExtensionUtils.getCurrentExtension(); + +const _Util = Me.imports.util; +let _overrides; + +const WINDOW_SCALE_TIME = imports.ui.windowPreview.WINDOW_SCALE_TIME; +const WINDOW_ACTIVE_SIZE_INC = imports.ui.windowPreview.WINDOW_ACTIVE_SIZE_INC; +const WINDOW_OVERLAY_FADE_TIME = imports.ui.windowPreview.WINDOW_OVERLAY_FADE_TIME; +const SEARCH_WINDOWS_PREFIX = Me.imports.windowSearchProvider.prefix; + +const ControlsState = imports.ui.overviewControls.ControlsState; + +var opt = null; + +function update(reset = false) { + if (_overrides) { + _overrides.removeAll(); + } + + if (reset) { + _overrides = null; + opt = null; + return; + } + + opt = Me.imports.settings.opt; + _overrides = new _Util.Overrides(); + + _overrides.addOverride('WindowPreview', WindowPreview.WindowPreview.prototype, WindowPreviewCommon); + // move titles into window previews + _overrides.addInjection('WindowPreview', WindowPreview.WindowPreview.prototype, WindowPreviewInjections); +} + +//----- WindowPreview ------------------------------------------------------------------ +var WindowPreviewInjections = { + _init: function() { + const ICON_OVERLAP = 0.7; + + if (opt.WIN_PREVIEW_ICON_SIZE < 64) { + this.remove_child(this._icon); + this._icon.destroy(); + const tracker = Shell.WindowTracker.get_default(); + const app = tracker.get_window_app(this.metaWindow); + this._icon = app.create_icon_texture(opt.WIN_PREVIEW_ICON_SIZE); + this._icon.add_style_class_name('icon-dropshadow'); + this._icon.set({ + reactive: true, + pivot_point: new Graphene.Point({ x: 0.5, y: 0.5 }), + }); + this._icon.add_constraint(new Clutter.BindConstraint({ + source: this.windowContainer, + coordinate: Clutter.BindCoordinate.POSITION, + })); + this._icon.add_constraint(new Clutter.AlignConstraint({ + source: this.windowContainer, + align_axis: Clutter.AlignAxis.X_AXIS, + factor: 0.5, + })); + this._icon.add_constraint(new Clutter.AlignConstraint({ + source: this.windowContainer, + align_axis: Clutter.AlignAxis.Y_AXIS, + pivot_point: new Graphene.Point({ x: -1, y: ICON_OVERLAP }), + factor: 1, + })); + this.add_child(this._icon); + if (opt.WIN_PREVIEW_ICON_SIZE < 22) { + // disable app icon + this._icon.hide(); + } + this._iconSize = opt.WIN_PREVIEW_ICON_SIZE; + } + + const { scaleFactor } = St.ThemeContext.get_for_stage(global.stage); + const iconOverlap = opt.WIN_PREVIEW_ICON_SIZE * ICON_OVERLAP; + // we cannot get proper title height before it gets to the stage, so 35 is estimated height + spacing + this._title.get_constraints()[1].offset = scaleFactor * (- iconOverlap - 35); + this.set_child_above_sibling(this._title, null); + // if window is created while the overview is shown, icon and title should be visible immediately + if (Main.overview._overview._controls._stateAdjustment.value < 1) { + this._icon.scale_x = 0; + this._icon.scale_y = 0; + this._title.opacity = 0; + } + + if (opt.ALWAYS_SHOW_WIN_TITLES) { + this._title.show(); + this._stateConId = this._workspace._background._stateAdjustment.connect('notify::value', (adj) => { + this._title.opacity = Math.floor(adj.value) * 255; + }); + + } + + if (opt.OVERVIEW_MODE === 1) { + // spread windows on hover + this._wsStateConId = this.connect('enter-event', () => { + // don't spread windows if user don't use pointer device at this moment + if (global.get_pointer()[0] === opt.showingPointerX) + return; + + const adjustment = this._workspace._background._stateAdjustment; + if (!adjustment.value && !Main.overview._animationInProgress) { + opt.WORKSPACE_MODE = 1; + if (adjustment.value === 0) { + adjustment.value = 0; + adjustment.ease(1, { + duration: 200, + mode: Clutter.AnimationMode.EASE_OUT_QUAD + }); + } + } + }); + } + if (opt.OVERVIEW_MODE) { + // show window icon and title on ws windows spread + this._stateAdjustmentSigId = this._workspace.stateAdjustment.connect('notify::value', this._updateIconScale.bind(this)); + } + + // replace click action with custom one + const action = this.get_actions()[0]; + this.remove_action(action); + + const clickAction = new Clutter.ClickAction(); + clickAction.connect('clicked', (action) => { + const button = action.get_button(); + if (button === Clutter.BUTTON_PRIMARY) { + this._activate(); + } else if (button === Clutter.BUTTON_SECONDARY) { + // this action cancels long-press event and the 'long-press-cancel' event is used by the Shell to actually initiate DnD + // so the dnd initiation needs to be removed + if (this._longPressLater) { + Meta.later_remove(this._longPressLater); + delete this._longPressLater; + } + const tracker = Shell.WindowTracker.get_default(); + const appName = tracker.get_window_app(this.metaWindow).get_name(); + _Util.activateSearchProvider(`${SEARCH_WINDOWS_PREFIX} ${appName}`); + return Clutter.EVENT_STOP; + } + }); + + clickAction.connect('long-press', this._onLongPress.bind(this)); + this.add_action(clickAction); + + this.connect('destroy', () => this._workspace.stateAdjustment.disconnect(this._stateConId)); + } +} + +// WindowPreview +var WindowPreviewCommon = { + _updateIconScale: function() { + let { currentState, initialState, finalState } = + this._overviewAdjustment.getStateTransitionParams(); + + // Current state - 0 - HIDDEN, 1 - WINDOW_PICKER, 2 - APP_GRID + const primaryMonitor = this.metaWindow.get_monitor() === global.display.get_primary_monitor(); + + const visible = + (initialState > ControlsState.HIDDEN || finalState > ControlsState.HIDDEN) + && !(finalState === ControlsState.APP_GRID && primaryMonitor); + + let scale = visible + ? (currentState >= 1 ? 1 : currentState % 1) : 0; + if (!primaryMonitor && + ((initialState === ControlsState.WINDOW_PICKER && finalState === ControlsState.APP_GRID) || + (initialState === ControlsState.APP_GRID && finalState === ControlsState.WINDOW_PICKER)) + ) { + scale = 1; + /*} else if (primaryMonitor && ((initialState === ControlsState.WINDOW_PICKER && finalState === ControlsState.APP_GRID) || + initialState === ControlsState.APP_GRID && finalState === ControlsState.HIDDEN)) {*/ + } else if (primaryMonitor && currentState > ControlsState.WINDOW_PICKER) { + scale = 0; + } + + // in static workspace mode show icon and title on ws windows spread + if (opt.OVERVIEW_MODE) { + const windowsSpread = this._workspace.stateAdjustment.value; + if (currentState === 1) { + scale = windowsSpread; + } else if (finalState === 1 || (finalState === 0 && !windowsSpread)) { + return; + } + } + + this._icon.set({ + scale_x: scale, + scale_y: scale, + }); + + // if titles are in 'always show' mode, we need to add transition between visible/invisible state + // but the transition is quite expensive, + // showing the titles at the end of the transition is good enough and workspace preview transition is much smoother + this._title.set({ + opacity: Math.floor(scale) * 255, + }); + }, + + showOverlay: function(animate) { + if (!this._overlayEnabled) + return; + + if (this._overlayShown) + return; + + this._overlayShown = true; + //this._restack(); + + // If we're supposed to animate and an animation in our direction + // is already happening, let that one continue + const ongoingTransition = this._title.get_transition('opacity'); + if (animate && + ongoingTransition && + ongoingTransition.get_interval().peek_final_value() === 255) + return; + + const toShow = this._windowCanClose() + ? [this._closeButton] + : []; + + if (!opt.ALWAYS_SHOW_WIN_TITLES) { + toShow.push(this._title); + } + + toShow.forEach(a => { + a.opacity = 0; + a.show(); + a.ease({ + opacity: 255, + duration: animate ? WINDOW_OVERLAY_FADE_TIME : 0, + mode: Clutter.AnimationMode.EASE_OUT_QUAD, + }); + }); + + const [width, height] = this.window_container.get_size(); + const { scaleFactor } = St.ThemeContext.get_for_stage(global.stage); + const activeExtraSize = WINDOW_ACTIVE_SIZE_INC * 2 * scaleFactor; + const origSize = Math.max(width, height); + const scale = (origSize + activeExtraSize) / origSize; + + this.window_container.ease({ + scale_x: scale, + scale_y: scale, + duration: animate ? WINDOW_SCALE_TIME : 0, + mode: Clutter.AnimationMode.EASE_OUT_QUAD, + }); + + this.emit('show-chrome'); + }, + + hideOverlay: function(animate) { + if (!this._overlayShown) + return; + this._overlayShown = false; + //this._restack(); + + // If we're supposed to animate and an animation in our direction + // is already happening, let that one continue + const ongoingTransition = this._title.get_transition('opacity'); + if (animate && + ongoingTransition && + ongoingTransition.get_interval().peek_final_value() === 0) + return; + + const toHide = [this._closeButton]; + + if (!opt.ALWAYS_SHOW_WIN_TITLES) { + toHide.push(this._title); + } + toHide.forEach(a => { + a.opacity = 255; + a.ease({ + opacity: 0, + duration: animate ? WINDOW_OVERLAY_FADE_TIME : 0, + mode: Clutter.AnimationMode.EASE_OUT_QUAD, + onComplete: () => a.hide(), + }); + }); + + if (this.window_container) { + this.window_container.ease({ + scale_x: 1, + scale_y: 1, + duration: animate ? WINDOW_SCALE_TIME : 0, + mode: Clutter.AnimationMode.EASE_OUT_QUAD, + }); + } + }, + + _onDestroy() { + // fix for upstream bug - hideOverlay is called after windowPreview is destroyed, from the leave event callback + // but it still throws: + // clutter_actor_get_preferred_width: assertion 'CLUTTER_IS_ACTOR (self)' failed + // clutter_actor_get_preferred_height: assertion 'CLUTTER_IS_ACTOR (self)' failed + this.hideOverlay(false); + + this.metaWindow._delegate = null; + this._delegate = null; + + if (this._longPressLater) { + Meta.later_remove(this._longPressLater); + delete this._longPressLater; + } + + if (this._idleHideOverlayId > 0) { + GLib.source_remove(this._idleHideOverlayId); + this._idleHideOverlayId = 0; + } + + if (this.inDrag) { + this.emit('drag-end'); + this.inDrag = false; + } + + if (this._stateAdjustmentSigId) { + this._workspace.stateAdjustment.disconnect(this._stateAdjustmentSigId); + } + } +} diff --git a/extensions/vertical-workspaces/windowSearchProvider.js b/extensions/vertical-workspaces/windowSearchProvider.js new file mode 100644 index 0000000..3256742 --- /dev/null +++ b/extensions/vertical-workspaces/windowSearchProvider.js @@ -0,0 +1,358 @@ +/** + * Vertical Workspaces + * windowSearchProvider.js + * + * @author GdH + * @copyright 2022 -2023 + * @license GPL-3.0 + */ + +'use strict'; + +const { GLib, GObject, Gio, Gtk, Meta, St, Shell } = imports.gi; + +const Main = imports.ui.main; +const ExtensionUtils = imports.misc.extensionUtils; +const Me = ExtensionUtils.getCurrentExtension(); +const Settings = Me.imports.settings; +const _ = Me.imports.settings._; + +const shellVersion = Settings.shellVersion; + +const ModifierType = imports.gi.Clutter.ModifierType; + +let windowSearchProvider; +let _enableTimeoutId = 0; + +// prefix helps to eliminate results from other search providers +// so it needs to be something less common +// needs to be accessible from vw module +var prefix = 'wq//'; + +let opt; + +const Action = { + NONE: 0, + CLOSE: 1, + CLOSE_ALL: 2, + MOVE_TO_WS: 3, + MOVE_ALL_TO_WS: 4 +} + +function init() { +} + +function getOverviewSearchResult() { + return Main.overview._overview.controls._searchController._searchResults; +} + +function update(reset = false) { + opt = Me.imports.settings.opt; + if (!reset && opt.WINDOW_SEARCH_PROVIDER_ENABLED && !windowSearchProvider) { + enable(); + } else if (reset || !opt.WINDOW_SEARCH_PROVIDER_ENABLED) { + disable(); + opt = null; + } +} + +function enable() { + // delay because Fedora had problem to register a new provider soon after Shell restarts + _enableTimeoutId = GLib.timeout_add( + GLib.PRIORITY_DEFAULT, + 2000, + () => { + if (windowSearchProvider == null) { + windowSearchProvider = new WindowSearchProvider(opt); + getOverviewSearchResult()._registerProvider( + windowSearchProvider + ); + } + _enableTimeoutId = 0; + return GLib.SOURCE_REMOVE; + } + ); +} + +function disable() { + if (windowSearchProvider) { + getOverviewSearchResult()._unregisterProvider( + windowSearchProvider + ); + windowSearchProvider = null; + } + if (_enableTimeoutId) { + GLib.source_remove(_enableTimeoutId); + _enableTimeoutId = 0; + } +} + +function fuzzyMatch(term, text) { + let pos = -1; + const matches = []; + // convert all accented chars to their basic form and to lower case + const _text = text;//.normalize('NFD').replace(/[\u0300-\u036f]/g, '').toLowerCase(); + const _term = term.normalize('NFD').replace(/[\u0300-\u036f]/g, '').toLowerCase(); + + // if term matches the substring exactly, gains the highest weight + if (_text.includes(_term)) { + return 0; + } + + for (let i = 0; i < _term.length; i++) { + let c = _term[i]; + let p; + if (pos > 0) + p = _term[i - 1]; + while (true) { + pos += 1; + if (pos >= _text.length) { + return -1; + } + if (_text[pos] == c) { + matches.push(pos); + break; + } else if (_text[pos] == p) { + matches.pop(); + matches.push(pos); + } + } + } + + // add all position to get a weight of the result + // results closer to the beginning of the text and term characters closer to each other will gain more weight. + return matches.reduce((r, p) => r + p) - matches.length * matches[0] + matches[0]; +} + +function strictMatch(term, text) { + // remove diacritics and accents from letters + let s = text.normalize('NFD').replace(/[\u0300-\u036f]/g, '').toLowerCase(); + let p = term.toLowerCase(); + let ps = p.split(/ +/); + + // allows to use multiple exact patterns separated by a space in arbitrary order + for (let w of ps) { // escape regex control chars + if (!s.match(w.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'))) { + return -1; + } + } + return 0; +} + +function makeResult(window, i) { + const app = Shell.WindowTracker.get_default().get_window_app(window); + const appName = app ? app.get_name() : 'Unknown'; + const windowTitle = window.get_title(); + const wsIndex = window.get_workspace().index(); + + return { + 'id': i, + // convert all accented chars to their basic form and lower case for search + 'name': `${wsIndex + 1}: ${windowTitle} ${appName}`.normalize('NFD').replace(/[\u0300-\u036f]/g, '').toLowerCase(), + 'appName': appName, + 'windowTitle': windowTitle, + 'window': window + } +} + +const closeSelectedRegex = /^\/x!$/; +const closeAllResultsRegex = /^\/xa!$/; +const moveToWsRegex = /^\/m[0-9]+$/; +const moveAllToWsRegex = /^\/ma[0-9]+$/; + +var WindowSearchProvider = class WindowSearchProvider { + constructor(gOptions) { + this._gOptions = gOptions; + this.appInfo = Gio.AppInfo.create_from_commandline('true', 'Open Windows', null); + this.appInfo.get_description = () => 'List of open windows'; + this.appInfo.get_name = () => 'Open Windows'; + this.appInfo.get_id = () => `${Me.metadata.uuid} ${this.title}`; + this.appInfo.get_icon = () => Gio.icon_new_for_string('focus-windows-symbolic'); + this.appInfo.should_show = () => true; + this.title = 'Window Search Provider', + this.canLaunchSearch = true; + this.isRemoteProvider = false; + + this.action = 0; + } + + _getResultSet (terms) { + // do not modify original terms + let termsCopy = [...terms]; + // search for terms without prefix + termsCopy[0] = termsCopy[0].replace(prefix, ''); + + /*if (gOptions.get('searchWindowsCommands')) { + this.action = 0; + this.targetWs = 0; + + const lastTerm = terms[terms.length - 1]; + if (lastTerm.match(closeSelectedRegex)) { + this.action = Action.CLOSE; + } else if (lastTerm.match(closeAllResultsRegex)) { + this.action = Action.CLOSE_ALL; + } else if (lastTerm.match(moveToWsRegex)) { + this.action = Action.MOVE_TO_WS; + } else if (lastTerm.match(moveAllToWsRegex)) { + this.action = Action.MOVE_ALL_TO_WS; + } + if (this.action) { + terms.pop(); + if (this.action === Action.MOVE_TO_WS || this.action === Action.MOVE_ALL_TO_WS) { + this.targetWs = parseInt(lastTerm.replace(/^[^0-9]+/, '')) - 1; + } + } else if (lastTerm.startsWith('/')) { + terms.pop(); + } + }*/ + + const candidates = this.windows; + const _terms = [].concat(termsCopy); + let match; + + const term = _terms.join(' '); + match = (s) => { + return fuzzyMatch(term, s); + } + + const results = []; + let m; + for (let key in candidates) { + if (this._gOptions.get('searchFuzzy')) { + m = fuzzyMatch(term, candidates[key].name); + } else { + m = strictMatch(term, candidates[key].name); + } + if (m !== -1) { + results.push({ weight: m, id: key }); + } + } + + results.sort((a, b) => a.weight > b.weight); + const currentWs = global.workspace_manager.get_active_workspace_index(); + // prefer current workspace + results.sort((a, b) => (this.windows[a.id].window.get_workspace().index() !== currentWs) && (this.windows[b.id].window.get_workspace().index() === currentWs)); + results.sort((a, b) => ((_terms != ' ') && (a.weight > 0 && b.weight === 0))); + + this.resultIds = results.map((item) => item.id); + return this.resultIds; + } + + getResultMetas (resultIds, callback = null) { + const metas = resultIds.map((id) => this.getResultMeta(id)); + if (shellVersion >= 43) { + return new Promise(resolve => resolve(metas)); + } else { + callback(metas); + } + } + + getResultMeta (resultId) { + const result = this.windows[resultId]; + const wsIndex = result.window.get_workspace().index(); + const app = Shell.WindowTracker.get_default().get_window_app(result.window); + return { + 'id': resultId, + 'name': `${wsIndex + 1}: ${result.windowTitle}`, + 'description': result.appName, + 'createIcon': (size) => { + return app + ? app.create_icon_texture(size) + : new St.Icon({ icon_name: 'icon-missing', icon_size: size }); + } + } + } + + launchSearch(terms, timeStamp) { + } + + activateResult (resultId, terms, timeStamp) { + const [,,state] = global.get_pointer(); + + const isCtrlPressed = (state & ModifierType.CONTROL_MASK) != 0; + const isShiftPressed = (state & ModifierType.SHIFT_MASK) != 0; + + this.action = 0; + this.targetWs = 0; + + this.targetWs = global.workspaceManager.get_active_workspace().index() + 1; + if (isShiftPressed && !isCtrlPressed) { + this.action = Action.MOVE_TO_WS; + } else if (isShiftPressed && isCtrlPressed) { + this.action = Action.MOVE_ALL_TO_WS; + } + + if (!this.action) { + const result = this.windows[resultId]; + Main.activateWindow(result.window); + return; + } + + switch (this.action) { + case Action.CLOSE: + this._closeWindows([resultId]); + break; + case Action.CLOSE_ALL: + this._closeWindows(this.resultIds); + break; + case Action.MOVE_TO_WS: + this._moveWindowsToWs(resultId, [resultId]); + break; + case Action.MOVE_ALL_TO_WS: + this._moveWindowsToWs(resultId, this.resultIds); + break; + } + } + + _closeWindows(ids) { + let time = global.get_current_time(); + for (let i = 0; i < ids.length; i++) { + this.windows[ids[i]].window.delete(time + i); + } + Main.notify('Window Search Provider', `Closed ${ids.length} windows.`); + } + + _moveWindowsToWs(selectedId, resultIds) { + const workspace = global.workspaceManager.get_active_workspace(); + + for (let i = 0; i < resultIds.length; i++) { + this.windows[resultIds[i]].window.change_workspace(workspace); + } + const selectedWin = this.windows[selectedId].window; + selectedWin.activate_with_workspace(global.get_current_time(), workspace); + } + + getInitialResultSet (terms, callback, cancellable = null) { + if (shellVersion >=43) { + cancellable = callback; + } + let windows; + this.windows = windows = {}; + global.display.get_tab_list(Meta.TabList.NORMAL, null).filter(w => w.get_workspace() !== null).map( + (v, i) => windows[`${i}-${v.get_id()}`] = makeResult(v, `${i}-${v.get_id()}`) + ); + + + + if (shellVersion >= 43) { + return new Promise(resolve => resolve(this._getResultSet(terms))); + } else { + callback(this._getResultSet(terms)); + } + } + + filterResults (results, maxResults) { + //return results.slice(0, maxResults); + return results; + } + + getSubsearchResultSet (previousResults, terms, callback, cancellable) { + // if we return previous results, quick typers get non-actual results + callback(this._getResultSet(terms)); + } + + createResultOjbect(resultMeta) { + const app = Shell.WindowTracker.get_default().get_window_app(resultMeta.id); + return new AppIcon(app); + } +} diff --git a/extensions/vertical-workspaces/workspace.js b/extensions/vertical-workspaces/workspace.js new file mode 100644 index 0000000..84ca696 --- /dev/null +++ b/extensions/vertical-workspaces/workspace.js @@ -0,0 +1,146 @@ +/** + * Vertical Workspaces + * workspace.js + * + * @author GdH + * @copyright 2022 - 2023 + * @license GPL-3.0 + * + */ + +'use strict'; + +const { Clutter, St, Graphene } = imports.gi; + +const Main = imports.ui.main; +const Util = imports.misc.util; +const Workspace = imports.ui.workspace; + +const ExtensionUtils = imports.misc.extensionUtils; +const Me = ExtensionUtils.getCurrentExtension(); + +const _Util = Me.imports.util; +let _overrides; + +let opt; + +const BACKGROUND_CORNER_RADIUS_PIXELS = 40; + + +function update(reset = false) { + if (_overrides) { + _overrides.removeAll(); + } + + if (reset) { + imports.ui.workspace.WINDOW_PREVIEW_MAXIMUM_SCALE = 0.95; + _overrides = null; + opt = null; + return; + } + + opt = Me.imports.settings.opt; + + _overrides = new _Util.Overrides(); + + _overrides.addOverride('WorkspaceBackground', Workspace.WorkspaceBackground.prototype, WorkspaceBackground); + // fix window scaling in workspace state 0 + _overrides.addInjection('WorkspaceLayout', Workspace.WorkspaceLayout.prototype, WorkspaceLayoutInjections); + + // fix overlay base for Vertical Workspaces + _overrides.addOverride('WorkspaceLayout', Workspace.WorkspaceLayout.prototype, WorkspaceLayout); +} + + +// workaround for upstream bug (that is not that invisible in default shell) +// smaller window cannot be scaled below 0.95 (WINDOW_PREVIEW_MAXIMUM_SCALE) +// when its target scale for spread windows view (workspace state 1) is bigger than the scale needed for ws state 0. +// in workspace state 0 where windows are not spread and window scale should follow workspace scale, +// this window follows proper top left corner position, but doesn't scale with the workspace +// so it looks bad and the window can exceed border of the workspace +// extremely annoying in OVERVIEW_MODE 1 with single smaller window on the workspace, also affects appGrid transition animation +var WorkspaceLayoutInjections = { + _init: function() { + this._stateAdjustment.connect('notify::value', () => { + if (opt.OVERVIEW_MODE !== 1) return; + // scale 0.1 for window state 0 just needs to be smaller then possible scale of any window in spread view + const scale = this._stateAdjustment.value ? 0.95 : 0.1; + if (scale !== Workspace.WINDOW_PREVIEW_MAXIMUM_SCALE || this._stateAdjustment.value === 1) { + // when transition to ws state 1 begins, replace the constant with the original one + // disadvantage - the value changes for all workspaces, so one affects others + // that can be visible in certain situations but not a big deal. + Workspace.WINDOW_PREVIEW_MAXIMUM_SCALE = scale; + // and force recalculation of the target layout, so the transition will be smooth + this._needsLayout = true; + } + }); + } +} + +var WorkspaceLayout = { + // this fixes wrong size and position calculation of window clones while moving overview to the next (+1) workspace if vertical ws orientation is enabled in GS + _adjustSpacingAndPadding: function(rowSpacing, colSpacing, containerBox) { + if (this._sortedWindows.length === 0) + return [rowSpacing, colSpacing, containerBox]; + + // All of the overlays have the same chrome sizes, + // so just pick the first one. + const window = this._sortedWindows[0]; + + const [topOversize, bottomOversize] = window.chromeHeights(); + const [leftOversize, rightOversize] = window.chromeWidths(); + + const oversize = Math.max(topOversize, bottomOversize, leftOversize, rightOversize); + + if (rowSpacing !== null) + rowSpacing += oversize; + if (colSpacing !== null) + colSpacing += oversize; + + if (containerBox) { + const vertical = global.workspaceManager.layout_rows === -1; + + const monitor = Main.layoutManager.monitors[this._monitorIndex]; + + const bottomPoint = new Graphene.Point3D(); + if (vertical) { + bottomPoint.x = containerBox.x2; + } else { + bottomPoint.y = containerBox.y2; + } + + const transformedBottomPoint = + this._container.apply_transform_to_point(bottomPoint); + const bottomFreeSpace = vertical + ? (monitor.x + monitor.height) - transformedBottomPoint.x + : (monitor.y + monitor.height) - transformedBottomPoint.y; + + const [, bottomOverlap] = window.overlapHeights(); + + if ((bottomOverlap + oversize) > bottomFreeSpace && !vertical) { + containerBox.y2 -= (bottomOverlap + oversize) - bottomFreeSpace; + } + } + + return [rowSpacing, colSpacing, containerBox]; + } +} + +var WorkspaceBackground = { + _updateBorderRadius: function(value = false) { + // don't round already rounded corners during exposing windows + if (value === false && opt.OVERVIEW_MODE === 1) { + return; + } + const { scaleFactor } = St.ThemeContext.get_for_stage(global.stage); + const cornerRadius = scaleFactor * BACKGROUND_CORNER_RADIUS_PIXELS; + + const backgroundContent = this._bgManager.backgroundActor.content; + value = (value !==false) + ? value + : this._stateAdjustment.value; + + backgroundContent.rounded_clip_radius = + Util.lerp(0, cornerRadius, value); + } +} diff --git a/extensions/vertical-workspaces/workspaceAnimation.js b/extensions/vertical-workspaces/workspaceAnimation.js new file mode 100644 index 0000000..40f61b8 --- /dev/null +++ b/extensions/vertical-workspaces/workspaceAnimation.js @@ -0,0 +1,179 @@ +/** + * Vertical Workspaces + * workspacesAnimation.js + * + * @author GdH + * @copyright 2022 - 2023 + * @license GPL-3.0 + * + */ + +'use strict'; + +const { St } = imports.gi; + +const Main = imports.ui.main; +const WorkspaceSwitcherPopup = imports.ui.workspaceSwitcherPopup; +const WorkspaceAnimation = imports.ui.workspaceAnimation; +const Me = imports.misc.extensionUtils.getCurrentExtension(); +const _Util = Me.imports.util; + +// touching module properties defined by const/let for the first time returns undefined in GS 42, so we touch it here before we use it +WorkspaceAnimation.MonitorGroup; + +let _origBaseDistance; +let _wsAnimationSwipeBeginId; +let _wsAnimationSwipeEndId; +let _overrides; +let opt; + +function update(reset = false) { + if (_overrides) { + _overrides.removeAll(); + } + + opt = Me.imports.settings.opt; + if (reset || !opt.STATIC_WS_SWITCHER_BG) { + _connectWsAnimationSwipeTracker(true); + _overrideMonitorGroupProperty(true); + _overrides = null; + opt = null; + return; + } + + _overrides = new _Util.Overrides(); + _connectWsAnimationSwipeTracker(); + _overrideMonitorGroupProperty(); + + _overrides.addInjection('WorkspaceAnimationMonitorGroup', WorkspaceAnimation.MonitorGroup.prototype, MonitorGroupInjections); +} + +// remove spacing between workspaces during transition to remove flashing wallpaper between workspaces with maximized windows +function _overrideMonitorGroupProperty(reset = false) { + if (!_origBaseDistance) + _origBaseDistance = Object.getOwnPropertyDescriptor(WorkspaceAnimation.MonitorGroup.prototype,'baseDistance').get; + + let getter; + if (reset) { + if (_origBaseDistance) + getter = { get: _origBaseDistance }; + } else { + getter = { + get: function () { + //const spacing = 100 * St.ThemeContext.get_for_stage(global.stage).scale_factor; + const spacing = 0; + if (global.workspace_manager.layout_rows === -1) + return this._monitor.height + spacing + (opt.PANEL_MODE ? Main.panel.height : 0); // compensation for hidden panel + else + return this._monitor.width + spacing; + } + } + } + + if (getter) + Object.defineProperty(WorkspaceAnimation.MonitorGroup.prototype, "baseDistance", getter); +} + +const MonitorGroupInjections = { + _init: function() { + // we have two options to implement static bg feature + // one is adding background to monitorGroup + // but this one has disadvantage - sticky windows will be always on top of animated windows + // which is bad for conky, for example, that window should be always below + /*this._bgManager = new Background.BackgroundManager({ + container: this, + monitorIndex: this._monitor.index, + controlPosition: false, + });*/ + + // the second option is to make background of the monitorGroup transparent so the real desktop content will stay visible, + // hide windows that should be animated and keep only sticky windows + // we can keep certain sticky windows bellow and also extensions like DING (icons on desktop) will stay visible + this.set_style('background-color: transparent;'); + // stickyGroup holds the Always on Visible Workspace windows to keep them static and above other windows during animation + const stickyGroup = this.get_children()[1]; + stickyGroup._windowRecords.forEach((r, index) => { + const metaWin = r.windowActor.metaWindow; + // conky is sticky but should never get above other windows during ws animation + // so we hide it from the overlay group, we will see the original if not covered by other windows + if (metaWin.wm_class == 'conky') { + r.clone.opacity = 0; + } + }) + this._hiddenWindows = []; + // remove (hide) background wallpaper from the animation, we will see the original one + this._workspaceGroups.forEach(w => w._background.opacity = 0); + // hide (scale to 0) all non-sticky windows, their clones will be animated + global.get_window_actors().forEach(actor => { + const metaWin = actor.metaWindow; + if (metaWin?.get_monitor() === this._monitor.index && !(metaWin?.wm_class == 'conky' && metaWin?.is_on_all_workspaces())) { //* && !w.is_on_all_workspaces()*/) { + // hide original window. we cannot use opacity since it also affects clones. + // scaling them to 0 works well + actor.scale_x = 0; + this._hiddenWindows.push(actor); + } + }); + + // restore all hidden windows at the end of animation + // todo - actors removed during transition need to be removed from the list to avoid access to destroyed actor + this.connect('destroy', () =>{ + this._hiddenWindows.forEach(actor => { + actor.scale_x = 1; + }); + }); + } +} + + +// ------ connect Ws Animation Swipe Tracker -------------- + +function _connectWsAnimationSwipeTracker(reset = false) { + if (reset) { + if (_wsAnimationSwipeBeginId) { + Main.wm._workspaceAnimation._swipeTracker.disconnect(_wsAnimationSwipeBeginId); + _wsAnimationSwipeBeginId = 0; + } + if (_wsAnimationSwipeEndId) { + Main.wm._workspaceAnimation._swipeTracker.disconnect(_wsAnimationSwipeEndId); + _wsAnimationSwipeEndId = 0; + } + } else if (!_wsAnimationSwipeBeginId) { + // display ws switcher popup when gesture begins and connect progress + _wsAnimationSwipeBeginId = Main.wm._workspaceAnimation._swipeTracker.connect('begin', _connectWsAnimationProgress); + // we want to be sure that popup with the final ws index show up when gesture ends + _wsAnimationSwipeEndId = Main.wm._workspaceAnimation._swipeTracker.connect('end', () => _showWsSwitcherPopup(0)); + } +} + +function _connectWsAnimationProgress() { + if (Main.overview.visible) return; + + // progress is being updated only when user finished gesture and the animation continues on "autopilot" + Main.wm._workspaceAnimation._switchData.monitors[0].connect('notify::progress',(actor) => { + const progress = actor.progress % 1; + let direction = 0; + if (!actor._prg) actor._prg = progress; + else if (!progress) return; + else if (progress < actor._prg) direction = -1; + else if (progress > actor._prg) direction = 1; + if (progress < 0.6 && progress > 0.4) + _showWsSwitcherPopup(direction); + }); + + // display popup when gesture begins + _showWsSwitcherPopup(0); +} + +function _showWsSwitcherPopup(direction) { + if (Main.overview.visible) return; + + const wsIndex = global.workspaceManager.get_active_workspace_index() + direction; + if (Main.wm._workspaceSwitcherPopup === null) { + Main.wm._workspaceSwitcherPopup = new WorkspaceSwitcherPopup.WorkspaceSwitcherPopup(); + Main.wm._workspaceSwitcherPopup.connect('destroy', () => { + Main.wm._workspaceSwitcherPopup = null; + }); + } + + Main.wm._workspaceSwitcherPopup.display(wsIndex); +} diff --git a/extensions/vertical-workspaces/workspaceSwitcherPopup.js b/extensions/vertical-workspaces/workspaceSwitcherPopup.js new file mode 100644 index 0000000..5401903 --- /dev/null +++ b/extensions/vertical-workspaces/workspaceSwitcherPopup.js @@ -0,0 +1,55 @@ +/** + * Vertical Workspaces + * workspacesSwitcherPopup.js + * + * @author GdH + * @copyright 2022 - 2023 + * @license GPL-3.0 + * + */ + +'use strict'; + +const Main = imports.ui.main; +const WorkspaceSwitcherPopup = imports.ui.workspaceSwitcherPopup; + +const ExtensionUtils = imports.misc.extensionUtils; +const Me = ExtensionUtils.getCurrentExtension(); + +const _Util = Me.imports.util; +let _overrides; + +let opt; +var _activateSearchProvider; + +function update(reset = false) { + if (_overrides) { + _overrides.removeAll(); + } + + if (reset) { + _overrides = null; + opt = null; + return; + } + + opt = Me.imports.settings.opt; + + _overrides = new _Util.Overrides(); + + if (opt.ORIENTATION) {// 1-VERTICAL, 0-HORIZONTAL + const settings = ExtensionUtils.getSettings('org.gnome.shell'); + const enabled = settings.get_strv('enabled-extensions'); + const allowWsPopupInjection = !(enabled.includes('workspace-switcher-manager@G-dH.github.com') || enabled.includes('WsSwitcherPopupManager@G-dH.github.com-dev')); + if (opt.shellVersion >= 42 && allowWsPopupInjection) + _overrides.addInjection('WorkspaceSwitcherPopup', WorkspaceSwitcherPopup.WorkspaceSwitcherPopup.prototype, WorkspaceSwitcherPopupInjections); + } +} + +const WorkspaceSwitcherPopupInjections = { + _init: function() { + if (this._list) { + this._list.vertical = true; + } + } +} diff --git a/extensions/vertical-workspaces/workspaceThumbnail.js b/extensions/vertical-workspaces/workspaceThumbnail.js new file mode 100644 index 0000000..bbf8900 --- /dev/null +++ b/extensions/vertical-workspaces/workspaceThumbnail.js @@ -0,0 +1,760 @@ +/** + * Vertical Workspaces + * workspaceThumbnail.js + * + * @author GdH + * @copyright 2022 - 2023 + * @license GPL-3.0 + * + */ + +'use strict'; + +const { Clutter, Graphene, Meta, Shell, St } = imports.gi; +const DND = imports.ui.dnd; +const Main = imports.ui.main; +const Background = imports.ui.background; +const WorkspaceThumbnail = imports.ui.workspaceThumbnail; +const ThumbnailState = WorkspaceThumbnail.ThumbnailState; + +const ControlsState = imports.ui.overviewControls.ControlsState; + +const ExtensionUtils = imports.misc.extensionUtils; +const Me = ExtensionUtils.getCurrentExtension(); + +const _Util = Me.imports.util; +let _overrides; + +const WORKSPACE_CUT_SIZE = 10; +const original_MAX_THUMBNAIL_SCALE = WorkspaceThumbnail.MAX_THUMBNAIL_SCALE; +let MAX_THUMBNAIL_SCALE; + +var opt = null; + + +function update(reset = false) { + if (_overrides) { + _overrides.removeAll(); + } + + if (reset) { + if (original_MAX_THUMBNAIL_SCALE) + WorkspaceThumbnail.MAX_THUMBNAIL_SCALE = original_MAX_THUMBNAIL_SCALE; + _overrides = null; + opt = null; + return; + } + + opt = Me.imports.settings.opt; + + MAX_THUMBNAIL_SCALE = opt.MAX_THUMBNAIL_SCALE; + WorkspaceThumbnail.MAX_THUMBNAIL_SCALE = MAX_THUMBNAIL_SCALE; + + _overrides = new _Util.Overrides(); + + _overrides.addOverride('WorkspaceThumbnail', WorkspaceThumbnail.WorkspaceThumbnail.prototype, WorkspaceThumbnailCommon); + + if (opt.ORIENTATION === Clutter.Orientation.VERTICAL) { + _overrides.addOverride('ThumbnailsBox', WorkspaceThumbnail.ThumbnailsBox.prototype, ThumbnailsBoxVertical); + } else { + _overrides.addOverride('ThumbnailsBox', WorkspaceThumbnail.ThumbnailsBox.prototype, ThumbnailsBoxHorizontal); + } +} + + +var WorkspaceThumbnailCommon = { + after__init: function () { + + //radius of ws thumbnail background + this.add_style_class_name('ws-tmb'); + + // add workspace thumbnails labels if enabled + if (opt.SHOW_WST_LABELS) { // 0 - disable + // layout manager allows aligning widget children + this.layout_manager = new Clutter.BinLayout(); + // adding layout manager to tmb widget breaks wallpaper background aligning and rounded corners + // unless border is removed + if (opt.SHOW_WS_TMB_BG) + this.add_style_class_name('ws-tmb-labeled'); + + const getLabel = function() { + const wsIndex = this.metaWorkspace.index(); + let label = `${wsIndex + 1}`; + if (opt.SHOW_WST_LABELS === 2) { // 2 - index + workspace name + const settings = ExtensionUtils.getSettings('org.gnome.desktop.wm.preferences'); + const wsLabels = settings.get_strv('workspace-names'); + if (wsLabels.length > wsIndex && wsLabels[wsIndex]) { + label += `: ${wsLabels[wsIndex]}`; + } + } else if (opt.SHOW_WST_LABELS === 3) { // 3- index + app name + // global.display.get_tab_list offers workspace filtering using the second argument, but... + // ... it sometimes includes windows from other workspaces, like minimized VBox machines, after Shell restarts + const metaWin = global.display.get_tab_list(0, null).filter( + w => w.get_monitor() === this.monitorIndex && w.get_workspace().index() === wsIndex)[0]; + + if (metaWin) { + let tracker = Shell.WindowTracker.get_default(); + label += `: ${tracker.get_window_app(metaWin).get_name()}`; + } + } else if (opt.SHOW_WST_LABELS === 4) { + const metaWin = global.display.get_tab_list(0, null).filter( + w => w.get_monitor() === this.monitorIndex && w.get_workspace().index() === wsIndex)[0]; + + if (metaWin) { + label += `: ${metaWin.title}`; + } + } + return label; + }.bind(this); + + const label = getLabel(); + + this._wsLabel = new St.Label({ + text: label, + style_class: 'ws-tmb-label', + x_align: Clutter.ActorAlign.FILL, + y_align: Clutter.ActorAlign.END, + x_expand: true, + y_expand: true, + }); + + this._wsLabel._maxOpacity = 255; + this._wsLabel.opacity = this._wsLabel._maxOpacity; + + this.add_child(this._wsLabel); + this.set_child_above_sibling(this._wsLabel, null); + + this._wsIndexSigId = this.metaWorkspace.connect('notify::workspace-index', () => { + const newLabel = getLabel(); + this._wsLabel.text = newLabel; + }); + + this.connect('destroy', () => this.metaWorkspace.disconnect(this._wsIndexSigId)); + + if (opt.SHOW_WST_LABELS_ON_HOVER) { + this._wsLabel.opacity = 0; + this.reactive = true; + this.connect('enter-event', ()=> this._wsLabel.ease({ + duration: 100, + mode: Clutter.AnimationMode.EASE_OUT_QUAD, + opacity: this._wsLabel._maxOpacity + })); + this.connect('leave-event', ()=> this._wsLabel.ease({ + duration: 100, + mode: Clutter.AnimationMode.EASE_OUT_QUAD, + opacity: 0 + })); + } + } + + if (opt.SHOW_WS_TMB_BG) { + this._bgManager = new Background.BackgroundManager({ + monitorIndex: this.monitorIndex, + container: this._viewport, + vignette: false, + controlPosition: false, + }); + + this._viewport.set_child_below_sibling(this._bgManager.backgroundActor, null); + + this.connect('destroy', function () { + if (this._bgManager) + this._bgManager.destroy(); + this._bgManager = null; + }.bind(this)); + + this._bgManager.backgroundActor.opacity = 220; + + // this all is just for the small border radius... + /*const { scaleFactor } = St.ThemeContext.get_for_stage(global.stage); + const cornerRadius = scaleFactor * BACKGROUND_CORNER_RADIUS_PIXELS; + const backgroundContent = this._bgManager.backgroundActor.content; + backgroundContent.rounded_clip_radius = cornerRadius; + + // the original clip has some addition at the bottom + const rect = new Graphene.Rect(); + rect.origin.x = this._viewport.x; + rect.origin.y = this._viewport.y; + rect.size.width = this._viewport.width; + rect.size.height = this._viewport.height; + + this._bgManager.backgroundActor.content.set_rounded_clip_bounds(rect);*/ + } + }, + + activate: function(time) { + if (this.state > ThumbnailState.NORMAL) + return; + + // if Static Workspace overview mode active, a click on the already active workspace should activate the window picker mode + const wsIndex = this.metaWorkspace.index(); + const lastWsIndex = global.display.get_workspace_manager().get_n_workspaces() - 1; + const stateAdjustment = Main.overview._overview.controls._stateAdjustment; + + if (stateAdjustment.value === ControlsState.APP_GRID) { + if (this.metaWorkspace.active) { + Main.overview._overview.controls._shiftState(Meta.MotionDirection.DOWN); + // if searchActive, hide it immediately + Main.overview.searchEntry.set_text(''); + } else { + this.metaWorkspace.activate(time); + } + } else { + if (opt.OVERVIEW_MODE2 && !opt.WORKSPACE_MODE && wsIndex < lastWsIndex) { + if (stateAdjustment.value > 1) { + stateAdjustment.value = 1; + } + + // spread windows + // in OVERVIEW MODE 2 windows are not spread and workspace is not scaled + // we need to repeat transition to the overview state 1 (window picker), but with spreading windows animation + if (this.metaWorkspace.active) { + opt.WORKSPACE_MODE = 1; + const stateAdjustment = Main.overview._overview.controls._stateAdjustment + // setting value to 0 would reset WORKSPACE_MODE + stateAdjustment.value = 0.01; + stateAdjustment.ease(1, { + duration: 200, + mode: Clutter.AnimationMode.EASE_OUT_QUAD, + }); + + /*const adjustment = Main.overview._overview.controls._workspacesDisplay._workspacesViews[0]._workspaces[wsIndex].stateAdjustment; + adjustment.value = 0; + adjustment.ease(1, { + duration: 200, + mode: Clutter.AnimationMode.EASE_OUT_QUAD, + });*/ + } else { + // switch ws + this.metaWorkspace.activate(time); + } + // a click on the current workspace should go back to the main view + } else if (this.metaWorkspace.active) { + Main.overview.hide(); + } else { + this.metaWorkspace.activate(time); + } + } + } +} + +// ThumbnailsBox Vertical + +var ThumbnailsBoxVertical = { + _activateThumbnailAtPoint: function(stageX, stageY, time) { + const [r_, x, y] = this.transform_stage_point(stageX, stageY); + + const thumbnail = this._thumbnails.find(t => y >= t.y && y <= t.y + t.height); + if (thumbnail) { + thumbnail.activate(time); + } + }, + + _getPlaceholderTarget: function(index, spacing, rtl) { + const workspace = this._thumbnails[index]; + + let targetY1; + let targetY2; + + if (rtl) { + const baseY = workspace.y + workspace.height; + targetY1 = baseY - WORKSPACE_CUT_SIZE; + targetY2 = baseY + spacing + WORKSPACE_CUT_SIZE; + } else { + targetY1 = workspace.y - spacing - WORKSPACE_CUT_SIZE; + targetY2 = workspace.y + WORKSPACE_CUT_SIZE; + } + + if (index === 0) { + if (rtl) + targetY2 -= spacing + WORKSPACE_CUT_SIZE; + else + targetY1 += spacing + WORKSPACE_CUT_SIZE; + } + + if (index === this._dropPlaceholderPos) { + const placeholderHeight = this._dropPlaceholder.get_height() + spacing; + if (rtl) + targetY2 += placeholderHeight; + else + targetY1 -= placeholderHeight; + } + + return [targetY1, targetY2]; + }, + + _withinWorkspace: function(y, index, rtl) { + const length = this._thumbnails.length; + const workspace = this._thumbnails[index]; + + let workspaceY1 = workspace.y + WORKSPACE_CUT_SIZE; + let workspaceY2 = workspace.y + workspace.height - WORKSPACE_CUT_SIZE; + + if (index === length - 1) { + if (rtl) + workspaceY1 -= WORKSPACE_CUT_SIZE; + else + workspaceY2 += WORKSPACE_CUT_SIZE; + } + + return y > workspaceY1 && y <= workspaceY2; + }, + + handleDragOver: function(source, actor, x, y, time) { + if (!source.metaWindow && + (!source.app || !source.app.can_open_new_window()) && + (source.app || !source.shellWorkspaceLaunch) && + source != Main.xdndHandler) + return DND.DragMotionResult.CONTINUE; + + const rtl = Clutter.get_default_text_direction() === Clutter.TextDirection.RTL; + let canCreateWorkspaces = Meta.prefs_get_dynamic_workspaces(); + let spacing = this.get_theme_node().get_length('spacing'); + + this._dropWorkspace = -1; + let placeholderPos = -1; + let length = this._thumbnails.length; + for (let i = 0; i < length; i++) { + const index = rtl ? length - i - 1 : i; + + if (canCreateWorkspaces && source !== Main.xdndHandler) { + const [targetStart, targetEnd] = + this._getPlaceholderTarget(index, spacing, rtl); + + if (y > targetStart && y <= targetEnd) { + placeholderPos = index; + break; + } + } + + if (this._withinWorkspace(y, index, rtl)) { + this._dropWorkspace = index; + break; + } + } + + if (this._dropPlaceholderPos != placeholderPos) { + this._dropPlaceholderPos = placeholderPos; + this.queue_relayout(); + } + + if (this._dropWorkspace != -1) + return this._thumbnails[this._dropWorkspace].handleDragOverInternal(source, actor, time); + else if (this._dropPlaceholderPos != -1) + return source.metaWindow ? DND.DragMotionResult.MOVE_DROP : DND.DragMotionResult.COPY_DROP; + else + return DND.DragMotionResult.CONTINUE; + }, + + //vfunc_get_preferred_width: function(forHeight) { + // override of this vfunc doesn't work for some reason (tested on Ubuntu and Fedora), it's not reachable + get_preferred_custom_width: function(forHeight) { + if (forHeight === -1) + return this.get_preferred_custom_height(forHeight); + + let themeNode = this.get_theme_node(); + + forHeight = themeNode.adjust_for_width(forHeight); + + let spacing = themeNode.get_length('spacing'); + let nWorkspaces = this._thumbnails.length; + let totalSpacing = (nWorkspaces - 1) * spacing; + + const avail = forHeight - totalSpacing; + + let scale = (avail / nWorkspaces) / this._porthole.height; + scale = Math.min(scale, MAX_THUMBNAIL_SCALE); + + const width = Math.round(this._porthole.width * scale); + + return themeNode.adjust_preferred_width(width, width); + }, + + get_preferred_custom_height: function(_forWidth) { + // Note that for getPreferredHeight/Width we cheat a bit and skip propagating + // the size request to our children because we know how big they are and know + // that the actors aren't depending on the virtual functions being called. + let themeNode = this.get_theme_node(); + + let spacing = themeNode.get_length('spacing'); + let nWorkspaces = this._thumbnails.length; + + let totalSpacing = (nWorkspaces - 1) * spacing; + + const ratio = this._porthole.width / this._porthole.height; + const tmbHeight = _forWidth / ratio; + + const naturalheight = this._thumbnails.reduce((accumulator, thumbnail, index) => { + //let workspaceSpacing = 0; + + const progress = 1 - thumbnail.collapse_fraction; + //const height = (this._porthole.height * MAX_THUMBNAIL_SCALE + workspaceSpacing) * progress; + const height = (tmbHeight) * progress; + return accumulator + height; + }, 0); + + //return themeNode.adjust_preferred_height(totalSpacing, naturalheight); + // we need to calculate the height precisely as it need to align with the workspacesDisplay because of transition animation + // This works perfectly for fullHD monitor, for some reason 5:4 aspect ratio monitor adds unnecessary pixels to the final height of the thumbnailsBox + return [totalSpacing, naturalheight]; + }, + + // removes extra space (extraWidth in the original function), we need the box as accurate as possible + // for precise app grid transition animation + vfunc_allocate: function(box) { + this.set_allocation(box); + + let rtl = Clutter.get_default_text_direction() == Clutter.TextDirection.RTL; + + if (this._thumbnails.length == 0) // not visible + return; + + let themeNode = this.get_theme_node(); + box = themeNode.get_content_box(box); + + const portholeWidth = this._porthole.width; + const portholeHeight = this._porthole.height; + const spacing = themeNode.get_length('spacing'); + + const nWorkspaces = this._thumbnails.length; + + // Compute the scale we'll need once everything is updated, + // unless we are currently transitioning + if (this._expandFraction === 1) { + const totalSpacing = (nWorkspaces - 1) * spacing; + const availableHeight = (box.get_height() - totalSpacing) / nWorkspaces; + + const hScale = box.get_width() / portholeWidth; + const vScale = availableHeight / portholeHeight; + const newScale = Math.min(hScale, vScale); + + if (newScale !== this._targetScale) { + if (this._targetScale > 0) { + // We don't ease immediately because we need to observe the + // ordering in queueUpdateStates - if workspaces have been + // removed we need to slide them out as the first thing. + this._targetScale = newScale; + this._pendingScaleUpdate = true; + } else { + this._targetScale = this._scale = newScale; + } + + this._queueUpdateStates(); + } + } + + const ratio = portholeWidth / portholeHeight; + const thumbnailFullHeight = Math.round(portholeHeight * this._scale); + const thumbnailWidth = Math.round(thumbnailFullHeight * ratio); + const thumbnailHeight = thumbnailFullHeight * this._expandFraction; + const roundedVScale = thumbnailHeight / portholeHeight; + + let indicatorValue = this._scrollAdjustment.value; + let indicatorUpperWs = Math.ceil(indicatorValue); + let indicatorLowerWs = Math.floor(indicatorValue); + + let indicatorLowerY1 = 0; + let indicatorLowerY2 = 0; + let indicatorUpperY1 = 0; + let indicatorUpperY2 = 0; + + let indicatorThemeNode = this._indicator.get_theme_node(); + let indicatorTopFullBorder = indicatorThemeNode.get_padding(St.Side.TOP) + indicatorThemeNode.get_border_width(St.Side.TOP); + let indicatorBottomFullBorder = indicatorThemeNode.get_padding(St.Side.BOTTOM) + indicatorThemeNode.get_border_width(St.Side.BOTTOM); + let indicatorLeftFullBorder = indicatorThemeNode.get_padding(St.Side.LEFT) + indicatorThemeNode.get_border_width(St.Side.LEFT); + let indicatorRightFullBorder = indicatorThemeNode.get_padding(St.Side.RIGHT) + indicatorThemeNode.get_border_width(St.Side.RIGHT); + + let y = box.y1; + + if (this._dropPlaceholderPos == -1) { + this._dropPlaceholder.allocate_preferred_size( + ...this._dropPlaceholder.get_position()); + + Meta.later_add(Meta.LaterType.BEFORE_REDRAW, () => { + this._dropPlaceholder.hide(); + }); + } + + let childBox = new Clutter.ActorBox(); + + for (let i = 0; i < this._thumbnails.length; i++) { + const thumbnail = this._thumbnails[i]; + if (i > 0) + y += spacing - Math.round(thumbnail.collapse_fraction * spacing); + + const x1 = box.x1; + const x2 = x1 + thumbnailWidth; + + if (i === this._dropPlaceholderPos) { + let [, placeholderHeight] = this._dropPlaceholder.get_preferred_height(-1); + childBox.x1 = x1; + childBox.x2 = x2; + + if (rtl) { + childBox.y2 = box.y2 - Math.round(y); + childBox.y1 = box.y2 - Math.round(y + placeholderHeight); + } else { + childBox.y1 = Math.round(y); + childBox.y2 = Math.round(y + placeholderHeight); + } + + this._dropPlaceholder.allocate(childBox); + + Meta.later_add(Meta.LaterType.BEFORE_REDRAW, () => { + this._dropPlaceholder.show(); + }); + y += placeholderHeight + spacing; + } + + // We might end up with thumbnailWidth being something like 99.33 + // pixels. To make this work and not end up with a gap at the end, + // we need some thumbnails to be 99 pixels and some 100 pixels width; + // we compute an actual scale separately for each thumbnail. + const y1 = Math.round(y); + const y2 = Math.round(y + thumbnailHeight); + const roundedHScale = (y2 - y1) / portholeHeight; + + // Allocating a scaled actor is funny - x1/y1 correspond to the origin + // of the actor, but x2/y2 are increased by the *unscaled* size. + if (rtl) { + childBox.y2 = box.y2 - y1; + childBox.y1 = box.y2 - (y1 + thumbnailHeight); + } else { + childBox.y1 = y1; + childBox.y2 = y1 + thumbnailHeight; + } + childBox.x1 = x1; + childBox.x2 = x1 + thumbnailWidth; + + thumbnail.setScale(roundedHScale, roundedVScale); + thumbnail.allocate(childBox); + + if (i === indicatorUpperWs) { + indicatorUpperY1 = childBox.y1; + indicatorUpperY2 = childBox.y2; + } + if (i === indicatorLowerWs) { + indicatorLowerY1 = childBox.y1; + indicatorLowerY2 = childBox.y2; + } + + // We round the collapsing portion so that we don't get thumbnails resizing + // during an animation due to differences in rounded, but leave the uncollapsed + // portion unrounded so that non-animating we end up with the right total + y += thumbnailHeight - Math.round(thumbnailHeight * thumbnail.collapse_fraction); + } + + childBox.x1 = box.x1; + childBox.x2 = box.x1 + thumbnailWidth; + + const indicatorY1 = indicatorLowerY1 + + (indicatorUpperY1 - indicatorLowerY1) * (indicatorValue % 1); + const indicatorY2 = indicatorLowerY2 + + (indicatorUpperY2 - indicatorLowerY2) * (indicatorValue % 1); + + childBox.y1 = indicatorY1 - indicatorTopFullBorder; + childBox.y2 = indicatorY2 + indicatorBottomFullBorder; + childBox.x1 -= indicatorLeftFullBorder; + childBox.x2 += indicatorRightFullBorder; + this._indicator.allocate(childBox); + }, + + _updateShouldShow: function() { + // set current workspace indicator border radius + // here just 'cause it's easier than adding to init + this._indicator.add_style_class_name('ws-tmb'); + + const shouldShow = opt.SHOW_WS_TMB; + if (this._shouldShow === shouldShow) + return; + + this._shouldShow = shouldShow; + this.notify('should-show'); + } +} + +// ThumbnailsBox Horizontal + +var ThumbnailsBoxHorizontal = { + get_preferred_custom_width: function(_forHeight) { + // Note that for getPreferredHeight/Width we cheat a bit and skip propagating + // the size request to our children because we know how big they are and know + // that the actors aren't depending on the virtual functions being called. + let themeNode = this.get_theme_node(); + + let spacing = themeNode.get_length('spacing'); + let nWorkspaces = this._thumbnails.length; + let totalSpacing = (nWorkspaces - 1) * spacing; + + const ratio = this._porthole.height / this._porthole.width; + const tmbWidth = (_forHeight - 2 * spacing) / ratio; + + const naturalWidth = this._thumbnails.reduce((accumulator, thumbnail, index) => { + const progress = 1 - thumbnail.collapse_fraction; + const width = tmbWidth * progress; + return accumulator + width; + }, 0); + + return themeNode.adjust_preferred_width(totalSpacing, naturalWidth); + }, + + vfunc_allocate(box) { + this.set_allocation(box); + + let rtl = Clutter.get_default_text_direction() == Clutter.TextDirection.RTL; + + if (this._thumbnails.length == 0) // not visible + return; + + let themeNode = this.get_theme_node(); + box = themeNode.get_content_box(box); + + const portholeWidth = this._porthole.width; + const portholeHeight = this._porthole.height; + const spacing = themeNode.get_length('spacing'); + + const nWorkspaces = this._thumbnails.length; + + // Compute the scale we'll need once everything is updated, + // unless we are currently transitioning + if (this._expandFraction === 1) { + const totalSpacing = (nWorkspaces - 1) * spacing; + const availableWidth = (box.get_width() - totalSpacing) / nWorkspaces; + + const hScale = availableWidth / portholeWidth; + const vScale = box.get_height() / portholeHeight; + const newScale = Math.min(hScale, vScale); + + if (newScale !== this._targetScale) { + if (this._targetScale > 0) { + // We don't ease immediately because we need to observe the + // ordering in queueUpdateStates - if workspaces have been + // removed we need to slide them out as the first thing. + this._targetScale = newScale; + this._pendingScaleUpdate = true; + } else { + this._targetScale = this._scale = newScale; + } + + this._queueUpdateStates(); + } + } + + const ratio = portholeWidth / portholeHeight; + const thumbnailFullHeight = Math.round(portholeHeight * this._scale); + const thumbnailWidth = Math.round(thumbnailFullHeight * ratio); + const thumbnailHeight = thumbnailFullHeight * this._expandFraction; + const roundedVScale = thumbnailHeight / portholeHeight; + + let indicatorValue = this._scrollAdjustment.value; + let indicatorUpperWs = Math.ceil(indicatorValue); + let indicatorLowerWs = Math.floor(indicatorValue); + + let indicatorLowerX1 = 0; + let indicatorLowerX2 = 0; + let indicatorUpperX1 = 0; + let indicatorUpperX2 = 0; + + let indicatorThemeNode = this._indicator.get_theme_node(); + let indicatorTopFullBorder = indicatorThemeNode.get_padding(St.Side.TOP) + indicatorThemeNode.get_border_width(St.Side.TOP); + let indicatorBottomFullBorder = indicatorThemeNode.get_padding(St.Side.BOTTOM) + indicatorThemeNode.get_border_width(St.Side.BOTTOM); + let indicatorLeftFullBorder = indicatorThemeNode.get_padding(St.Side.LEFT) + indicatorThemeNode.get_border_width(St.Side.LEFT); + let indicatorRightFullBorder = indicatorThemeNode.get_padding(St.Side.RIGHT) + indicatorThemeNode.get_border_width(St.Side.RIGHT); + + let x = box.x1; + + if (this._dropPlaceholderPos == -1) { + this._dropPlaceholder.allocate_preferred_size( + ...this._dropPlaceholder.get_position()); + + Meta.later_add(Meta.LaterType.BEFORE_REDRAW, () => { + this._dropPlaceholder.hide(); + }); + } + + let childBox = new Clutter.ActorBox(); + + for (let i = 0; i < this._thumbnails.length; i++) { + const thumbnail = this._thumbnails[i]; + if (i > 0) + x += spacing - Math.round(thumbnail.collapse_fraction * spacing); + + const y1 = box.y1; + const y2 = y1 + thumbnailHeight; + + if (i === this._dropPlaceholderPos) { + const [, placeholderWidth] = this._dropPlaceholder.get_preferred_width(-1); + childBox.y1 = y1; + childBox.y2 = y2; + + if (rtl) { + childBox.x2 = box.x2 - Math.round(x); + childBox.x1 = box.x2 - Math.round(x + placeholderWidth); + } else { + childBox.x1 = Math.round(x); + childBox.x2 = Math.round(x + placeholderWidth); + } + + this._dropPlaceholder.allocate(childBox); + + Meta.later_add(Meta.LaterType.BEFORE_REDRAW, () => { + this._dropPlaceholder.show(); + }); + x += placeholderWidth + spacing; + } + + // We might end up with thumbnailWidth being something like 99.33 + // pixels. To make this work and not end up with a gap at the end, + // we need some thumbnails to be 99 pixels and some 100 pixels width; + // we compute an actual scale separately for each thumbnail. + const x1 = Math.round(x); + const x2 = Math.round(x + thumbnailWidth); + const roundedHScale = (x2 - x1) / portholeWidth; + + // Allocating a scaled actor is funny - x1/y1 correspond to the origin + // of the actor, but x2/y2 are increased by the *unscaled* size. + if (rtl) { + childBox.x2 = box.x2 - x1; + childBox.x1 = box.x2 - (x1 + thumbnailWidth); + } else { + childBox.x1 = x1; + childBox.x2 = x1 + thumbnailWidth; + } + childBox.y1 = y1; + childBox.y2 = y1 + thumbnailHeight; + + thumbnail.setScale(roundedHScale, roundedVScale); + thumbnail.allocate(childBox); + + if (i === indicatorUpperWs) { + indicatorUpperX1 = childBox.x1; + indicatorUpperX2 = childBox.x2; + } + if (i === indicatorLowerWs) { + indicatorLowerX1 = childBox.x1; + indicatorLowerX2 = childBox.x2; + } + + // We round the collapsing portion so that we don't get thumbnails resizing + // during an animation due to differences in rounded, but leave the uncollapsed + // portion unrounded so that non-animating we end up with the right total + x += thumbnailWidth - Math.round(thumbnailWidth * thumbnail.collapse_fraction); + } + + childBox.y1 = box.y1; + childBox.y2 = box.y1 + thumbnailHeight; + + const indicatorX1 = indicatorLowerX1 + + (indicatorUpperX1 - indicatorLowerX1) * (indicatorValue % 1); + const indicatorX2 = indicatorLowerX2 + + (indicatorUpperX2 - indicatorLowerX2) * (indicatorValue % 1); + + childBox.x1 = indicatorX1 - indicatorLeftFullBorder; + childBox.x2 = indicatorX2 + indicatorRightFullBorder; + childBox.y1 -= indicatorTopFullBorder; + childBox.y2 += indicatorBottomFullBorder; + this._indicator.allocate(childBox); + }, + + _updateShouldShow: ThumbnailsBoxVertical._updateShouldShow +} diff --git a/extensions/vertical-workspaces/workspacesView.js b/extensions/vertical-workspaces/workspacesView.js new file mode 100644 index 0000000..820ea6b --- /dev/null +++ b/extensions/vertical-workspaces/workspacesView.js @@ -0,0 +1,864 @@ +/** + * Vertical Workspaces + * workspacesView.js + * + * @author GdH + * @copyright 2022 - 2023 + * @license GPL-3.0 + * + */ + +'use strict'; + +const { GObject, Clutter, Meta, St } = imports.gi; + +const Main = imports.ui.main; +const Util = imports.misc.util; +const WorkspacesView = imports.ui.workspacesView; +//const SecondaryMonitorDisplay = WorkspacesView.SecondaryMonitorDisplay; +// first call of item defined using const in other module returns undefined +WorkspacesView.SecondaryMonitorDisplay; +const ControlsState = imports.ui.overviewControls.ControlsState; +const FitMode = imports.ui.workspacesView.FitMode; + +const SIDE_CONTROLS_ANIMATION_TIME = imports.ui.overview.ANIMATION_TIME; + +const Me = imports.misc.extensionUtils.getCurrentExtension(); +const SEARCH_WINDOWS_PREFIX = Me.imports.windowSearchProvider.prefix; +const SEARCH_RECENT_FILES_PREFIX = Me.imports.recentFilesSearchProvider.prefix; + +const _Util = Me.imports.util; +let _overrides; + +let opt; + + + +function update(reset = false) { + if (_overrides) { + _overrides.removeAll(); + global.workspace_manager.override_workspace_layout(Meta.DisplayCorner.TOPLEFT, false, 1, -1); + } + + if (reset) { + _overrides = null; + opt = null; + return; + } + + opt = Me.imports.settings.opt; + + _overrides = new _Util.Overrides(); + + _overrides.addOverride('WorkspacesView', WorkspacesView.WorkspacesView.prototype, WorkspacesViewCommon); + _overrides.addOverride('WorkspacesDisplay', WorkspacesView.WorkspacesDisplay.prototype, WorkspacesDisplay); + + if (opt.ORIENTATION) { + // switch internal workspace orientation in GS + global.workspace_manager.override_workspace_layout(Meta.DisplayCorner.TOPLEFT, false, -1, 1); + _overrides.addOverride('SecondaryMonitorDisplay', WorkspacesView.SecondaryMonitorDisplay.prototype, SecondaryMonitorDisplayVertical); + } else { + _overrides.addOverride('SecondaryMonitorDisplay', WorkspacesView.SecondaryMonitorDisplay.prototype, SecondaryMonitorDisplayHorizontal); + } +} + +var WorkspacesViewCommon = { + _getFirstFitSingleWorkspaceBox: function(box, spacing, vertical) { + let [width, height] = box.get_size(); + const [workspace] = this._workspaces; + + const rtl = this.text_direction === Clutter.TextDirection.RTL; + const adj = this._scrollAdjustment; + const currentWorkspace = vertical || !rtl + ? adj.value : adj.upper - adj.value - 1; + + // Single fit mode implies centered too + let [x1, y1] = box.get_origin(); + const [, workspaceWidth] = workspace ? workspace.get_preferred_width(Math.floor(height)) : [,width]; + const [, workspaceHeight] = workspace ? workspace.get_preferred_height(workspaceWidth) : [,height]; + + if (vertical) { + x1 += (width - workspaceWidth) / 2; + y1 -= currentWorkspace * (workspaceHeight + spacing); + } else { + x1 += (width - workspaceWidth) / 2; + x1 -= currentWorkspace * (workspaceWidth + spacing); + } + + const fitSingleBox = new Clutter.ActorBox({x1, y1}); + + fitSingleBox.set_size(workspaceWidth, workspaceHeight); + + return fitSingleBox; + }, + + // set spacing between ws previews + _getSpacing: function(box, fitMode, vertical) { + const [width, height] = box.get_size(); + const [workspace] = this._workspaces; + + if (!workspace) return; + + let availableSpace; + let workspaceSize; + if (vertical) { + [, workspaceSize] = workspace.get_preferred_height(width); + availableSpace = height; + } else { + [, workspaceSize] = workspace.get_preferred_width(height); + availableSpace = width; + } + + const spacing = (availableSpace - workspaceSize * 0.4) * (1 - fitMode); + const { scaleFactor } = St.ThemeContext.get_for_stage(global.stage); + return Math.clamp(spacing, + opt.WORKSPACE_MIN_SPACING * scaleFactor, + opt.WORKSPACE_MAX_SPACING * scaleFactor); + }, + + // this function has duplicate in OverviewControls so we use one function for both to avoid issues with syncing them + _getFitModeForState: function(state) { + return _getFitModeForState(state); + }, + + // normal view 0, spread windows 1 + _getWorkspaceModeForOverviewState: function(state) { + + switch (state) { + case ControlsState.HIDDEN: + return 0; + case ControlsState.WINDOW_PICKER: + return opt.WORKSPACE_MODE; + case ControlsState.APP_GRID: + return ((this._monitorIndex !== global.display.get_primary_monitor() || !opt.WS_ANIMATION) && !opt.OVERVIEW_MODE) ? 1 : 0; + } + + return 0; + }, + + _updateVisibility: function() { + let workspaceManager = global.workspace_manager; + let active = workspaceManager.get_active_workspace_index(); + + const fitMode = this._fitModeAdjustment.value; + const singleFitMode = fitMode === FitMode.SINGLE; + + for (let w = 0; w < this._workspaces.length; w++) { + let workspace = this._workspaces[w]; + + if (this._animating || this._gestureActive || !singleFitMode) { + //workspace.show(); + } else { + workspace.visible = Math.abs(w - active) <= opt.NUMBER_OF_VISIBLE_NEIGHBORS; + } + + } + }, + + // disable scaling and hide inactive workspaces + _updateWorkspacesState: function() { + const adj = this._scrollAdjustment; + const fitMode = this._fitModeAdjustment.value; + + let { initialState, finalState, progress, currentState } = + this._overviewAdjustment.getStateTransitionParams(); + + const workspaceMode = (1 - fitMode) * Util.lerp( + this._getWorkspaceModeForOverviewState(initialState), + this._getWorkspaceModeForOverviewState(finalState), + progress); + + + const currentMonitor = Main.layoutManager.primaryMonitor.index; + + // define the transition values here to save time in each ws + let scaleX, scaleY; + if (opt.ORIENTATION) { //vertical 1 / horizontal 0 + scaleX = 1; + scaleY = 0.1; + } else { + scaleX = 0.1; + scaleY = 1; + } + + const secondaryMonitor = this._monitorIndex !== global.display.get_primary_monitor(); + const blockSecondaryAppGrid = opt.OVERVIEW_MODE && currentState >= 1; + // Hide inactive workspaces + this._workspaces.forEach((w, index) => { + if (!(blockSecondaryAppGrid && secondaryMonitor)) + w.stateAdjustment.value = workspaceMode; + //w.stateAdjustment.value = workspaceMode; + + const distanceToCurrentWorkspace = Math.abs(adj.value - index); + + const scaleProgress = 1 - Math.clamp(distanceToCurrentWorkspace, 0, 1); + + // if we disable workspaces that we can't or don't need to see, transition animations will be noticeably smoother + + // only the current ws needs to be visible during overview transition animations + // and only current and adjacent ws when switching ws + if (opt.WORKSPACE_MAX_SPACING > 340) { // large spacing - only one workspace needs to be visible at once in the overview + w.visible = scaleProgress || ((currentState % 1) && !distanceToCurrentWorkspace); + + // horizontal orientation - 2 adjacent workspaces can be visible on the screen with the current one + // in order to keep animations as smooth as possible, hide all ws that cannot/shouldn't be visible at the given time + } else { + // + w.visible = w.monitorIndex !== currentMonitor || scaleProgress || (!opt.WS_ANIMATION && distanceToCurrentWorkspace < opt.NUMBER_OF_VISIBLE_NEIGHBORS) + || (distanceToCurrentWorkspace < opt.NUMBER_OF_VISIBLE_NEIGHBORS && currentState <= ControlsState.WINDOW_PICKER + && ((initialState < ControlsState.APP_GRID && finalState < ControlsState.APP_GRID)) + ); + + // after transition from APP_GRID to WINDOW_PICKER state, + // adjacent workspaces are hidden and we need them to show up + // make them visible during animation can impact smoothness of the animation + // so we show them after the animation finished, scaling animation will make impression that they move in from outside the monitor + if (!w.visible && distanceToCurrentWorkspace <= opt.NUMBER_OF_VISIBLE_NEIGHBORS && currentState === ControlsState.WINDOW_PICKER) { + w.scale_x = scaleX; + w.scale_y = scaleY; + w.visible = true; + w.ease({ + duration: 100, + scale_x: 1, + scale_y: 1, + mode: Clutter.AnimationMode.EASE_OUT_QUAD, + }); + } + } + + // force ws preview bg corner radiuses where GS doesn't do it + if (opt.SHOW_WS_PREVIEW_BG && opt.OVERVIEW_MODE === 1 && distanceToCurrentWorkspace < 2) { + w._background._updateBorderRadius(Math.min(1, w._overviewAdjustment.value)); + } + + // hide workspace background + if (!opt.SHOW_WS_PREVIEW_BG && w._background.opacity) { + w._background.opacity = 0; + } + }); + } +} + +// SecondaryMonitorDisplay Vertical +var SecondaryMonitorDisplayVertical = { + _getThumbnailParamsForState: function(state) { + + let opacity, scale, translation_x; + switch (state) { + case ControlsState.HIDDEN: + opacity = 255; + scale = 1; + translation_x = 0; + if (!Main.layoutManager._startingUp && (!opt.SHOW_WS_PREVIEW_BG || opt.OVERVIEW_MODE2)) { + translation_x = this._thumbnails.width * (opt.SEC_WS_TMB_LEFT ? -1 : 1); + } + break; + case ControlsState.WINDOW_PICKER: + case ControlsState.APP_GRID: + opacity = 255; + scale = 1; + translation_x = 0; + break; + default: + opacity = 255; + scale = 1; + translation_x = 0; + break; + } + + return { opacity, scale, translation_x }; + }, + + _getThumbnailsWidth: function(box, spacing) { + if (!this._thumbnails.visible) + return 0; + + const [width, height] = box.get_size(); + const { expandFraction } = this._thumbnails; + const [, thumbnailsWidth] = this._thumbnails.get_preferred_custom_width(height - 2 * spacing); + return Math.min( + thumbnailsWidth * expandFraction, + width * opt.MAX_THUMBNAIL_SCALE); + }, + + _getWorkspacesBoxForState: function(state, box, padding, thumbnailsWidth, spacing) { + //const { ControlsState } = OverviewControls; + const workspaceBox = box.copy(); + const [width, height] = workspaceBox.get_size(); + + switch (state) { + case ControlsState.HIDDEN: + break; + case ControlsState.WINDOW_PICKER: + case ControlsState.APP_GRID: + if (opt.OVERVIEW_MODE2 && !opt.WORKSPACE_MODE) { + break; + } + + let wWidth = Math.round(width - thumbnailsWidth - 5 * spacing); + let wHeight = Math.round(Math.min(wWidth / (width / height), height - 1.7 * padding)); + wWidth *= opt.WS_PREVIEW_SCALE; + wHeight *= opt.WS_PREVIEW_SCALE; + + let wsbX; + let offset = Math.round(width - thumbnailsWidth - wWidth) / 2; + if (opt.SEC_WS_TMB_LEFT) { + wsbX = thumbnailsWidth + offset; + } else { + wsbX = offset; + } + + const wsbY = Math.round((height - wHeight) / 2); + + workspaceBox.set_origin(wsbX, wsbY); + workspaceBox.set_size(wWidth, wHeight); + break; + } + + return workspaceBox; + }, + + vfunc_allocate: function(box) { + this.set_allocation(box); + + const themeNode = this.get_theme_node(); + const contentBox = themeNode.get_content_box(box); + const [width, height] = contentBox.get_size(); + const { expandFraction } = this._thumbnails; + const spacing = themeNode.get_length('spacing') * expandFraction; + const padding = Math.round(0.1 * height); + + let thumbnailsWidth = this._getThumbnailsWidth(contentBox, spacing); + let [, thumbnailsHeight] = this._thumbnails.get_preferred_custom_height(thumbnailsWidth); + thumbnailsHeight = Math.min(thumbnailsHeight, height - 2 * spacing); + + this._thumbnails.visible = opt.SHOW_WS_TMB; + if (this._thumbnails.visible) { + let wsTmbX; + if (opt.SEC_WS_TMB_LEFT) { // left + wsTmbX = Math.round(spacing / 4); + this._thumbnails._positionLeft = true; + } else { + wsTmbX = Math.round(width - spacing / 4 - thumbnailsWidth); + this._thumbnails._positionLeft = false; + } + + const childBox = new Clutter.ActorBox(); + const availSpace = height - thumbnailsHeight - 2 * spacing; + + let wsTmbY = availSpace / 2; + wsTmbY -= opt.SEC_WS_TMB_POSITION_ADJUSTMENT * wsTmbY - spacing; + + childBox.set_origin(Math.round(wsTmbX), Math.round(wsTmbY)); + childBox.set_size(thumbnailsWidth, thumbnailsHeight); + this._thumbnails.allocate(childBox); + } + + const { + currentState, initialState, finalState, transitioning, progress, + } = this._overviewAdjustment.getStateTransitionParams(); + + let workspacesBox; + const workspaceParams = [contentBox, padding, thumbnailsWidth, spacing]; + if (!transitioning) { + workspacesBox = + this._getWorkspacesBoxForState(currentState, ...workspaceParams); + } else { + const initialBox = + this._getWorkspacesBoxForState(initialState, ...workspaceParams); + const finalBox = + this._getWorkspacesBoxForState(finalState, ...workspaceParams); + workspacesBox = initialBox.interpolate(finalBox, progress); + } + this._workspacesView.allocate(workspacesBox); + }, + + _updateThumbnailVisibility: function() { + if (opt.OVERVIEW_MODE2) { + this.set_child_above_sibling(this._thumbnails, null); + } + + const visible = !(this._settings.get_boolean('workspaces-only-on-primary') || + opt.SEC_WS_TMB_POSITION === 3); // 3 - disabled + + if (this._thumbnails.visible === visible) + return; + + this._thumbnails.show(); + this._updateThumbnailParams(); + this._thumbnails.ease_property('expand-fraction', visible ? 1 : 0, { + duration: SIDE_CONTROLS_ANIMATION_TIME, + mode: Clutter.AnimationMode.EASE_OUT_QUAD, + onComplete: () => { + this._thumbnails.visible = visible; + this._thumbnails._indicator.visible = visible; + }, + }); + }, + + _updateThumbnailParams: function() { + // workaround for upstream bug - secondary thumbnails boxes don't catch 'showing' signal on the shell startup and don't populate the box with thumbnails + // the tmbBox contents is also destroyed when overview state adjustment gets above 1 when swiping gesture from window picker to app grid + if (!this._thumbnails._thumbnails.length) { + this._thumbnails._createThumbnails(); + } + + if (!this._thumbnails.visible) + return; + + const { initialState, finalState, progress } = + this._overviewAdjustment.getStateTransitionParams(); + + const initialParams = this._getThumbnailParamsForState(initialState); + const finalParams = this._getThumbnailParamsForState(finalState); + + /*const opacity = + Util.lerp(initialParams.opacity, finalParams.opacity, progress); + const scale = + Util.lerp(initialParams.scale, finalParams.scale, progress);*/ + + // OVERVIEW_MODE 2 should animate dash and wsTmbBox only if WORKSPACE_MODE === 0 (windows not spread) + const animateOverviewMode2 = opt.OVERVIEW_MODE2 && !(finalState === 1 && opt.WORKSPACE_MODE); + const translation_x = (!Main.layoutManager._startingUp && ((!opt.SHOW_WS_PREVIEW_BG && !(opt.OVERVIEW_MODE2)) || animateOverviewMode2)) + ? Util.lerp(initialParams.translation_x, finalParams.translation_x, progress) + : 0; + + this._thumbnails.set({ + opacity: 255, + //scale_x: scale, + //scale_y: scale, + translation_x, + }); + }, + + _updateWorkspacesView: function() { + if (this._workspacesView) + this._workspacesView.destroy(); + + if (this._settings.get_boolean('workspaces-only-on-primary')) { + this._workspacesView = new WorkspacesView.ExtraWorkspaceView( + this._monitorIndex, + this._overviewAdjustment); + } else { + this._workspacesView = new WorkspacesView.WorkspacesView( + this._monitorIndex, + this._controls, + this._scrollAdjustment, + // Secondary monitors don't need FitMode.ALL since there is workspace switcher always visible + //this._fitModeAdjustment, + new St.Adjustment({ + actor: this, + value: 0,//FitMode.SINGLE, + lower: 0,//FitMode.SINGLE, + upper: 0,//FitMode.SINGLE, + }), + //secondaryOverviewAdjustment); + this._overviewAdjustment); + } + this.add_child(this._workspacesView); + this._thumbnails.opacity = 0; + } +} + +// SecondaryMonitorDisplay Horizontal +var SecondaryMonitorDisplayHorizontal = { + _getThumbnailParamsForState: function(state) { + //const { ControlsState } = OverviewControls; + + let opacity, scale, translation_y; + switch (state) { + case ControlsState.HIDDEN: + opacity = 255; + scale = 1; + translation_y = 0; + if (!Main.layoutManager._startingUp && (!opt.SHOW_WS_PREVIEW_BG || opt.OVERVIEW_MODE2)) { + translation_y = this._thumbnails.height * (opt.SEC_WS_TMB_TOP ? -1 : 1); + } + break; + case ControlsState.WINDOW_PICKER: + case ControlsState.APP_GRID: + opacity = 255; + scale = 1; + translation_y = 0; + break; + default: + opacity = 255; + scale = 1; + translation_y = 0; + break; + } + + return { opacity, scale, translation_y }; + }, + + _getWorkspacesBoxForState: function(state, box, padding, thumbnailsHeight, spacing) { + //const { ControlsState } = OverviewControls; + const workspaceBox = box.copy(); + const [width, height] = workspaceBox.get_size(); + + switch (state) { + case ControlsState.HIDDEN: + break; + case ControlsState.WINDOW_PICKER: + case ControlsState.APP_GRID: + if (opt.OVERVIEW_MODE2 && !opt.WORKSPACE_MODE) { + break; + } + + let wHeight = Math.round(Math.min(height - thumbnailsHeight - 5 * spacing)); + let wWidth = Math.round(Math.min(wHeight * (width / height), width - 1.7 * padding)); + wWidth *= opt.WS_PREVIEW_SCALE; + wHeight *= opt.WS_PREVIEW_SCALE; + + let wsbY; + let offset = Math.round((height - thumbnailsHeight - wHeight) / 2); + if (opt.WS_TMB_TOP) { + wsbY = thumbnailsHeight + offset; + } else { + wsbY = offset; + } + + const wsbX = Math.round((width - wWidth) / 2); + + workspaceBox.set_origin(wsbX, wsbY); + workspaceBox.set_size(wWidth, wHeight); + break; + } + + return workspaceBox; + }, + + _getThumbnailsHeight: function(box) { + if (!this._thumbnails.visible) + return 0; + + const [width, height] = box.get_size(); + const { expandFraction } = this._thumbnails; + const [thumbnailsHeight] = this._thumbnails.get_preferred_height(width); + return Math.min( + thumbnailsHeight * expandFraction, + height * opt.MAX_THUMBNAIL_SCALE); + }, + + vfunc_allocate: function(box) { + this.set_allocation(box); + + const themeNode = this.get_theme_node(); + const contentBox = themeNode.get_content_box(box); + const [width, height] = contentBox.get_size(); + const { expandFraction } = this._thumbnails; + const spacing = themeNode.get_length('spacing') * expandFraction; + const padding = Math.round(0.1 * height); + + let thumbnailsHeight = this._getThumbnailsHeight(contentBox); + let [, thumbnailsWidth] = this._thumbnails.get_preferred_custom_width(thumbnailsHeight); + thumbnailsWidth = Math.min(thumbnailsWidth, width - 2 * spacing); + + this._thumbnails.visible = opt.SHOW_WS_TMB; + if (this._thumbnails.visible) { + let wsTmbY; + if (opt.SEC_WS_TMB_TOP) { + wsTmbY = Math.round(spacing / 4); + } else { + wsTmbY = Math.round(height - spacing / 4 - thumbnailsHeight); + } + + const childBox = new Clutter.ActorBox(); + const availSpace = width - thumbnailsWidth - 2 * spacing; + + let wsTmbX = availSpace / 2; + wsTmbX -= opt.SEC_WS_TMB_POSITION_ADJUSTMENT * wsTmbX - spacing; + + childBox.set_origin(Math.round(wsTmbX), Math.round(wsTmbY)); + childBox.set_size(thumbnailsWidth, thumbnailsHeight); + this._thumbnails.allocate(childBox); + } + + const { + currentState, initialState, finalState, transitioning, progress, + } = this._overviewAdjustment.getStateTransitionParams(); + + let workspacesBox; + const workspaceParams = [contentBox, padding, thumbnailsHeight, spacing]; + if (!transitioning) { + workspacesBox = + this._getWorkspacesBoxForState(currentState, ...workspaceParams); + } else { + const initialBox = + this._getWorkspacesBoxForState(initialState, ...workspaceParams); + const finalBox = + this._getWorkspacesBoxForState(finalState, ...workspaceParams); + workspacesBox = initialBox.interpolate(finalBox, progress); + } + this._workspacesView.allocate(workspacesBox); + }, + + _updateThumbnailVisibility: SecondaryMonitorDisplayVertical._updateThumbnailVisibility, + + _updateThumbnailParams: function() { + // workaround for upstream bug - secondary thumbnails boxes don't catch 'showing' signal on the shell startup and don't populate the box with thumbnails + // the tmbBox contents is also destroyed when overview state adjustment gets above 1 when swiping gesture from window picker to app grid + if (!this._thumbnails._thumbnails.length) { + this._thumbnails._createThumbnails(); + } + + if (!this._thumbnails.visible) + return; + + const { initialState, finalState, progress } = + this._overviewAdjustment.getStateTransitionParams(); + + const initialParams = this._getThumbnailParamsForState(initialState); + const finalParams = this._getThumbnailParamsForState(finalState); + + /*const opacity = + Util.lerp(initialParams.opacity, finalParams.opacity, progress); + const scale = + Util.lerp(initialParams.scale, finalParams.scale, progress);*/ + + // OVERVIEW_MODE 2 should animate dash and wsTmbBox only if WORKSPACE_MODE === 0 (windows not spread) + const animateOverviewMode2 = opt.OVERVIEW_MODE2 && !(finalState === 1 && opt.WORKSPACE_MODE); + const translation_y = (!Main.layoutManager._startingUp && ((!opt.SHOW_WS_PREVIEW_BG && !(opt.OVERVIEW_MODE2)) || animateOverviewMode2)) + ? Util.lerp(initialParams.translation_y, finalParams.translation_y, progress) + : 0; + + this._thumbnails.set({ + opacity: 255, + //scale_x: scale, + //scale_y: scale, + translation_y, + }); + }, + + _updateWorkspacesView: function() { + if (this._workspacesView) + this._workspacesView.destroy(); + + if (this._settings.get_boolean('workspaces-only-on-primary')) { + this._workspacesView = new WorkspacesView.ExtraWorkspaceView( + this._monitorIndex, + this._overviewAdjustment); + } else { + this._workspacesView = new WorkspacesView.WorkspacesView( + this._monitorIndex, + this._controls, + this._scrollAdjustment, + // Secondary monitors don't need FitMode.ALL since there is workspace switcher always visible + //this._fitModeAdjustment, + new St.Adjustment({ + actor: this, + value: 0,//FitMode.SINGLE, + lower: 0,//FitMode.SINGLE, + upper: 0,//FitMode.SINGLE, + }), + //secondaryOverviewAdjustment); + this._overviewAdjustment); + } + this.add_child(this._workspacesView); + this._thumbnails.opacity = 0; + } +} + +var WorkspacesDisplay = { + _updateWorkspacesViews: function() { + for (let i = 0; i < this._workspacesViews.length; i++) + this._workspacesViews[i].destroy(); + + this._primaryIndex = Main.layoutManager.primaryIndex; + this._workspacesViews = []; + let monitors = Main.layoutManager.monitors; + for (let i = 0; i < monitors.length; i++) { + let view; + if (i === this._primaryIndex) { + view = new WorkspacesView.WorkspacesView(i, + this._controls, + this._scrollAdjustment, + this._fitModeAdjustment, + this._overviewAdjustment); + + view.visible = this._primaryVisible; + this.bind_property('opacity', view, 'opacity', GObject.BindingFlags.SYNC_CREATE); + this.add_child(view); + } else { + view = new WorkspacesView.SecondaryMonitorDisplay(i, + this._controls, + this._scrollAdjustment, + // Secondary monitors don't need FitMode.ALL since there is workspace switcher always visible + //this._fitModeAdjustment, + new St.Adjustment({ + actor: this, + value: 0,//FitMode.SINGLE, + lower: 0,//FitMode.SINGLE, + upper: 0,//FitMode.SINGLE, + }), + this._overviewAdjustment); + Main.layoutManager.overviewGroup.add_actor(view); + } + + this._workspacesViews.push(view); + } + }, + + _onScrollEvent: function(actor, event) { + if (this._swipeTracker.canHandleScrollEvent(event)) + return Clutter.EVENT_PROPAGATE; + + if (!this.mapped) + return Clutter.EVENT_PROPAGATE; + + if (this._workspacesOnlyOnPrimary && + this._getMonitorIndexForEvent(event) != this._primaryIndex) + return Clutter.EVENT_PROPAGATE; + + const isShiftPressed = (event.get_state() & Clutter.ModifierType.SHIFT_MASK) != 0; + /*const isCtrlPressed = (event.get_state() & Clutter.ModifierType.CONTROL_MASK) != 0; + const isAltPressed = (event.get_state() & Clutter.ModifierType.MOD1_MASK) != 0; + const noModifiersPressed = !(isCtrlPressed && isShiftPressed && isAltPressed); + + if (OVERVIEW_MODE2 && noModifiersPressed) { + Main.overview.hide(); + return Clutter.EVENT_STOP; + }*/ + + let direction = event.get_scroll_direction(); + + if (/*SHIFT_REORDERS_WS && */isShiftPressed) { + if (direction === Clutter.ScrollDirection.UP) { + direction = -1; + } + else if (direction === Clutter.ScrollDirection.DOWN) { + direction = 1; + } else { + direction = 0; + } + + if (direction) { + _reorderWorkspace(direction); + // make all workspaces on primary monitor visible for case the new position is hidden + Main.overview._overview._controls._workspacesDisplay._workspacesViews[0]._workspaces.forEach(w => w.visible = true); + return Clutter.EVENT_STOP; + } + } + + return Main.wm.handleWorkspaceScroll(event); + }, + + _onKeyPressEvent: function(actor, event) { + const symbol = event.get_key_symbol(); + /*const { ControlsState } = OverviewControls; + if (this._overviewAdjustment.value !== ControlsState.WINDOW_PICKER && symbol !== Clutter.KEY_space) + return Clutter.EVENT_PROPAGATE;*/ + + /*if (!this.reactive) + return Clutter.EVENT_PROPAGATE;**/ + const isCtrlPressed = (event.get_state() & Clutter.ModifierType.CONTROL_MASK) != 0; + const isShiftPressed = (event.get_state() & Clutter.ModifierType.SHIFT_MASK) != 0; + const isAltPressed = (event.get_state() & Clutter.ModifierType.MOD1_MASK) != 0; + const { workspaceManager } = global; + const vertical = workspaceManager.layout_rows === -1; + const rtl = this.get_text_direction() === Clutter.TextDirection.RTL; + + let which; + switch (symbol) { + /*case Clutter.KEY_Return:*/ + case Clutter.KEY_Page_Up: + if (vertical) + which = Meta.MotionDirection.UP; + else if (rtl) + which = Meta.MotionDirection.RIGHT; + else + which = Meta.MotionDirection.LEFT; + break; + case Clutter.KEY_Page_Down: + if (vertical) + which = Meta.MotionDirection.DOWN; + else if (rtl) + which = Meta.MotionDirection.LEFT; + else + which = Meta.MotionDirection.RIGHT; + break; + case Clutter.KEY_Home: + which = 0; + break; + case Clutter.KEY_End: + which = workspaceManager.n_workspaces - 1; + break; + case Clutter.KEY_space: + if (isCtrlPressed && isShiftPressed) { + _Util.openPreferences(); + } else if (isAltPressed) { + Main.ctrlAltTabManager._items.forEach(i => {if (i.sortGroup === 1 && i.name === 'Dash') Main.ctrlAltTabManager.focusGroup(i)}); + } else if (opt.RECENT_FILES_SEARCH_PROVIDER_ENABLED && isCtrlPressed) { + _Util.activateSearchProvider(SEARCH_RECENT_FILES_PREFIX); + } else if (opt.WINDOW_SEARCH_PROVIDER_ENABLED/* && SEARCH_WINDOWS_SPACE*/) { + _Util.activateSearchProvider(SEARCH_WINDOWS_PREFIX); + } + return Clutter.EVENT_STOP; + case Clutter.KEY_Down: + case Clutter.KEY_Left: + case Clutter.KEY_Right: + case Clutter.KEY_Up: + if (Main.overview._overview._controls._searchController.searchActive) { + Main.overview.searchEntry.grab_key_focus(); + } else /*if (OVERVIEW_MODE && !WORKSPACE_MODE)*/ { + Main.ctrlAltTabManager._items.forEach(i => {if (i.sortGroup === 1 && i.name === 'Dash') Main.ctrlAltTabManager.focusGroup(i)}); + } + return Clutter.EVENT_STOP; + default: + return Clutter.EVENT_PROPAGATE; + } + + let ws; + if (which < 0) + // Negative workspace numbers are directions + ws = workspaceManager.get_active_workspace().get_neighbor(which); + else + // Otherwise it is a workspace index + ws = workspaceManager.get_workspace_by_index(which); + + if (/*SHIFT_REORDERS_WS && */isShiftPressed) { + let direction; + if (which === Meta.MotionDirection.UP || which === Meta.MotionDirection.LEFT) + direction = -1; + else if (which === Meta.MotionDirection.DOWN || which === Meta.MotionDirection.RIGHT) + direction = 1; + if (direction) + _reorderWorkspace(direction); + // make all workspaces on primary monitor visible for case the new position is hidden + Main.overview._overview._controls._workspacesDisplay._workspacesViews[0]._workspaces.forEach(w => w.visible = true); + return Clutter.EVENT_STOP; + } + + if (ws) + Main.wm.actionMoveWorkspace(ws); + + return Clutter.EVENT_STOP; + }, +} + +// same copy of this function should be available in OverviewControls and WorkspacesView +function _getFitModeForState(state) { + switch (state) { + case ControlsState.HIDDEN: + case ControlsState.WINDOW_PICKER: + return FitMode.SINGLE; + case ControlsState.APP_GRID: + if (opt.WS_ANIMATION && opt.SHOW_WS_TMB) + return FitMode.ALL; + else + return FitMode.SINGLE; + default: + return FitMode.SINGLE; + } +} + +// ------------------ Reorder Workspaces - callback for Dash and workspacesDisplay ----------------------------------- + +function _reorderWorkspace(direction = 0) { + let activeWs = global.workspace_manager.get_active_workspace(); + let activeWsIdx = activeWs.index(); + let targetIdx = activeWsIdx + direction; + if (targetIdx > -1 && targetIdx < (global.workspace_manager.get_n_workspaces())) { + global.workspace_manager.reorder_workspace(activeWs, targetIdx); + } +} diff --git a/hibernate-status/.gitignore b/hibernate-status/.gitignore deleted file mode 100644 index 68270f9..0000000 --- a/hibernate-status/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -**/*.compiled -*.zip -.~ -*~ -*.mo -locale/hibernate-status-button.pot diff --git a/hibernate-status/LICENSE b/hibernate-status/LICENSE deleted file mode 100644 index d6a9326..0000000 --- a/hibernate-status/LICENSE +++ /dev/null @@ -1,340 +0,0 @@ -GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - {description} - Copyright (C) {year} {fullname} - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - {signature of Ty Coon}, 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. - diff --git a/hibernate-status/Makefile b/hibernate-status/Makefile deleted file mode 100644 index 3378024..0000000 --- a/hibernate-status/Makefile +++ /dev/null @@ -1,77 +0,0 @@ -# Basic Makefile - -UUID = hibernate-status@dromi -BASE_MODULES = extension.js metadata.json confirmDialog.js LICENSE README.md -EXTRA_MODULES = prefs.js -TOLOCALIZE = confirmDialog.js prefs.js -PO_FILES := $(wildcard ./locale/*/*/*.po) -MO_FILES := $(PO_FILES:.po=.mo) - -ifeq ($(strip $(DESTDIR)),) - INSTALLTYPE = local - INSTALLBASE = $(HOME)/.local/share/gnome-shell/extensions -else - INSTALLTYPE = system - SHARE_PREFIX = $(DESTDIR)/usr/share - INSTALLBASE = $(SHARE_PREFIX)/gnome-shell/extensions -endif -INSTALLNAME = hibernate-status@dromi - -all: extension - -clean: - rm -f ./schemas/gschemas.compiled - rm -f ./**/*~ - rm -f ./locale/*/*/*.mo - rm -f ./locale/hibernate-status-button.pot - -extension: ./schemas/gschemas.compiled $(MO_FILES) - -./schemas/gschemas.compiled: ./schemas/org.gnome.shell.extensions.hibernate-status-button.gschema.xml - glib-compile-schemas ./schemas/ - -potfile: ./locale/hibernate-status-button.pot - -mergepo: potfile - for l in $(PO_FILES); do \ - msgmerge -U $$l ./locale/hibernate-status-button.pot; \ - done; - -./locale/hibernate-status-button.pot: $(TOLOCALIZE) - mkdir -p locale - xgettext -k --keyword=__ --keyword=N__ --add-comments='Translators:' -o locale/hibernate-status-button.pot --package-name "Hibernate Status Button" $(TOLOCALIZE) - -%.mo: %.po - msgfmt -c $< -o $@ - -install: install-local - -install-local: _build - rm -rf $(INSTALLBASE)/$(INSTALLNAME) - mkdir -p $(INSTALLBASE)/$(INSTALLNAME) - cp -r ./_build/* $(INSTALLBASE)/$(INSTALLNAME)/ -ifeq ($(INSTALLTYPE),system) - # system-wide settings and locale files - # rm -r $(INSTALLBASE)/$(INSTALLNAME)/schemas - rm -f $(INSTALLBASE)/$(INSTALLNAME)/schemas/*gschema.xml - rm -r $(INSTALLBASE)/$(INSTALLNAME)/locale - mkdir -p $(SHARE_PREFIX)/glib-2.0/schemas $(SHARE_PREFIX)/locale - cp -r ./schemas/*gschema.* $(SHARE_PREFIX)/glib-2.0/schemas - cp -r ./_build/locale/* $(SHARE_PREFIX)/locale -endif - -rm -fR _build - echo done - -zip-file: _build - cd _build ; zip -qr "$(UUID).zip" . -x '*.po' - mv _build/$(UUID).zip ./ - -rm -fR _build - -_build: all - -rm -fR ./_build - mkdir -p _build - cp $(BASE_MODULES) $(EXTRA_MODULES) _build - mkdir -p _build/schemas - cp schemas/*.xml _build/schemas/ - cp schemas/gschemas.compiled _build/schemas/ - cp -r locale/ _build/locale diff --git a/hibernate-status/README.md b/hibernate-status/README.md deleted file mode 100644 index ff88abd..0000000 --- a/hibernate-status/README.md +++ /dev/null @@ -1,41 +0,0 @@ -# gnome-shell-extension-hibernate-status - -Gnome Shell extension that adds a hibernate/hybrid suspend button in Status menu. - -Originally developed by [@arelange](https://github.com/arelange); now maintained by [@p91paul](https://github.com/p91paul). - -Supports GNOME 3.36. - -## FAQ - -### Hibernation does not work - -Try launching from your terminal - - systemctl hibernate - -If it doesn't work, it means hibernation is disabled on your system. Please see: - -https://askubuntu.com/questions/1034185/ubuntu-18-04-cant-resume-after-hibernate/1064114#1064114 - -or - -https://help.ubuntu.com/16.04/ubuntu-help/power-hibernate.html - -### Hibernation button does not show up, but systemctl hibernate works - -If you are running Ubuntu, try putting - - [Enable hibernate in upower] - Identity=unix-user:* - Action=org.freedesktop.upower.hibernate - ResultActive=yes - - [Enable hibernate in logind] - Identity=unix-user:* - Action=org.freedesktop.login1.hibernate;org.freedesktop.login1.handle-hibernate-key;org.freedesktop.login1;org.freedesktop.login1.hibernate-multiple-sessions;org.freedesktop.login1.hibernate-ignore-inhibit - ResultActive=yes - -into /etc/polkit-1/localauthority/10-vendor.d/com.ubuntu.desktop.pkla - -Otherwise check for similar settings for your distribution. Credit: https://github.com/arelange/gnome-shell-extension-hibernate-status/issues/41#issuecomment-565883599 diff --git a/hibernate-status/buildforupload.sh b/hibernate-status/buildforupload.sh deleted file mode 100755 index d2c705c..0000000 --- a/hibernate-status/buildforupload.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -make zip-file diff --git a/hibernate-status/confirmDialog.js b/hibernate-status/confirmDialog.js deleted file mode 100644 index 62069e2..0000000 --- a/hibernate-status/confirmDialog.js +++ /dev/null @@ -1,193 +0,0 @@ -const Gio = imports.gi.Gio; -const GLib = imports.gi.GLib; -const GObject = imports.gi.GObject; -const Mainloop = imports.mainloop; - -const LoginManager = imports.misc.loginManager; -const Main = imports.ui.main; -const StatusSystem = imports.ui.status.system; -const PopupMenu = imports.ui.popupMenu; -const ModalDialog = imports.ui.modalDialog; -const CheckBox = imports.ui.checkBox.CheckBox; -const St = imports.gi.St; -const Clutter = imports.gi.Clutter; -const ExtensionUtils = imports.misc.extensionUtils; - -// Use __ () and N__() for the extension gettext domain, and reuse -// the shell domain with the default _() and N_() -const Gettext = imports.gettext.domain('hibernate-status-button'); -const __ = Gettext.gettext; -const N__ = function(e) { return e }; - -ExtensionUtils.initTranslations('hibernate-status-button'); - -var HibernateDialogContent = { - subject: C_("title", __("Hibernate")), - description: __("Do you really want to hibernate the system?"), - confirmButtons: [{ - signal: 'Cancel', - label: C_("button", __("Cancel")), - key: Clutter.Escape - }, - { - signal: 'ConfirmedHibernate', - label: C_("button", __("Hibernate")), - default: true - }], - iconName: 'document-save-symbolic', - iconStyleClass: 'end-session-dialog-shutdown-icon', -}; - -var SystemdMissingDialogContent = { - subject: C_("title", __("Hibernate button: Systemd Missing")), - description: __("Systemd seems to be missing and is required."), - confirmButtons: [{ - signal: 'Cancel', - label: C_("button", __("Cancel")), - key: Clutter.Escape - }, - { - signal: 'DisableExtension', - label: C_("button", __("Disable Extension")), - default: true - }], - iconName: 'document-save-symbolic', - iconStyleClass: 'end-session-dialog-shutdown-icon', -}; - - -var HibernateFailedDialogContent = { - subject: C_("title", __("Hibernate button: Hibernate failed")), - description: __("Looks like hibernation failed.\n" + - "On some linux distributions hibernation is disabled\n" + - "because not all hardware supports it well;\n" + - "please check your distribution documentation\n" + - "on how to enable it."), - checkBox: __("You are wrong, don't check this anymore!"), - confirmButtons: [{ - signal: 'Cancel', - label: C_("button", __("Cancel")), - key: Clutter.Escape - }, - { - signal: 'DisableExtension', - label: C_("button", __("Disable Extension")), - default: true - }], - iconName: 'document-save-symbolic', - iconStyleClass: 'end-session-dialog-shutdown-icon', -}; - -const _DIALOG_ICON_SIZE = 32; - -function _setLabelText(label, text) { - if (text) { - label.set_text(text); - label.show(); - } else { - label.set_text(''); - label.hide(); - } -} - -var ConfirmDialog = GObject.registerClass({ - Signals: { 'ConfirmedHibernate': { param_types: [ GObject.TYPE_BOOLEAN ] }, - 'DisableExtension': { param_types: [ GObject.TYPE_BOOLEAN ] }, - 'Cancel': { param_types: [ GObject.TYPE_BOOLEAN ] } } -}, -class ConfirmDialog extends ModalDialog.ModalDialog { - _init(dialog) { - super._init({ - styleClass: 'end-session-dialog', - destroyOnClose: true - }); - - let mainContentLayout = new St.BoxLayout({ - vertical: false, - x_expand: true , - y_expand: false - }); - this.contentLayout.add(mainContentLayout); - - this._iconBin = new St.Bin({ - x_expand: true, - y_expand: false, - x_align: St.Align.END, - y_align: St.Align.START - }); - mainContentLayout.add(this._iconBin); - - let messageLayout = new St.BoxLayout({ - vertical: true, - y_align: St.Align.START - }); - mainContentLayout.add(messageLayout); - - this._subjectLabel = new St.Label({ - style_class: 'end-session-dialog-subject', - y_expand: false, - y_align: St.Align.START - }); - - messageLayout.add(this._subjectLabel); - - this._descriptionLabel = new St.Label({ - style_class: 'end-session-dialog-description', - y_expand: true, - y_align: St.Align.START - }); - - messageLayout.add(this._descriptionLabel); - - // fill dialog - - _setLabelText(this._descriptionLabel, dialog.description); - _setLabelText(this._subjectLabel, dialog.subject); - - if (dialog.iconName) { - this._iconBin.child = new St.Icon({ - icon_name: dialog.iconName, - icon_size: _DIALOG_ICON_SIZE, - style_class: dialog.iconStyleClass - }); - } - - if (dialog.checkBox) { - this._checkBox = new CheckBox(dialog.checkBox); - mainContentLayout.add(this._checkBox.actor); - } - - let buttons = []; - for (let i = 0; i < dialog.confirmButtons.length; i++) { - let signal = dialog.confirmButtons[i].signal; - let label = dialog.confirmButtons[i].label; - let keys = dialog.confirmButtons[i].key; - buttons.push({ - action: () => { - this.close(); - let signalId = this.connect('closed', - () => { - this.disconnect(signalId); - this._confirm(signal); - }); - }, - label: label, - key: keys - }); - }; - - this.setButtons(buttons); - - } - - _confirm(signal) { - var checked; - if (this._checkBox) - checked = this._checkBox.actor.get_checked() - this.emit(signal, checked); - } - - cancel() { - this.close(); - } -}); diff --git a/hibernate-status/extension.js b/hibernate-status/extension.js deleted file mode 100644 index 6e0b248..0000000 --- a/hibernate-status/extension.js +++ /dev/null @@ -1,248 +0,0 @@ -const Gio = imports.gi.Gio; -const GLib = imports.gi.GLib; -const Mainloop = imports.mainloop; - -const ExtensionUtils = imports.misc.extensionUtils; -const LoginManager = imports.misc.loginManager; -const Main = imports.ui.main; -const StatusSystem = imports.ui.status.system; -const PopupMenu = imports.ui.popupMenu; -const Me = imports.misc.extensionUtils.getCurrentExtension(); -const ExtensionSystem = imports.ui.extensionSystem; -const ConfirmDialog = Me.imports.confirmDialog; -const Prefs = new Me.imports.prefs.Prefs(); - - -// Use __ () and N__() for the extension gettext domain, and reuse -// the shell domain with the default _() and N_() -const Gettext = imports.gettext.domain('hibernate-status-button'); -const __ = Gettext.gettext; -const N__ = function(e) { return e }; -ExtensionUtils.initTranslations('hibernate-status-button'); - -const HIBERNATE_CHECK_TIMEOUT = 20000; - -class Extension { - _loginManagerCanHibernate(asyncCallback) { - if (this._loginManager._proxy) { - // systemd path - this._loginManager._proxy.call("CanHibernate", - null, - Gio.DBusCallFlags.NONE, - -1, null, function (proxy, asyncResult) { - let result, error; - - try { - result = proxy.call_finish(asyncResult).deep_unpack(); - } catch (e) { - error = e; - } - - if (error) - asyncCallback(false); - else - asyncCallback(result[0] != 'no'); - }); - } else { - Mainloop.idle_add(() => { - asyncCallback(false); - return false; - }); - } - } - - _loginManagerHibernate() { - if (Prefs.getHibernateWorksCheckEnabled()) { - this._hibernateStarted = new Date(); - GLib.timeout_add(GLib.PRIORITY_DEFAULT, HIBERNATE_CHECK_TIMEOUT, - () => this._checkDidHibernate()); - } - if (this._loginManager._proxy) { - // systemd path - this._loginManager._proxy.call("Hibernate", - GLib.Variant.new('(b)', [true]), - Gio.DBusCallFlags.NONE, - -1, null, null); - } else { - // Can't do in ConsoleKit - this._loginManager.emit('prepare-for-sleep', true); - this._loginManager.emit('prepare-for-sleep', false); - } - } - - _loginManagerCanHybridSleep(asyncCallback) { - if (this._loginManager._proxy) { - // systemd path - this._loginManager._proxy.call("CanHybridSleep", - null, - Gio.DBusCallFlags.NONE, - -1, null, function (proxy, asyncResult) { - let result, error; - - try { - result = proxy.call_finish(asyncResult).deep_unpack(); - } catch (e) { - error = e; - } - - if (error) - asyncCallback(false); - else - asyncCallback(result[0] != 'no'); - }); - } else { - Mainloop.idle_add(() => { - asyncCallback(false); - return false; - }); - } - } - - _loginManagerHybridSleep() { - if (this._loginManager._proxy) { - // systemd path - this._loginManager._proxy.call("HybridSleep", - GLib.Variant.new('(b)', [true]), - Gio.DBusCallFlags.NONE, - -1, null, null); - } else { - // Can't do in ConsoleKit - this._loginManager.emit('prepare-for-sleep', true); - this._loginManager.emit('prepare-for-sleep', false); - } - } - _updateHaveHibernate() { - this._loginManagerCanHibernate((result) => { - log(`have hibernate ${result}`); - this._haveHibernate = result; - this._updateHibernate(); - }); - } - - _updateHibernate() { - this._hibernateMenuItem.visible = this._haveHibernate && !Main.sessionMode.isLocked; - } - - _updateHaveHybridSleep() { - this._loginManagerCanHybridSleep((result) => { - this._haveHybridSleep = result; - this._updateHybridSleep(); - }); - } - - _updateHybridSleep() { - this._hybridSleepMenuItem.visible = this._haveHybridSleep && !Main.sessionMode.isLocked; - } - - _onHibernateClicked() { - this.systemMenu._systemItem.menu.itemActivated(); - this._dialog = new ConfirmDialog.ConfirmDialog(ConfirmDialog.HibernateDialogContent); - this._dialog.connect('ConfirmedHibernate', () => this._loginManagerHibernate()); - this._dialog.open(); - } - - _onHybridSleepClicked() { - this.systemMenu._systemItem.menu.itemActivated(); - this._loginManagerHybridSleep(); - } - - _disableExtension() { - let enabledExtensions = global.settings.get_strv(ExtensionSystem.ENABLED_EXTENSIONS_KEY); - enabledExtensions.splice(enabledExtensions.indexOf(Me.uuid), 1); - global.settings.set_strv(ExtensionSystem.ENABLED_EXTENSIONS_KEY, enabledExtensions); - } - - _cancelDisableExtension(notAgain) { - if (notAgain) - Prefs.setHibernateWorksCheckEnabled(false); - } - - _checkRequirements() { - if (!LoginManager.haveSystemd()) { - this._dialog = new ConfirmDialog.ConfirmDialog(ConfirmDialog.SystemdMissingDialogContent); - this._dialog.connect('DisableExtension', this._disableExtension); - this._dialog.open(); - } - } - - _checkDidHibernate() { - /* This function is called HIBERNATE_CHECK_TIMEOUT ms after - * hibernate started. If it is successful, at that point the GS - * process is already frozen; so when this function is actually - * called, way more than HIBERNATE_CHECK_TIMEOUT ms are passed*/ - if (new Date() - this._hibernateStarted > HIBERNATE_CHECK_TIMEOUT + 5000) { - // hibernate succeeded - return; - } - // hibernate failed - this._dialog = new ConfirmDialog.ConfirmDialog(ConfirmDialog.HibernateFailedDialogContent); - this._dialog.connect('DisableExtension', this._disableExtension); - this._dialog.connect('Cancel', this._cancelDisableExtension); - this._dialog.open(); - } - - enable() { - this._checkRequirements(); - this._loginManager = LoginManager.getLoginManager(); - this.systemMenu = Main.panel.statusArea.quickSettings._system; - - this._hibernateMenuItem = new PopupMenu.PopupMenuItem(__('Hibernate')); - this._hibernateMenuItemId = this._hibernateMenuItem.connect('activate', () => this._onHibernateClicked()); - - this._hybridSleepMenuItem = new PopupMenu.PopupMenuItem(__('Hybrid Sleep')); - this._hybridSleepMenuItemId = this._hybridSleepMenuItem.connect('activate', () => this._onHybridSleepClicked()); - - let afterSuspendPosition = this.systemMenu._systemItem.menu.numMenuItems - 5; - - this.systemMenu._systemItem.menu.addMenuItem(this._hybridSleepMenuItem, afterSuspendPosition); - this.systemMenu._systemItem.menu.addMenuItem(this._hibernateMenuItem, afterSuspendPosition); - - this._menuOpenStateChangedId = this.systemMenu._systemItem.menu.connect('open-state-changed', - (menu, open) => { - if (!open) - return; - this._updateHaveHibernate(); - this._updateHaveHybridSleep(); - }); - } - - disable() { - if (this._menuOpenStateChangedId) { - this.systemMenu._systemItem.menu.disconnect(this._menuOpenStateChangedId); - this._menuOpenStateChangedId = 0; - } - - if (this._hybridSleepMenuItemId) { - this._hybridSleepMenuItem.disconnect(this._hybridSleepMenuItemId); - this._hybridSleepMenuItemId = 0; - } - - if (this._hibernateMenuItemId) { - this._hibernateMenuItem.disconnect(this._hibernateMenuItemId); - this._hibernateMenuItemId = 0; - } - - if (this._hybridSleepMenuItem) { - this._hybridSleepMenuItem.destroy(); - this._hybridSleepMenuItem = 0; - } - - if (this._hibernateMenuItem) { - this._hibernateMenuItem.destroy(); - this._hibernateMenuItem = 0; - } - } -} - -let extension; -function init() { - extension = new Extension(); -} - -function enable() { - extension.enable(); -} - -function disable() { - extension.disable(); -} diff --git a/hibernate-status/locale/cs/LC_MESSAGES/hibernate-status-button.po b/hibernate-status/locale/cs/LC_MESSAGES/hibernate-status-button.po deleted file mode 100644 index 32e541d..0000000 --- a/hibernate-status/locale/cs/LC_MESSAGES/hibernate-status-button.po +++ /dev/null @@ -1,66 +0,0 @@ -# Czech translation of hibernate-status-button -# Copyright (C) 2021 Vojtěch Perník -# This file is distributed under the same license as the hibernate-status-button package. -# Vojtěch Perník , 2021. -# -msgid "" -msgstr "" -"Project-Id-Version: Hibernate Status Button\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-04-11 18:31+0200\n" -"PO-Revision-Date: 2021-05-06 16:15+0200\n" -"Last-Translator: Vojtěch Perník \n" -"Language-Team: Czech\n" -"Language: cs\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" - -#: confirmDialog.js:23 confirmDialog.js:32 -msgid "Hibernate" -msgstr "Uspat na disk" - -#: confirmDialog.js:24 -msgid "Do you really want to hibernate the system?" -msgstr "Opravdu chcete systém uspat na disk?" - -#: confirmDialog.js:27 confirmDialog.js:44 confirmDialog.js:67 -msgid "Cancel" -msgstr "Zrušit" - -#: confirmDialog.js:40 -msgid "Hibernate button: Systemd Missing" -msgstr "Hibernate button: Systemd není nainstalován" - -#: confirmDialog.js:41 -msgid "Systemd seems to be missing and is required." -msgstr "Zdá se, že Systemd není nainstalován, ale je vyžadován." - -#: confirmDialog.js:49 confirmDialog.js:72 -msgid "Disable Extension" -msgstr "Zakázat rozšíření" - -#: confirmDialog.js:58 -msgid "Hibernate button: Hibernate failed" -msgstr "Hibernate button: Uspání na disk se nezdařilo" - -#: confirmDialog.js:59 -msgid "" -"Looks like hibernation failed.\n" -"On some linux distributions hibernation is disabled\n" -"because not all hardware supports it well;\n" -"please check your distribution documentation\n" -"on how to enable it." -msgstr "" -"Vypadá to, že se uspání na disk nezdařilo.\n" -"U některých linuxových distribucí je uspání na disk\n" -"zakázáno, protože ne všechny hardware ho podporují,\n" -"podívejte se prosím do dokumentace své distribuce, jak ji povolit." - -#: confirmDialog.js:64 -msgid "You are wrong, don't check this anymore!" -msgstr "Mýlíte se, už to nekontrolujte!" - -#: prefs.js:99 -msgid "This extension has no settings available" -msgstr "Toto rozšíření nemá k dispozici žádná nastavení" diff --git a/hibernate-status/locale/de/LC_MESSAGES/hibernate-status-button.po b/hibernate-status/locale/de/LC_MESSAGES/hibernate-status-button.po deleted file mode 100644 index 3fdb8c2..0000000 --- a/hibernate-status/locale/de/LC_MESSAGES/hibernate-status-button.po +++ /dev/null @@ -1,72 +0,0 @@ -# German translation of hibernate-status-button -# Copyright (C) 2022 Oskar Kirmis -# This file is distributed under the same license as the hibernate-status-button package. -# Oskar Kirmis , 2022. -# -msgid "" -msgstr "" -"Project-Id-Version: Hibernate Status Button\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-03-28 21:00+0200\n" -"PO-Revision-Date: 2022-10-22 21:30+0200\n" -"Last-Translator: Oskar Kirmis \n" -"Language-Team: German\n" -"Language: de\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Generator: Poedit 3.0.1\n" - -#: confirmDialog.js:23 confirmDialog.js:32 -msgid "Hibernate" -msgstr "Ruhezustand" - -#: extension.js:192 -msgid "Hybrid Sleep" -msgstr "Hybrider Standbymodus" - -#: confirmDialog.js:24 -msgid "Do you really want to hibernate the system?" -msgstr "Wollen Sie das System wirklich in den Ruhezustand versetzen?" - -#: confirmDialog.js:27 confirmDialog.js:44 confirmDialog.js:67 -msgid "Cancel" -msgstr "Abbrechen" - -#: confirmDialog.js:40 -msgid "Hibernate button: Systemd Missing" -msgstr "Hibernate button: Systemd fehlt" - -#: confirmDialog.js:41 -msgid "Systemd seems to be missing and is required." -msgstr "Systemd fehlt offenbar, wird jedoch benötigt." - -#: confirmDialog.js:49 confirmDialog.js:72 -msgid "Disable Extension" -msgstr "Erweiterung deaktivieren" - -#: confirmDialog.js:58 -msgid "Hibernate button: Hibernate failed" -msgstr "Hibernate button: Versetzen in den Ruhezustand fehlgeschlagen" - -#: confirmDialog.js:59 -msgid "" -"Looks like hibernation failed.\n" -"On some linux distributions hibernation is disabled\n" -"because not all hardware supports it well;\n" -"please check your distribution documentation\n" -"on how to enable it." -msgstr "" -"Offenbar konnte das System nicht in den Ruhezustand versetzt werden.\n" -"Auf manchen Linuxdistributionen ist der Ruhezustand deaktiviert\n" -"weil nicht jegliche Hardware dies unterstützt;\n" -"bitte schauen Sie in der Dokumentation Ihrer\n" -"Distribution nach, wie Sie ihn aktivieren können." - -#: confirmDialog.js:64 -msgid "You are wrong, don't check this anymore!" -msgstr "Das ist falsch, bitte nicht mehr prüfen!" - -#: prefs.js:99 -msgid "This extension has no settings available" -msgstr "Für diese Erweiterung gibt es keine Einstellungen" diff --git a/hibernate-status/locale/es/LC_MESSAGES/hibernate-status-button.po b/hibernate-status/locale/es/LC_MESSAGES/hibernate-status-button.po deleted file mode 100644 index 92c14bc..0000000 --- a/hibernate-status/locale/es/LC_MESSAGES/hibernate-status-button.po +++ /dev/null @@ -1,71 +0,0 @@ -# Spanish translation of hibernate-status-button -# Copyright (C) 2022 slaythrax -# This file is distributed under the same license as the hibernate-status-button package. -# slaythrax , 2022. -# -msgid "" -msgstr "" -"Project-Id-Version: Hibernate Status Button\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-04-11 18:31+0200\n" -"PO-Revision-Date: 2022-10-22 21:30+0200\n" -"Last-Translator: slaythrax \n" -"Language-Team: Spanish \n" -"Language: es\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" - -#: confirmDialog.js:23 confirmDialog.js:32 -msgid "Hibernate" -msgstr "Hibernar" - -#: extension.js:192 -msgid "Hybrid Sleep" -msgstr "Suspensión Híbrida" - -#: confirmDialog.js:24 -msgid "Do you really want to hibernate the system?" -msgstr "Desea hibernar el sistema?" - -#: confirmDialog.js:27 confirmDialog.js:44 confirmDialog.js:67 -msgid "Cancel" -msgstr "Cancelar" - -#: confirmDialog.js:40 -msgid "Hibernate button: Systemd Missing" -msgstr "Systemd no está instalado" - -#: confirmDialog.js:41 -msgid "Systemd seems to be missing and is required." -msgstr "Parece que systemd no está instalado. Systemd es necesario" - -#: confirmDialog.js:49 confirmDialog.js:72 -msgid "Disable Extension" -msgstr "Deshabilitar extensión" - -#: confirmDialog.js:58 -msgid "Hibernate button: Hibernate failed" -msgstr "Hibernación fallida" - -#: confirmDialog.js:59 -msgid "" -"Looks like hibernation failed.\n" -"On some linux distributions hibernation is disabled\n" -"because not all hardware supports it well;\n" -"please check your distribution documentation\n" -"on how to enable it." -msgstr "" -"Parece que la hibernación falló\n" -"En algunas distribuciones de linux la hibernación se encuentra deshabilitada\n" -"pues no todo el hardware no la soporta correctamente;\n" -"verifique la documentación de su distribución\n" -"para habilitarla." - -#: confirmDialog.js:64 -msgid "You are wrong, don't check this anymore!" -msgstr "No es necesario hacer esta verificación de nuevo! " - -#: prefs.js:99 -msgid "This extension has no settings available" -msgstr "Esta extensión no tiene ajustes disponibles" diff --git a/hibernate-status/locale/fa/LC_MESSAGES/hibernate-status-button.po b/hibernate-status/locale/fa/LC_MESSAGES/hibernate-status-button.po deleted file mode 100644 index e4edef0..0000000 --- a/hibernate-status/locale/fa/LC_MESSAGES/hibernate-status-button.po +++ /dev/null @@ -1,72 +0,0 @@ -# Persian translation of hibernate-status-button -# Copyright (C) 2021 MohammadSaleh Kamyab -# This file is distributed under the same license as the hibernate-status-button package. -# MohammadSaleh Kamyab , 2022. -# -msgid "" -msgstr "" -"Project-Id-Version: Hibernate Status Button\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-04-11 18:31+0200\n" -"PO-Revision-Date: 2022-06-21 13:06+0430\n" -"Last-Translator: MohammadSaleh Kamyab \n" -"Language-Team: \n" -"Language: fa\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=2; plural=(n==0 || n==1);\n" -"X-Generator: Poedit 3.1\n" - -#: confirmDialog.js:23 confirmDialog.js:32 -msgid "Hibernate" -msgstr "خواب زمستانی" - -#: extension.js:192 -msgid "Hybrid Sleep" -msgstr "خواب ترکیبی" - -#: confirmDialog.js:24 -msgid "Do you really want to hibernate the system?" -msgstr "آیا مطمئنید که می‌خواهید سامانه را به خواب زمستانی ببرید؟" - -#: confirmDialog.js:27 confirmDialog.js:44 confirmDialog.js:67 -msgid "Cancel" -msgstr "لغو" - -#: confirmDialog.js:40 -msgid "Hibernate button: Systemd Missing" -msgstr "دکمهٔ خواب زمستانی: سیستم‌دی یافت نشد" - -#: confirmDialog.js:41 -msgid "Systemd seems to be missing and is required." -msgstr "به نظر می‌رسد سیستم‌دی که لازم است، وجود ندارد." - -#: confirmDialog.js:49 confirmDialog.js:72 -msgid "Disable Extension" -msgstr "از کار انداختن افزونه" - -#: confirmDialog.js:58 -msgid "Hibernate button: Hibernate failed" -msgstr "دکمهٔ خواب زمستانی: خواب زمستانی شکست خورد" - -#: confirmDialog.js:59 -msgid "" -"Looks like hibernation failed.\n" -"On some linux distributions hibernation is disabled\n" -"because not all hardware supports it well;\n" -"please check your distribution documentation\n" -"on how to enable it." -msgstr "" -"به نظر می‌رسد خواب زمستانی به شکست انجامید.\n" -"در بعضی از توزیع‌های گنو/لینوکسی، خواب زمستانی از کار انداخته شده است؛\n" -"زیرا تمامی سخت‌افزارها به‌خوبی از آن پشتیبانی نمی‌کنند.\n" -"لطفاً مستندات توزیع خود را در مورد چگونگی به کار انداختن آن، بررسی کنید." - -#: confirmDialog.js:64 -msgid "You are wrong, don't check this anymore!" -msgstr "اشتباه می‌کنید، دوباره بررسی نکنید!" - -#: prefs.js:99 -msgid "This extension has no settings available" -msgstr "این افزونه هیچ تنظیماتی ندارد" diff --git a/hibernate-status/locale/fr/LC_MESSAGES/hibernate-status-button.po b/hibernate-status/locale/fr/LC_MESSAGES/hibernate-status-button.po deleted file mode 100644 index 9dca80d..0000000 --- a/hibernate-status/locale/fr/LC_MESSAGES/hibernate-status-button.po +++ /dev/null @@ -1,71 +0,0 @@ -# French translation of hibernate-status-button -# Copyright (C) 2021 Jérôme de Bretagne -# This file is distributed under the same license as the hibernate-status-button package. -# Jérôme de Bretagne , 2021. -# -msgid "" -msgstr "" -"Project-Id-Version: Hibernate Status Button\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-04-11 18:31+0200\n" -"PO-Revision-Date: 2021-11-13 19:34+0200\n" -"Last-Translator: Jérôme de Bretagne \n" -"Language-Team: French \n" -"Language: fr\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" - -#: extension.js:189 confirmDialog.js:23 confirmDialog.js:32 -msgid "Hibernate" -msgstr "Mettre en veille prolongée" - -#: extension.js:192 -msgid "Hybrid Sleep" -msgstr "Mettre en veille hybride" - -#: confirmDialog.js:24 -msgid "Do you really want to hibernate the system?" -msgstr "Voulez-vous vraiment mettre l'appareil en veille prolongée ?" - -#: confirmDialog.js:27 confirmDialog.js:44 confirmDialog.js:67 -msgid "Cancel" -msgstr "Annuler" - -#: confirmDialog.js:40 -msgid "Hibernate button: Systemd Missing" -msgstr "Extension de mise en veille prolongée : systemd manquant" - -#: confirmDialog.js:41 -msgid "Systemd seems to be missing and is required." -msgstr "systemd ne semble pas installé et est nécessaire." - -#: confirmDialog.js:49 confirmDialog.js:72 -msgid "Disable Extension" -msgstr "Désactiver l'extension" - -#: confirmDialog.js:58 -msgid "Hibernate button: Hibernate failed" -msgstr "Extension de mise en veille prolongée : échec" - -#: confirmDialog.js:59 -msgid "" -"Looks like hibernation failed.\n" -"On some linux distributions hibernation is disabled\n" -"because not all hardware supports it well;\n" -"please check your distribution documentation\n" -"on how to enable it." -msgstr "" -"La mise en veille prolongée a échoué.\n" -"Sur certaines distributions Linux, la mise en veille prolongée est désactivée\n" -"car elle ne fonctionne pas correctement pour quelques appareils;\n" -"Veuillez vous reporter à la documentation de votre distribution\n" -"pour savoir comment l'activer." - -#: confirmDialog.js:64 -msgid "You are wrong, don't check this anymore!" -msgstr "Il n'est pas utile de cocher cette case !" - -#: prefs.js:99 -msgid "This extension has no settings available" -msgstr "Cette extension n'a pas de paramètres" diff --git a/hibernate-status/locale/it/LC_MESSAGES/hibernate-status-button.po b/hibernate-status/locale/it/LC_MESSAGES/hibernate-status-button.po deleted file mode 100644 index a41e5ac..0000000 --- a/hibernate-status/locale/it/LC_MESSAGES/hibernate-status-button.po +++ /dev/null @@ -1,71 +0,0 @@ -# Italian translation of hibernate-status-button -# Copyright (C) 2021 p91paul -# This file is distributed under the same license as the hibernate-status-button package. -# p91paul , 2021. -# -msgid "" -msgstr "" -"Project-Id-Version: Hibernate Status Button\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-04-11 18:31+0200\n" -"PO-Revision-Date: 2022-10-22 21:30+0200\n" -"Last-Translator: p91paul \n" -"Language-Team: Italian \n" -"Language: it\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" - -#: confirmDialog.js:23 confirmDialog.js:32 -msgid "Hibernate" -msgstr "Iberna" - -#: extension.js:192 -msgid "Hybrid Sleep" -msgstr "Sospensione ibrida" - -#: confirmDialog.js:24 -msgid "Do you really want to hibernate the system?" -msgstr "Vuoi davvero ibernare il sistema?" - -#: confirmDialog.js:27 confirmDialog.js:44 confirmDialog.js:67 -msgid "Cancel" -msgstr "Cancella" - -#: confirmDialog.js:40 -msgid "Hibernate button: Systemd Missing" -msgstr "Systemd non installato" - -#: confirmDialog.js:41 -msgid "Systemd seems to be missing and is required." -msgstr "Systemd non è installato ed è necessario" - -#: confirmDialog.js:49 confirmDialog.js:72 -msgid "Disable Extension" -msgstr "Disabilita estensione" - -#: confirmDialog.js:58 -msgid "Hibernate button: Hibernate failed" -msgstr "Ibernazione fallita" - -#: confirmDialog.js:59 -msgid "" -"Looks like hibernation failed.\n" -"On some linux distributions hibernation is disabled\n" -"because not all hardware supports it well;\n" -"please check your distribution documentation\n" -"on how to enable it." -msgstr "" -"Sembra che l'ibernazione sia fallita.\n" -"In alcune distribuzioni Linux l'ibernazione è disabilitata\n" -"perchè non ben supportata da tutte le tipologie di hardware;\n" -"Verifica la documentazione della tua distribuzione\n" -"per abilitarla." - -#: confirmDialog.js:64 -msgid "You are wrong, don't check this anymore!" -msgstr "Ti sbagli, va tutto bene, non fare più questa verifica" - -#: prefs.js:99 -msgid "This extension has no settings available" -msgstr "Questa estensione non ha impostazioni disponibili" diff --git a/hibernate-status/locale/nl/LC_MESSAGES/hibernate-status-button.po b/hibernate-status/locale/nl/LC_MESSAGES/hibernate-status-button.po deleted file mode 100644 index 6853171..0000000 --- a/hibernate-status/locale/nl/LC_MESSAGES/hibernate-status-button.po +++ /dev/null @@ -1,68 +0,0 @@ -# Nederlands translation of hibernate-status-button -# Copyright (C) 2021 tebaranowski -# This file is distributed under the same license as the hibernate-status-button package. -# tebaranowski , 2021. -# -msgid "" -msgstr "" -"Project-Id-Version: Hibernate Status Button\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-04-11 18:31+0200\n" -"PO-Revision-Date: 2021-09-13 17:56+0200\n" -"Last-Translator: Heimen Stoffels \n" -"Language-Team: Dutch \n" -"Language: nl\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : 2);\n" -"X-Generator: Poedit 3.0\n" - -#: confirmDialog.js:23 confirmDialog.js:32 -msgid "Hibernate" -msgstr "Slaapstand" - -#: confirmDialog.js:24 -msgid "Do you really want to hibernate the system?" -msgstr "Weet u zeker dat u het systeem in de slaapstand wilt zetten?" - -#: confirmDialog.js:27 confirmDialog.js:44 confirmDialog.js:67 -msgid "Cancel" -msgstr "Annuleren" - -#: confirmDialog.js:40 -msgid "Hibernate button: Systemd Missing" -msgstr "Slaapstandknop: Systemd ontbreekt" - -#: confirmDialog.js:41 -msgid "Systemd seems to be missing and is required." -msgstr "Systemd is vereist, maar niet aangetroffen." - -#: confirmDialog.js:49 confirmDialog.js:72 -msgid "Disable Extension" -msgstr "Uitbreiding uitschakelen" - -#: confirmDialog.js:58 -msgid "Hibernate button: Hibernate failed" -msgstr "Slaapstandknop: slaapstand mislukt" - -#: confirmDialog.js:59 -msgid "" -"Looks like hibernation failed.\n" -"On some linux distributions hibernation is disabled\n" -"because not all hardware supports it well;\n" -"please check your distribution documentation\n" -"on how to enable it." -msgstr "" -"Het lijkt er op dat de slaapstand niet kan worden ingeschakeld.\n" -"Op sommige distributies is de slaapstand niet beschikbaar.\n" -"Neem de documentatie van uw distributie door om te\n" -"zien of u de slaapstand kunt activeren." - -#: confirmDialog.js:64 -msgid "You are wrong, don't check this anymore!" -msgstr "Dit klopt niet - negeer deze controle!" - -#: prefs.js:99 -msgid "This extension has no settings available" -msgstr "Deze uitbreiding bevat geen voorkeurenscherm" diff --git a/hibernate-status/locale/oc/LC_MESSAGES/hibernate-status-button.po b/hibernate-status/locale/oc/LC_MESSAGES/hibernate-status-button.po deleted file mode 100644 index 25debf8..0000000 --- a/hibernate-status/locale/oc/LC_MESSAGES/hibernate-status-button.po +++ /dev/null @@ -1,71 +0,0 @@ -# Occitan translation of hibernate-status-button -# Copyright (C) 2022 Quentin -# This file is distributed under the same license as the hibernate-status-button package. -# Quentin -# -msgid "" -msgstr "" -"Project-Id-Version: Hibernate Status Button\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-04-11 18:31+0200\n" -"PO-Revision-Date: 2023-01-11 17:19+0200\n" -"Last-Translator: Quentin PAGÈS <>\n" -"Language-Team: Occitan\n" -"Language: oc\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" - -#: extension.js:189 confirmDialog.js:23 confirmDialog.js:32 -msgid "Hibernate" -msgstr "Metre en velha perlongada" - -#: extension.js:192 -msgid "Hybrid Sleep" -msgstr "Metre en velha ibrida" - -#: confirmDialog.js:24 -msgid "Do you really want to hibernate the system?" -msgstr "Volètz vertadièrament metre l'aparelh en velha perlongada ?" - -#: confirmDialog.js:27 confirmDialog.js:44 confirmDialog.js:67 -msgid "Cancel" -msgstr "Anullar" - -#: confirmDialog.js:40 -msgid "Hibernate button: Systemd Missing" -msgstr "Extension de mesa en velha perlongada : systemd mancant" - -#: confirmDialog.js:41 -msgid "Systemd seems to be missing and is required." -msgstr "systemd sembla pas installat e es necessari." - -#: confirmDialog.js:49 confirmDialog.js:72 -msgid "Disable Extension" -msgstr "Desactivar l'extension" - -#: confirmDialog.js:58 -msgid "Hibernate button: Hibernate failed" -msgstr "Extension de mesa en velha perlongada : fracàs" - -#: confirmDialog.js:59 -msgid "" -"Looks like hibernation failed.\n" -"On some linux distributions hibernation is disabled\n" -"because not all hardware supports it well;\n" -"please check your distribution documentation\n" -"on how to enable it." -msgstr "" -"La mesa en velha perlongada a fracassat.\n" -"Amb d'unas distribucions Linux, la mesa en velha perlongada es desactivada\n" -"pr'amor que fonciona pas coma cal amb d'unes aparelhs ;\n" -"Mercés de consultar la documentacion de la distribucion\n" -"per saber cossí l'activar." - -#: confirmDialog.js:64 -msgid "You are wrong, don't check this anymore!" -msgstr "Es pas necessari de marcar aquesta casa !" - -#: prefs.js:99 -msgid "This extension has no settings available" -msgstr "Aquesta extension a pas cap de paramètres" diff --git a/hibernate-status/locale/pl/LC_MESSAGES/hibernate-status-button.po b/hibernate-status/locale/pl/LC_MESSAGES/hibernate-status-button.po deleted file mode 100644 index 57b735c..0000000 --- a/hibernate-status/locale/pl/LC_MESSAGES/hibernate-status-button.po +++ /dev/null @@ -1,71 +0,0 @@ -# Polish translation of hibernate-status-button -# Copyright (C) 2022 tebaranowski -# This file is distributed under the same license as the hibernate-status-button package. -# tebaranowski , 2022. -# -msgid "" -msgstr "" -"Project-Id-Version: Hibernate Status Button\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-04-11 18:31+0200\n" -"PO-Revision-Date: 2022-11-01 20:31+0200\n" -"Last-Translator: tebaranowski \n" -"Language-Team: Polish \n" -"Language: pl\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" - -#: confirmDialog.js:23 confirmDialog.js:32 -msgid "Hibernate" -msgstr "Hibernacja" - -#: extension.js:192 -msgid "Hybrid Sleep" -msgstr "Uśpienie hybrydowe" - -#: confirmDialog.js:24 -msgid "Do you really want to hibernate the system?" -msgstr "Czy na pewno chcesz zahibernować system?" - -#: confirmDialog.js:27 confirmDialog.js:44 confirmDialog.js:67 -msgid "Cancel" -msgstr "Anuluj" - -#: confirmDialog.js:40 -msgid "Hibernate button: Systemd Missing" -msgstr "Nie odnaleziono systemd" - -#: confirmDialog.js:41 -msgid "Systemd seems to be missing and is required." -msgstr "Brak zainstalowanego systemd, wymaganego do hibernacji" - -#: confirmDialog.js:49 confirmDialog.js:72 -msgid "Disable Extension" -msgstr "Wyłącz rozszerzenie" - -#: confirmDialog.js:58 -msgid "Hibernate button: Hibernate failed" -msgstr "Hibernacja nie powiodła się" - -#: confirmDialog.js:59 -msgid "" -"Looks like hibernation failed.\n" -"On some linux distributions hibernation is disabled\n" -"because not all hardware supports it well;\n" -"please check your distribution documentation\n" -"on how to enable it." -msgstr "" -"Wygląda na to, że hibernacja się nie powiodła.\n" -"W niektórych dystrybucjach Linuksa hibernacja jest wyłączona,\n" -"ponieważ nie każdy sprzęt poprawnie ją obsługuje.\n" -"Sprawdź jak ją włączyć w dokumentacji swojej\n" -"dystrybucji." - -#: confirmDialog.js:64 -msgid "You are wrong, don't check this anymore!" -msgstr "Nie sprawdzaj tego ponownie!" - -#: prefs.js:99 -msgid "This extension has no settings available" -msgstr "To rozszerzenie nie posiada możliwości zmiany ustawień" diff --git a/hibernate-status/locale/pt/LC_MESSAGES/hibernate-status-button.po b/hibernate-status/locale/pt/LC_MESSAGES/hibernate-status-button.po deleted file mode 100644 index 143129c..0000000 --- a/hibernate-status/locale/pt/LC_MESSAGES/hibernate-status-button.po +++ /dev/null @@ -1,71 +0,0 @@ -# Portuguese translation of hibernate-status-button -# Copyright (C) 2021 p91paul -# This file is distributed under the same license as the hibernate-status-button package. -# mantonelli , 2021. -# -msgid "" -msgstr "" -"Project-Id-Version: Hibernate Status Button\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-04-11 18:31+0200\n" -"PO-Revision-Date: 2022-10-22 21:30+0200\n" -"Last-Translator: mantonelli \n" -"Language-Team: Portuguese \n" -"Language: it\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" - -#: confirmDialog.js:23 confirmDialog.js:32 -msgid "Hibernate" -msgstr "Hibernar" - -#: extension.js:192 -msgid "Hybrid Sleep" -msgstr "Suspensão Híbrida" - -#: confirmDialog.js:24 -msgid "Do you really want to hibernate the system?" -msgstr "Deseja realmente hibernar o sistema?" - -#: confirmDialog.js:27 confirmDialog.js:44 confirmDialog.js:67 -msgid "Cancel" -msgstr "Cancelar" - -#: confirmDialog.js:40 -msgid "Hibernate button: Systemd Missing" -msgstr "Systemd não está instalado" - -#: confirmDialog.js:41 -msgid "Systemd seems to be missing and is required." -msgstr "Systemd não está instalado e é necessário" - -#: confirmDialog.js:49 confirmDialog.js:72 -msgid "Disable Extension" -msgstr "Desabilitar extensão" - -#: confirmDialog.js:58 -msgid "Hibernate button: Hibernate failed" -msgstr "Hibernação falhou" - -#: confirmDialog.js:59 -msgid "" -"Looks like hibernation failed.\n" -"On some linux distributions hibernation is disabled\n" -"because not all hardware supports it well;\n" -"please check your distribution documentation\n" -"on how to enable it." -msgstr "" -"Parece que a hibernação falhou.\n" -"Em algumas distribuições Linux a hibernação é desabilitada\n" -"já que nem todo hardware oferece suporte adequado à ela;\n" -"Confira a documentação de sua distribuição\n" -"para aprender como habilitá-la." - -#: confirmDialog.js:64 -msgid "You are wrong, don't check this anymore!" -msgstr "Você errou! Não selecione isso novamente!" - -#: prefs.js:99 -msgid "This extension has no settings available" -msgstr "Essa extensão não possui configurações disponíveis" diff --git a/hibernate-status/locale/pt_BR/LC_MESSAGES/hibernate-status-button.po b/hibernate-status/locale/pt_BR/LC_MESSAGES/hibernate-status-button.po deleted file mode 100644 index 326481a..0000000 --- a/hibernate-status/locale/pt_BR/LC_MESSAGES/hibernate-status-button.po +++ /dev/null @@ -1,73 +0,0 @@ -# Portuguese translation of hibernate-status-button -# Copyright (C) 2021 p91paul -# This file is distributed under the same license as the hibernate-status-button package. -# mantonelli , 2021. -# -msgid "" -msgstr "" -"Project-Id-Version: Hibernate Status Button\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-04-11 18:31+0200\n" -"PO-Revision-Date: 2022-10-22 21:30+0200\n" -"Last-Translator: Fabrício Müller \n" -"Language-Team: Brazilian Portuguese \n" -"Language: pt_BR\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=2; plural=(n > 1);\n" -"X-Generator: Poedit 3.0.1\n" - -#: confirmDialog.js:23 confirmDialog.js:32 -msgid "Hibernate" -msgstr "Hibernar" - -#: extension.js:192 -msgid "Hybrid Sleep" -msgstr "Suspensão Híbrida" - -#: confirmDialog.js:24 -msgid "Do you really want to hibernate the system?" -msgstr "Deseja realmente hibernar o sistema?" - -#: confirmDialog.js:27 confirmDialog.js:44 confirmDialog.js:67 -msgid "Cancel" -msgstr "Cancelar" - -#: confirmDialog.js:40 -msgid "Hibernate button: Systemd Missing" -msgstr "Systemd não está instalado" - -#: confirmDialog.js:41 -msgid "Systemd seems to be missing and is required." -msgstr "Systemd não está instalado e é necessário." - -#: confirmDialog.js:49 confirmDialog.js:72 -msgid "Disable Extension" -msgstr "Desabilitar extensão" - -#: confirmDialog.js:58 -msgid "Hibernate button: Hibernate failed" -msgstr "Hibernação falhou" - -#: confirmDialog.js:59 -msgid "" -"Looks like hibernation failed.\n" -"On some linux distributions hibernation is disabled\n" -"because not all hardware supports it well;\n" -"please check your distribution documentation\n" -"on how to enable it." -msgstr "" -"Parece que a hibernação falhou.\n" -"Em algumas distribuições Linux a hibernação é desabilitada\n" -"já que nem todo hardware oferece suporte adequado à ela;\n" -"Confira a documentação de sua distribuição\n" -"para aprender como habilitá-la." - -#: confirmDialog.js:64 -msgid "You are wrong, don't check this anymore!" -msgstr "Você errou! Não selecione isso novamente!" - -#: prefs.js:99 -msgid "This extension has no settings available" -msgstr "Essa extensão não possui configurações disponíveis" diff --git a/hibernate-status/locale/ru/LC_MESSAGES/hibernate-status-button.po b/hibernate-status/locale/ru/LC_MESSAGES/hibernate-status-button.po deleted file mode 100644 index c279315..0000000 --- a/hibernate-status/locale/ru/LC_MESSAGES/hibernate-status-button.po +++ /dev/null @@ -1,74 +0,0 @@ -# Russian translation of hibernate-status-button -# Copyright (C) 2021 Serhii Riznychenko -# This file is distributed under the same license as the hibernate-status-button package. -# Serhii Riznychenko, 2021. -# -msgid "" -msgstr "" -"Project-Id-Version: Hibernate Status Button\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-04-11 18:31+0200\n" -"PO-Revision-Date: 2021-11-11 02:00+0200\n" -"Last-Translator: Serhii Riznychenko\n" -"Language-Team: Russian\n" -"Language: ru\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : 2);\n" -"X-Generator: Poedit 3.0\n" -"X-Poedit-Basepath: .\n" - -#: extension.js:189 confirmDialog.js:23 confirmDialog.js:32 -msgid "Hibernate" -msgstr "Спящий режим" - -#: extension.js:192 -msgid "Hybrid Sleep" -msgstr "Гибридный сон" - -#: confirmDialog.js:24 -msgid "Do you really want to hibernate the system?" -msgstr "Вы действительно хотите перевести систему в спящий режим?" - -#: confirmDialog.js:27 confirmDialog.js:44 confirmDialog.js:67 -msgid "Cancel" -msgstr "Отмена" - -#: confirmDialog.js:40 -msgid "Hibernate button: Systemd Missing" -msgstr "Не обнаружено systemd" - -#: confirmDialog.js:41 -msgid "Systemd seems to be missing and is required." -msgstr "Кажется отсутствует systemd, необходимый для режима сна." - -#: confirmDialog.js:49 confirmDialog.js:72 -msgid "Disable Extension" -msgstr "Отключить расширение" - -#: confirmDialog.js:58 -msgid "Hibernate button: Hibernate failed" -msgstr "Не удалось перевести систему в сон" - -#: confirmDialog.js:59 -msgid "" -"Looks like hibernation failed.\n" -"On some linux distributions hibernation is disabled\n" -"because not all hardware supports it well;\n" -"please check your distribution documentation\n" -"on how to enable it." -msgstr "" -"Попытка перевести систему в сон завершилась неудачей.\n" -"На некоторых дистрибутивах режим сна отключен\n" -"так как не каждое оборудование имеет поддержку,\n" -"пожалуйста обратитесь к документации своего дистрибутива\n" -"чтобы узнать как его включить." - -#: confirmDialog.js:64 -msgid "You are wrong, don't check this anymore!" -msgstr "Вы ошиблись, пожалуйста не трогайте это!" - -#: prefs.js:99 -msgid "This extension has no settings available" -msgstr "Это расширение не содержит параметров" diff --git a/hibernate-status/locale/uk/LC_MESSAGES/hibernate-status-button.po b/hibernate-status/locale/uk/LC_MESSAGES/hibernate-status-button.po deleted file mode 100644 index 68c6b8c..0000000 --- a/hibernate-status/locale/uk/LC_MESSAGES/hibernate-status-button.po +++ /dev/null @@ -1,74 +0,0 @@ -# Ukrainian translation of hibernate-status-button -# Copyright (C) 2021 Serhii Riznychenko -# This file is distributed under the same license as the hibernate-status-button package. -# Serhii Riznychenko, 2021. -# -msgid "" -msgstr "" -"Project-Id-Version: Hibernate Status Button\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-04-11 18:31+0200\n" -"PO-Revision-Date: 2021-11-11 02:00+0200\n" -"Last-Translator: Serhii Riznychenko\n" -"Language-Team: Ukraine\n" -"Language: uk\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : 2);\n" -"X-Generator: Poedit 3.0\n" -"X-Poedit-Basepath: .\n" - -#: extension.js:189 confirmDialog.js:23 confirmDialog.js:32 -msgid "Hibernate" -msgstr "Перейти в сон" - -#: extension.js:192 -msgid "Hybrid Sleep" -msgstr "Перейти в гібридний сон" - -#: confirmDialog.js:24 -msgid "Do you really want to hibernate the system?" -msgstr "Ви дійсно хочете перевести систему в режим сну?" - -#: confirmDialog.js:27 confirmDialog.js:44 confirmDialog.js:67 -msgid "Cancel" -msgstr "Відміна" - -#: confirmDialog.js:40 -msgid "Hibernate button: Systemd Missing" -msgstr "Не виявлено systemd" - -#: confirmDialog.js:41 -msgid "Systemd seems to be missing and is required." -msgstr "Здається відсутній systemd, необхідний режиму сну." - -#: confirmDialog.js:49 confirmDialog.js:72 -msgid "Disable Extension" -msgstr "Вимкнути розширення" - -#: confirmDialog.js:58 -msgid "Hibernate button: Hibernate failed" -msgstr "Не вдалося перевести систему в сон" - -#: confirmDialog.js:59 -msgid "" -"Looks like hibernation failed.\n" -"On some linux distributions hibernation is disabled\n" -"because not all hardware supports it well;\n" -"please check your distribution documentation\n" -"on how to enable it." -msgstr "" -"Спроба перевести систему в сон завершилася невдачею.\n" -"На деяких дистрибутивах режим сну вимкнено\n" -"оскільки не кожне обладнання має його підтримку,\n" -"Будь ласка, зверніться до документації свого дистрибутива\n" -"щоб дізнатися, як його включити." - -#: confirmDialog.js:64 -msgid "You are wrong, don't check this anymore!" -msgstr "Ви помилилися, будь ласка, не чіпайте це!" - -#: prefs.js:99 -msgid "This extension has no settings available" -msgstr "Це розширення не містить параметрів" diff --git a/hibernate-status/locale/zh_CN/LC_MESSAGES/hibernate-status-button.po b/hibernate-status/locale/zh_CN/LC_MESSAGES/hibernate-status-button.po deleted file mode 100644 index be1a6b1..0000000 --- a/hibernate-status/locale/zh_CN/LC_MESSAGES/hibernate-status-button.po +++ /dev/null @@ -1,59 +0,0 @@ -# Simplified Chinese translation of hibernate-status-button -# Copyright (C) 2019 zhmars -# This file is distributed under the same license as the hibernate-status-button package. -# zhmars <1403122061@qq.com>, 2019. -# -msgid "" -msgstr "" -"Project-Id-Version: Hibernate Status Button\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-11-22 00:08+0800\n" -"PO-Revision-Date: 2019-11-21 20:00+0800\n" -"Last-Translator: zhmars <1403122061@qq.com>\n" -"Language-Team: Chinese (Simplified) <>\n" -"Language: zh_CN\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" - -#: confirmDialog.js:23 confirmDialog.js:32 -msgid "Hibernate" -msgstr "休眠" - -#: confirmDialog.js:24 -msgid "Do you really want to hibernate the system?" -msgstr "确定要休眠系统吗?" - -#: confirmDialog.js:27 confirmDialog.js:44 confirmDialog.js:67 -msgid "Cancel" -msgstr "取消" - -#: confirmDialog.js:40 -msgid "Hibernate button: Systemd Missing" -msgstr "无法找到 Systemd" - -#: confirmDialog.js:41 -msgid "Systemd seems to be missing and is required." -msgstr "本功能依赖 Systemd,但目前无法找到。" - -#: confirmDialog.js:49 confirmDialog.js:72 -msgid "Disable Extension" -msgstr "禁用扩展" - -#: confirmDialog.js:58 -msgid "Hibernate button: Hibernate failed" -msgstr "休眠失败" - -#: confirmDialog.js:59 -msgid "" -"Looks like hibernation failed.\n" -"On some linux distributions hibernation is disabled\n" -"because not all hardware supports it well;\n" -"please check your distribution documentation\n" -"on how to enable it." -msgstr "休眠好像失败了。由于不是所有硬件都对该功能支持良好," -"某些发行版默认禁用了休眠,关于如何启用请查阅你所用的发行版文档" - -#: confirmDialog.js:64 -msgid "You are wrong, don't check this anymore!" -msgstr "忽略本项检查" diff --git a/hibernate-status/metadata.json b/hibernate-status/metadata.json deleted file mode 100644 index 94098fe..0000000 --- a/hibernate-status/metadata.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "uuid": "hibernate-status@dromi", - "name": "Hibernate Status Button", - "url": "https://github.com/arelange/gnome-shell-extension-hibernate-status", - "description": "Adds a Hibernate button in Status menu. Using Alt modifier, you can also select Hybrid Sleep instead.", - "shell-version": [ - "43" - ], - "gettext-domain": "hibernate-status-button" -} diff --git a/hibernate-status/prefs.js b/hibernate-status/prefs.js deleted file mode 100644 index cdcd50e..0000000 --- a/hibernate-status/prefs.js +++ /dev/null @@ -1,105 +0,0 @@ -const Gio = imports.gi.Gio; -const Gtk = imports.gi.Gtk; -const Me = imports.misc.extensionUtils.getCurrentExtension(); -// Use __() and N__() for the extension gettext domain, and reuse -// the shell domain with the default _() and N_() -const Gettext = imports.gettext.domain('hibernate-status-button'); -const __ = Gettext.gettext; -const N__ = function(e) { return e }; -const ExtensionUtils = imports.misc.extensionUtils; - -var Prefs = class Prefs { - /** - * Creates a new Settings-object to access the settings of this extension. - * @private - */ - constructor() { - this.KEY_HIBERNATE_WORKS_CHECK = "hibernate-works-check"; - this._schemaName = "org.gnome.shell.extensions.hibernate-status-button"; - - let schemaDir = Me.dir.get_child('schemas').get_path(); - - let schemaSource = Gio.SettingsSchemaSource.new_from_directory( - schemaDir, Gio.SettingsSchemaSource.get_default(), false - ); - let schema = schemaSource.lookup(this._schemaName, false); - - this._setting = new Gio.Settings({ - settings_schema: schema - }); - } - /** - *

Binds the given 'callback'-function to the "changed"-signal on the given - * key.

- *

The 'callback'-function is passed an argument which holds the new - * value of 'key'. The argument is of type "GLib.Variant". Given that the - * receiver knows the internal type, use one of the get_XX()-methods to get - * it's actual value.

- * @see http://www.roojs.com/seed/gir-1.2-gtk-3.0/gjs/GLib.Variant.html - * @param key the key to watch for changes. - * @param callback the callback-function to call. - */ - bindKey(key, callback) { - // Validate: - if (key === undefined || key === null || typeof key !== "string") { - throw TypeError("The 'key' should be a string. Got: '" + key + "'"); - } - if (callback === undefined || callback === null || typeof callback !== "function") { - throw TypeError("'callback' needs to be a function. Got: " + callback); - } - // Bind: - this._setting.connect("changed::" + key, function (source, key) { - callback(source.get_value(key)); - }); - } - /** - * Get if check for working hibernation is enabled. The user might - * choose to disable it if we happen to be wrong. - * - * @returns bool true if we need to check if hibernation works. - */ - getHibernateWorksCheckEnabled() { - return this._setting.get_boolean(this.KEY_HIBERNATE_WORKS_CHECK); - } - /** - * Set if check for working hibernation is enabled. The user might - * choose to disable it if we happen to be wrong. - * - * @returns bool true if we need to check if hibernation works. - */ - setHibernateWorksCheckEnabled(enabled) { - let key = this.KEY_HIBERNATE_WORKS_CHECK; - if (this._setting.is_writable(key)) { - if (this._setting.set_boolean(key, enabled)) { - Gio.Settings.sync(); - } else { - throw this._errorSet(key); - } - } else { - throw this._errorWritable(key); - } - } - _errorWritable(key) { - return "The key '" + key + "' is not writable."; - } - _errorSet(key) { - return "Couldn't set the key '" + key + "'"; - } -} - -// These "preferences" aren't user accessible so define -// init() and buildPrefsWidget() to empty functions -function init() { - ExtensionUtils.initTranslations('hibernate-status-button'); -} -function buildPrefsWidget() { - let frame = new Gtk.Box({orientation: Gtk.Orientation.VERTICAL, - 'margin-top': 10, - 'margin-end': 10, - 'margin-bottom': 10, - 'margin-start': 10}); - let setting_label = new Gtk.Label({label: __("This extension has no settings available"), - xalign: 0 }); - frame.append(setting_label); - return frame; -} diff --git a/hibernate-status/schemas/org.gnome.shell.extensions.hibernate-status-button.gschema.xml b/hibernate-status/schemas/org.gnome.shell.extensions.hibernate-status-button.gschema.xml deleted file mode 100644 index f29ec1c..0000000 --- a/hibernate-status/schemas/org.gnome.shell.extensions.hibernate-status-button.gschema.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - true - - - diff --git a/multi-monitors-add-on/.project b/multi-monitors-add-on/.project deleted file mode 100644 index 58f94f4..0000000 --- a/multi-monitors-add-on/.project +++ /dev/null @@ -1,11 +0,0 @@ - - - multi-monitors-add-on - - - - - - - - diff --git a/multi-monitors-add-on/LICENSE b/multi-monitors-add-on/LICENSE deleted file mode 100644 index d6a9326..0000000 --- a/multi-monitors-add-on/LICENSE +++ /dev/null @@ -1,340 +0,0 @@ -GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - {description} - Copyright (C) {year} {fullname} - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - {signature of Ty Coon}, 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. - diff --git a/multi-monitors-add-on/README.md b/multi-monitors-add-on/README.md deleted file mode 100644 index 4aaa45a..0000000 --- a/multi-monitors-add-on/README.md +++ /dev/null @@ -1,33 +0,0 @@ -Multi Monitors Add-On -===================== - -Extension inspired by https://github.com/darkxst/multiple-monitor-panels -and rewritten from scratch for gnome-shell version 3.10.4. Adds panels -and thumbnails for additional monitors. Settings changes are applied -in dynamic fashion, no restart needed. - -Versions -======== - -* Branch [master](https://github.com/realh/multi-monitors-add-on/tree/master) contains extension for GNOME 42 -* Branch [gnome-3-32_3-36](https://github.com/spin83/multi-monitors-add-on/tree/gnome-3-32_3-36) contains extension for GNOME 3.32, 3.34 and 3.36 -* Branch [gnome-3-24_3-30](https://github.com/spin83/multi-monitors-add-on/tree/gnome-3-24_3-30) contains extension for GNOME 3.24, 3.26, 3.28 and 3.30 -* Branch [gnome-3-20_3-22](https://github.com/spin83/multi-monitors-add-on/tree/gnome-3-20_3-22) contains extension for GNOME 3.20 and 3.22 -* Branch [gnome-3-16_3-18](https://github.com/spin83/multi-monitors-add-on/tree/gnome-3-16_3-18) contains extension for GNOME 3.16 and 3.18 -* Branch [gnome-3-14](https://github.com/spin83/multi-monitors-add-on/tree/gnome-3-14) contains extension for GNOME 3.14 -* Branch [gnome-3-10](https://github.com/spin83/multi-monitors-add-on/tree/gnome-3-10) contains extension for GNOME 3.10 - -Installation from git -===================== - - git clone git://github.com/realh/multi-monitors-add-on.git - cd multi-monitors-add-on - cp -r multi-monitors-add-on@spin83 ~/.local/share/gnome-shell/extensions/ - -Restart the shell and then enable the extension. - -License -======= - -Multi Monitors Add-On extension is distributed under the terms of the -GNU General Public License, version 2 or later. See the LICENSE file for details. diff --git a/multi-monitors-add-on/multi-monitors-add-on@spin83/convenience.js b/multi-monitors-add-on/multi-monitors-add-on@spin83/convenience.js deleted file mode 100644 index bbc8608..0000000 --- a/multi-monitors-add-on/multi-monitors-add-on@spin83/convenience.js +++ /dev/null @@ -1,93 +0,0 @@ -/* -*- mode: js; js-basic-offset: 4; indent-tabs-mode: nil -*- */ -/* - Copyright (c) 2011-2012, Giovanni Campagna - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the GNOME nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -const Gettext = imports.gettext; -const Gio = imports.gi.Gio; - -const Config = imports.misc.config; -const ExtensionUtils = imports.misc.extensionUtils; - -/** - * initTranslations: - * @domain: (optional): the gettext domain to use - * - * Initialize Gettext to load translations from extensionsdir/locale. - * If @domain is not provided, it will be taken from metadata['gettext-domain'] - */ -function initTranslations(domain) { - let extension = ExtensionUtils.getCurrentExtension(); - - domain = domain || extension.metadata['gettext-domain']; - - // check if this extension was built with "make zip-file", and thus - // has the locale files in a subfolder - // otherwise assume that extension has been installed in the - // same prefix as gnome-shell - let localeDir = extension.dir.get_child('locale'); - if (localeDir.query_exists(null)) - Gettext.bindtextdomain(domain, localeDir.get_path()); - else - Gettext.bindtextdomain(domain, Config.LOCALEDIR); -} - -/** - * getSettings: - * @schema: (optional): the GSettings schema id - * - * Builds and return a GSettings schema for @schema, using schema files - * in extensionsdir/schemas. If @schema is not provided, it is taken from - * metadata['settings-schema']. - */ -function getSettings(schema) { - let extension = ExtensionUtils.getCurrentExtension(); - - schema = schema || extension.metadata['settings-schema']; - - const GioSSS = Gio.SettingsSchemaSource; - - // check if this extension was built with "make zip-file", and thus - // has the schema files in a subfolder - // otherwise assume that extension has been installed in the - // same prefix as gnome-shell (and therefore schemas are available - // in the standard folders) - let schemaDir = extension.dir.get_child('schemas'); - let schemaSource; - if (schemaDir.query_exists(null)) - schemaSource = GioSSS.new_from_directory(schemaDir.get_path(), - GioSSS.get_default(), - false); - else - schemaSource = GioSSS.get_default(); - - let schemaObj = schemaSource.lookup(schema, true); - if (!schemaObj) - throw new Error('Schema ' + schema + ' could not be found for extension ' - + extension.metadata.uuid + '. Please check your installation.'); - - return new Gio.Settings({ settings_schema: schemaObj }); -} - diff --git a/multi-monitors-add-on/multi-monitors-add-on@spin83/extension.js b/multi-monitors-add-on/multi-monitors-add-on@spin83/extension.js deleted file mode 100644 index 092d828..0000000 --- a/multi-monitors-add-on/multi-monitors-add-on@spin83/extension.js +++ /dev/null @@ -1,289 +0,0 @@ -/* -Copyright (C) 2014 spin83 - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, visit https://www.gnu.org/licenses/. -*/ - -const { Clutter, Gio } = imports.gi; - -const Main = imports.ui.main; -var { ANIMATION_TIME } = imports.ui.overview; - -const Config = imports.misc.config; -const GNOME_SHELL_VERSION = Config.PACKAGE_VERSION.split('.'); - -const ExtensionUtils = imports.misc.extensionUtils; -const MultiMonitors = ExtensionUtils.getCurrentExtension(); -const Convenience = MultiMonitors.imports.convenience; - -const MMLayout = MultiMonitors.imports.mmlayout; -const MMOverview = MultiMonitors.imports.mmoverview; -const MMIndicator = MultiMonitors.imports.indicator; - -const OVERRIDE_SCHEMA = 'org.gnome.shell.overrides'; -const MUTTER_SCHEMA = 'org.gnome.mutter'; -const WORKSPACES_ONLY_ON_PRIMARY_ID = 'workspaces-only-on-primary'; - -const SHOW_INDICATOR_ID = 'show-indicator'; -const THUMBNAILS_SLIDER_POSITION_ID = 'thumbnails-slider-position'; - -function copyClass (s, d) { -// global.log(s.name +" > "+ d.name); - if (!s) throw Error(`copyClass s undefined for d ${d.name}`) - let propertyNames = Reflect.ownKeys(s.prototype); - for (let pName of propertyNames.values()) { - -// global.log(" ) "+pName.toString()); - if (typeof pName === "symbol") continue; - if (d.prototype.hasOwnProperty(pName)) continue; - if (pName === "prototype") continue; - if (pName === "constructor") continue; -// global.log(pName); - let pDesc = Reflect.getOwnPropertyDescriptor(s.prototype, pName); -// global.log(typeof pDesc); - if (typeof pDesc !== 'object') continue; - Reflect.defineProperty(d.prototype, pName, pDesc); - } -}; - -function gnomeShellVersion() { - return GNOME_SHELL_VERSION; -} - -class MultiMonitorsAddOn { - - constructor() { - this._settings = Convenience.getSettings(); - this._ov_settings = new Gio.Settings({ schema: OVERRIDE_SCHEMA }); - this._mu_settings = new Gio.Settings({ schema: MUTTER_SCHEMA }); - - this.mmIndicator = null; - Main.mmOverview = null; - Main.mmLayoutManager = null; - - this._mmMonitors = 0; - this.syncWorkspacesActualGeometry = null; - } - - _showIndicator() { - if(this._settings.get_boolean(SHOW_INDICATOR_ID)) { - if(!this.mmIndicator) { - this.mmIndicator = Main.panel.addToStatusArea('MultiMonitorsAddOn', new MMIndicator.MultiMonitorsIndicator()); - } - } - else { - this._hideIndicator(); - } - } - - _hideIndicator() { - if(this.mmIndicator) { - this.mmIndicator.destroy(); - this.mmIndicator = null; - } - } - - _showThumbnailsSlider() { - if (this._settings.get_string(THUMBNAILS_SLIDER_POSITION_ID) === 'none') { - this._hideThumbnailsSlider(); - return; - } - - if(this._ov_settings.get_boolean(WORKSPACES_ONLY_ON_PRIMARY_ID)) - this._ov_settings.set_boolean(WORKSPACES_ONLY_ON_PRIMARY_ID, false); - if(this._mu_settings.get_boolean(WORKSPACES_ONLY_ON_PRIMARY_ID)) - this._mu_settings.set_boolean(WORKSPACES_ONLY_ON_PRIMARY_ID, false); - - if (Main.mmOverview) - return; - - Main.mmOverview = []; - for (let idx = 0; idx < Main.layoutManager.monitors.length; idx++) { - if (idx != Main.layoutManager.primaryIndex) { - Main.mmOverview[idx] = new MMOverview.MultiMonitorsOverview(idx); - } - } - - this.syncWorkspacesActualGeometry = Main.overview.searchController._workspacesDisplay._syncWorkspacesActualGeometry; - Main.overview.searchController._workspacesDisplay._syncWorkspacesActualGeometry = function() { - if (this._inWindowFade) - return; - - const primaryView = this._getPrimaryView(); - if (primaryView) { - primaryView.ease({ - ...this._actualGeometry, - duration: Main.overview.animationInProgress ? ANIMATION_TIME : 0, - mode: Clutter.AnimationMode.EASE_OUT_QUAD, - }); - } - - for (let idx = 0; idx < Main.mmOverview.length; idx++) { - if (!Main.mmOverview[idx]) - continue; - if (!Main.mmOverview[idx]._overview) - continue; - const mmView = Main.mmOverview[idx]._overview._controls._workspacesViews; - if (!mmView) - continue; - - const mmGeometry = Main.mmOverview[idx].getWorkspacesActualGeometry(); - mmView.ease({ - ...mmGeometry, - duration: Main.overview.animationInProgress ? ANIMATION_TIME : 0, - mode: Clutter.AnimationMode.EASE_OUT_QUAD, - }); - } - } - } - - _hideThumbnailsSlider() { - if (!Main.mmOverview) - return; - - for (let idx = 0; idx < Main.mmOverview.length; idx++) { - if (Main.mmOverview[idx]) - Main.mmOverview[idx].destroy(); - } - Main.mmOverview = null; - Main.overview.searchController._workspacesDisplay._syncWorkspacesActualGeometry = this.syncWorkspacesActualGeometry; - } - - _relayout() { - if(this._mmMonitors!=Main.layoutManager.monitors.length){ - this._mmMonitors = Main.layoutManager.monitors.length; - global.log("pi:"+Main.layoutManager.primaryIndex); - for (let i = 0; i < Main.layoutManager.monitors.length; i++) { - let monitor = Main.layoutManager.monitors[i]; - global.log("i:"+i+" x:"+monitor.x+" y:"+monitor.y+" w:"+monitor.width+" h:"+monitor.height); - } - this._hideThumbnailsSlider(); - this._showThumbnailsSlider(); - } - } - - _switchOffThumbnails() { - if (this._ov_settings.get_boolean(WORKSPACES_ONLY_ON_PRIMARY_ID) || this._mu_settings.get_boolean(WORKSPACES_ONLY_ON_PRIMARY_ID)) { - this._settings.set_string(THUMBNAILS_SLIDER_POSITION_ID, 'none'); - } - } - - enable(version) { - global.log("Enable Multi Monitors Add-On ("+version+")...") - - if(Main.panel.statusArea.MultiMonitorsAddOn) - disable(); - - this._mmMonitors = 0; - - this._switchOffThumbnailsOvId = this._ov_settings.connect('changed::'+WORKSPACES_ONLY_ON_PRIMARY_ID, - this._switchOffThumbnails.bind(this)); - this._switchOffThumbnailsMuId = this._mu_settings.connect('changed::'+WORKSPACES_ONLY_ON_PRIMARY_ID, - this._switchOffThumbnails.bind(this)); - - this._showIndicatorId = this._settings.connect('changed::'+SHOW_INDICATOR_ID, this._showIndicator.bind(this)); - this._showIndicator(); - - Main.mmLayoutManager = new MMLayout.MultiMonitorsLayoutManager(); - this._showPanelId = this._settings.connect('changed::'+MMLayout.SHOW_PANEL_ID, Main.mmLayoutManager.showPanel.bind(Main.mmLayoutManager)); - Main.mmLayoutManager.showPanel(); - - this._thumbnailsSliderPositionId = this._settings.connect('changed::'+THUMBNAILS_SLIDER_POSITION_ID, this._showThumbnailsSlider.bind(this)); - this._relayoutId = Main.layoutManager.connect('monitors-changed', this._relayout.bind(this)); - this._relayout(); - } - - disable() { - Main.layoutManager.disconnect(this._relayoutId); - this._ov_settings.disconnect(this._switchOffThumbnailsOvId); - this._mu_settings.disconnect(this._switchOffThumbnailsMuId); - - this._settings.disconnect(this._showPanelId); - this._settings.disconnect(this._thumbnailsSliderPositionId); - this._settings.disconnect(this._showIndicatorId); - - - this._hideIndicator(); - - Main.mmLayoutManager.hidePanel(); - Main.mmLayoutManager = null; - - this._hideThumbnailsSlider(); - this._mmMonitors = 0; - - global.log("Disable Multi Monitors Add-On ...") - } -} - -var multiMonitorsAddOn = null; -var version = null; - -function init() { - Convenience.initTranslations(); - - // fix bug in panel: Destroy function many time added to this same indicator. - Main.panel._ensureIndicator = function(role) { - let indicator = this.statusArea[role]; - if (indicator) { - indicator.container.show(); - return null; - } - else { - let constructor = PANEL_ITEM_IMPLEMENTATIONS[role]; - if (!constructor) { - // This icon is not implemented (this is a bug) - return null; - } - indicator = new constructor(this); - this.statusArea[role] = indicator; - } - return indicator; - }; - - const metaVersion = MultiMonitors.metadata['version']; - if (Number.isFinite(metaVersion)) { - version = 'v'+Math.trunc(metaVersion); - switch(Math.round((metaVersion%1)*10)) { - case 0: - break; - case 1: - version += '+bugfix'; - break; - case 2: - version += '+develop'; - break; - default: - version += '+modified'; - break; - } - } - else - version = metaVersion; -} - -function enable() { - if (multiMonitorsAddOn !== null) - return; - - multiMonitorsAddOn = new MultiMonitorsAddOn(); - multiMonitorsAddOn.enable(version); -} - -function disable() { - if (multiMonitorsAddOn == null) - return; - - multiMonitorsAddOn.disable(); - multiMonitorsAddOn = null; -} diff --git a/multi-monitors-add-on/multi-monitors-add-on@spin83/icons/multi-monitors-l-symbolic.svg b/multi-monitors-add-on/multi-monitors-add-on@spin83/icons/multi-monitors-l-symbolic.svg deleted file mode 100644 index 6341c21..0000000 --- a/multi-monitors-add-on/multi-monitors-add-on@spin83/icons/multi-monitors-l-symbolic.svg +++ /dev/null @@ -1,392 +0,0 @@ - - - - - - - - image/svg+xml - - Gnome Symbolic Icon Theme - - - - - - - - Gnome Symbolic Icon Theme - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/multi-monitors-add-on/multi-monitors-add-on@spin83/icons/multi-monitors-r-symbolic.svg b/multi-monitors-add-on/multi-monitors-add-on@spin83/icons/multi-monitors-r-symbolic.svg deleted file mode 100644 index 6bf4651..0000000 --- a/multi-monitors-add-on/multi-monitors-add-on@spin83/icons/multi-monitors-r-symbolic.svg +++ /dev/null @@ -1,393 +0,0 @@ - - - - - - - - image/svg+xml - - Gnome Symbolic Icon Theme - - - - - - - - Gnome Symbolic Icon Theme - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/multi-monitors-add-on/multi-monitors-add-on@spin83/indicator.js b/multi-monitors-add-on/multi-monitors-add-on@spin83/indicator.js deleted file mode 100644 index 8b500ee..0000000 --- a/multi-monitors-add-on/multi-monitors-add-on@spin83/indicator.js +++ /dev/null @@ -1,109 +0,0 @@ -/* -Copyright (C) 2014 spin83 - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, visit https://www.gnu.org/licenses/. -*/ - -const { St, Gio, GLib, GObject } = imports.gi; - -const Util = imports.misc.util; -const Main = imports.ui.main; -const PanelMenu = imports.ui.panelMenu; - -const Gettext = imports.gettext.domain('multi-monitors-add-on'); -const _ = Gettext.gettext; -const CE = imports.misc.extensionUtils.getCurrentExtension(); -const MultiMonitors = CE.imports.extension; -const Convenience = CE.imports.convenience; -const extensionPath = CE.path; - -var MultiMonitorsIndicator = (() => { - let MultiMonitorsIndicator = class MultiMonitorsIndicator extends PanelMenu.Button { - _init() { - super._init(0.0, "MultiMonitorsAddOn", false); - - Convenience.initTranslations(); - - this.text = null; - this._mmStatusIcon = new St.BoxLayout({ style_class: 'multimonitor-status-indicators-box' }); - this._mmStatusIcon.hide(); - this.add_child(this._mmStatusIcon); - this._leftRightIcon = true; - this.menu.addAction(_("Preferences"), this._onPreferences.bind(this)); - this._viewMonitorsId = Main.layoutManager.connect('monitors-changed', this._viewMonitors.bind(this)); - this._viewMonitors(); - } - - _onDestroy() { - Main.layoutManager.disconnect(this._viewMonitorsId); - super._onDestroy(); - } - - _syncIndicatorsVisible() { - this._mmStatusIcon.visible = this._mmStatusIcon.get_children().some(a => a.visible); - } - - _icon_name (icon, iconName) { - icon.set_gicon(Gio.icon_new_for_string(extensionPath+"/icons/"+iconName+".svg")); - } - - _viewMonitors() { - let monitors = this._mmStatusIcon.get_children(); - - let monitorChange = Main.layoutManager.monitors.length - monitors.length; - if(monitorChange>0){ - global.log("Add Monitors ..."); - for(let idx = 0; idx, YEAR. -# -msgid "" -msgstr "" -"Project-Id-Version: Multi Monitors Add On Gnome Shell Extension\n" -"Report-Msgid-Bugs-To: https://github.com/spin83/multi-monitors-add-on/" -"issues\n" -"POT-Creation-Date: 2019-10-04 04:44-0300\n" -"PO-Revision-Date: 2015-01-23 22:30+0100\n" -"Last-Translator: Jonatan Zeidler \n" -"Language-Team: German \n" -"Language: de\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Generator: Poedit 1.5.4\n" -"X-Poedit-SourceCharset: UTF-8\n" - -#: indicator.js:46 -msgid "Preferences" -msgstr "Einstellungen" - -#: indicator.js:115 -msgid "Multi Monitors Add-On" -msgstr "Multimonitor-Erweiterung" - -#: mmoverview.js:642 -msgid "Overview" -msgstr "" - -#. Translators: If there is no suitable word for "Activities" -#. in your language, you can use the word for "Overview". -#: mmpanel.js:333 -msgid "Activities" -msgstr "" - -#: mmpanel.js:414 -msgid "Top Bar" -msgstr "" - -#: prefs.js:62 -msgid "Show Multi Monitors indicator on Top Panel." -msgstr "Multimonitor-Indikator in der oberen Leiste anzeigen" - -#: prefs.js:63 -msgid "Show Panel on additional monitors." -msgstr "Leiste auf zusätzlichen Monitoren anzeigen" - -#: prefs.js:64 -msgid "Show Thumbnails-Slider on additional monitors." -msgstr "Arbeitsflächenübersicht auf zusätzlichen Monitoren anzeigen" - -#: prefs.js:65 -msgid "Show Activities-Button on additional monitors." -msgstr "Aktivitäten-Schaltfläche auf zusätzlichen Monitoren anzeigen" - -#: prefs.js:66 -msgid "Show AppMenu-Button on additional monitors." -msgstr "Anwendungsmenü auf zusätzlichen Monitoren anzeigen" - -#: prefs.js:67 -msgid "Show DateTime-Button on additional monitors." -msgstr "Datum-Zeit auf zusätzlichen Monitoren anzeigen." - -#: prefs.js:71 -msgid "Enable hot corners." -msgstr "" - -#: prefs.js:77 -msgid "A list of indicators for transfer to additional monitors." -msgstr "" -"Eine Liste von Indikatoren, die auf die zusätzlichen Monitore verschoben " -"werden sollen" - -#: prefs.js:124 -msgid "Select indicator" -msgstr "Indikator auswählen" - -#: prefs.js:127 -msgid "Add" -msgstr "Hinzufügen" - -#: prefs.js:141 -msgid "Indicators on Top Panel" -msgstr "Indikatoren in der oberen Leiste" - -#: prefs.js:170 -msgid "Monitor index:" -msgstr "Monitorindex:" - -#~ msgid "Test" -#~ msgstr "Test" diff --git a/multi-monitors-add-on/multi-monitors-add-on@spin83/locale/es/LC_MESSAGES/multi-monitors-add-on.mo b/multi-monitors-add-on/multi-monitors-add-on@spin83/locale/es/LC_MESSAGES/multi-monitors-add-on.mo deleted file mode 100644 index 0cd6a92..0000000 Binary files a/multi-monitors-add-on/multi-monitors-add-on@spin83/locale/es/LC_MESSAGES/multi-monitors-add-on.mo and /dev/null differ diff --git a/multi-monitors-add-on/multi-monitors-add-on@spin83/locale/es/LC_MESSAGES/multi-monitors-add-on.po b/multi-monitors-add-on/multi-monitors-add-on@spin83/locale/es/LC_MESSAGES/multi-monitors-add-on.po deleted file mode 100644 index 6c51dca..0000000 --- a/multi-monitors-add-on/multi-monitors-add-on@spin83/locale/es/LC_MESSAGES/multi-monitors-add-on.po +++ /dev/null @@ -1,91 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. -# Alonso Lara , 2017. -# -msgid "" -msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" -"Report-Msgid-Bugs-To: https://github.com/spin83/multi-monitors-add-on/" -"issues\n" -"POT-Creation-Date: 2019-10-04 04:44-0300\n" -"PO-Revision-Date: 2017-03-04 23:59+0100\n" -"Last-Translator: Alonso Lara \n" -"Language-Team: Spanish \n" -"Language: es\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" - -#: indicator.js:46 -msgid "Preferences" -msgstr "Preferencias" - -#: indicator.js:115 -msgid "Multi Monitors Add-On" -msgstr "Accesorio de monitores múltiples" - -#: mmoverview.js:642 -msgid "Overview" -msgstr "" - -#. Translators: If there is no suitable word for "Activities" -#. in your language, you can use the word for "Overview". -#: mmpanel.js:333 -msgid "Activities" -msgstr "" - -#: mmpanel.js:414 -msgid "Top Bar" -msgstr "" - -#: prefs.js:62 -msgid "Show Multi Monitors indicator on Top Panel." -msgstr "Mostrar indicador de monitores múltiples en el panel." - -#: prefs.js:63 -msgid "Show Panel on additional monitors." -msgstr "Mostrar el panel en monitores adicionales." - -#: prefs.js:64 -msgid "Show Thumbnails-Slider on additional monitors." -msgstr "Mostrar las miniaturas en los monitores adicionales." - -#: prefs.js:65 -msgid "Show Activities-Button on additional monitors." -msgstr "Mostrar las actividades en los monitores adicionales." - -#: prefs.js:66 -msgid "Show AppMenu-Button on additional monitors." -msgstr "Mostrar el menú de aplicaciones en los monitores adicionales." - -#: prefs.js:67 -msgid "Show DateTime-Button on additional monitors." -msgstr "Mostrar la fecha en los monitores adicionales." - -#: prefs.js:71 -msgid "Enable hot corners." -msgstr "" - -#: prefs.js:77 -msgid "A list of indicators for transfer to additional monitors." -msgstr "Un listado de indicadores para transferir a monitores adicionales." - -#: prefs.js:124 -msgid "Select indicator" -msgstr "Seleccione indicador" - -#: prefs.js:127 -msgid "Add" -msgstr "Añadir" - -#: prefs.js:141 -msgid "Indicators on Top Panel" -msgstr "Indicadores en el panel" - -#: prefs.js:170 -msgid "Monitor index:" -msgstr "Monitor número:" - -#~ msgid "Test" -#~ msgstr "Prueba" diff --git a/multi-monitors-add-on/multi-monitors-add-on@spin83/locale/fr/LC_MESSAGES/multi-monitors-add-on.mo b/multi-monitors-add-on/multi-monitors-add-on@spin83/locale/fr/LC_MESSAGES/multi-monitors-add-on.mo deleted file mode 100644 index 2aefbb2..0000000 Binary files a/multi-monitors-add-on/multi-monitors-add-on@spin83/locale/fr/LC_MESSAGES/multi-monitors-add-on.mo and /dev/null differ diff --git a/multi-monitors-add-on/multi-monitors-add-on@spin83/locale/fr/LC_MESSAGES/multi-monitors-add-on.po b/multi-monitors-add-on/multi-monitors-add-on@spin83/locale/fr/LC_MESSAGES/multi-monitors-add-on.po deleted file mode 100644 index 3b207cc..0000000 --- a/multi-monitors-add-on/multi-monitors-add-on@spin83/locale/fr/LC_MESSAGES/multi-monitors-add-on.po +++ /dev/null @@ -1,94 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. -# FIRST AUTHOR , YEAR. -# -msgid "" -msgstr "" -"Project-Id-Version: Multi Monitors Add On Gnome Shell Extension\n" -"Report-Msgid-Bugs-To: https://github.com/spin83/multi-monitors-add-on/" -"issues\n" -"POT-Creation-Date: 2019-10-04 04:44-0300\n" -"PO-Revision-Date: 2015-12-26 22:30+0100\n" -"Last-Translator: Quentin Daem\n" -"Language-Team: Language: fr_FR\n" -"Language: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Generator: Poedit 1.5.4\n" -"X-Poedit-SourceCharset: UTF-8\n" - -#: indicator.js:46 -msgid "Preferences" -msgstr "Préférences" - -#: indicator.js:115 -msgid "Multi Monitors Add-On" -msgstr "Multi Moniteurs Add-On" - -#: mmoverview.js:642 -msgid "Overview" -msgstr "" - -#. Translators: If there is no suitable word for "Activities" -#. in your language, you can use the word for "Overview". -#: mmpanel.js:333 -msgid "Activities" -msgstr "" - -#: mmpanel.js:414 -msgid "Top Bar" -msgstr "" - -#: prefs.js:62 -msgid "Show Multi Monitors indicator on Top Panel." -msgstr "Afficher l'icone Multi Moniteurs sur la barre du haut" - -#: prefs.js:63 -msgid "Show Panel on additional monitors." -msgstr "Afficher Menu sur les moniteurs secondaires" - -#: prefs.js:64 -msgid "Show Thumbnails-Slider on additional monitors." -msgstr "" -"Afficher le dock listant les espaces de travail sur les moniteurs secondaires" - -#: prefs.js:65 -msgid "Show Activities-Button on additional monitors." -msgstr "Afficher le bouton Activités sur les moniteurs secondaires" - -#: prefs.js:66 -msgid "Show AppMenu-Button on additional monitors." -msgstr "Afficher le bouton du menu Applications sur les moniteurs secondaires" - -#: prefs.js:67 -msgid "Show DateTime-Button on additional monitors." -msgstr "Afficher le bouton Date-Heure sur les moniteurs secondaires." - -#: prefs.js:71 -msgid "Enable hot corners." -msgstr "" - -#: prefs.js:77 -msgid "A list of indicators for transfer to additional monitors." -msgstr "Une liste d'indicateurs pour transfert vers les moniteurs secondaires " - -#: prefs.js:124 -msgid "Select indicator" -msgstr "Selectionner indicateur" - -#: prefs.js:127 -msgid "Add" -msgstr "Ajouter" - -#: prefs.js:141 -msgid "Indicators on Top Panel" -msgstr "Indicateur dans le panneau du haut" - -#: prefs.js:170 -msgid "Monitor index:" -msgstr "Index moniteur:" - -#~ msgid "Test" -#~ msgstr "Test" diff --git a/multi-monitors-add-on/multi-monitors-add-on@spin83/locale/it/LC_MESSAGES/multi-monitors-add-on.mo b/multi-monitors-add-on/multi-monitors-add-on@spin83/locale/it/LC_MESSAGES/multi-monitors-add-on.mo deleted file mode 100644 index 14040b3..0000000 Binary files a/multi-monitors-add-on/multi-monitors-add-on@spin83/locale/it/LC_MESSAGES/multi-monitors-add-on.mo and /dev/null differ diff --git a/multi-monitors-add-on/multi-monitors-add-on@spin83/locale/it/LC_MESSAGES/multi-monitors-add-on.po b/multi-monitors-add-on/multi-monitors-add-on@spin83/locale/it/LC_MESSAGES/multi-monitors-add-on.po deleted file mode 100644 index fd41a90..0000000 --- a/multi-monitors-add-on/multi-monitors-add-on@spin83/locale/it/LC_MESSAGES/multi-monitors-add-on.po +++ /dev/null @@ -1,93 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. -# FIRST AUTHOR , YEAR. -# -msgid "" -msgstr "" -"Project-Id-Version: Multi Monitors Add On Gnome Shell Extension\n" -"Report-Msgid-Bugs-To: https://github.com/spin83/multi-monitors-add-on/" -"issues\n" -"POT-Creation-Date: 2019-10-04 04:44-0300\n" -"PO-Revision-Date: 2019-10-21 14:53+0200\n" -"Last-Translator: Luca Bandini (@Vombato) \n" -"Language-Team: ItalianLanguage: it\n" -"Language: it\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Generator: Poedit 2.2.4\n" -"X-Poedit-SourceCharset: UTF-8\n" - -#: indicator.js:46 -msgid "Preferences" -msgstr "Preferenze" - -#: indicator.js:115 -msgid "Multi Monitors Add-On" -msgstr "Componente aggiuntivo per più monitor" - -#: mmoverview.js:642 -msgid "Overview" -msgstr "Panoramica" - -#. Translators: If there is no suitable word for "Activities" -#. in your language, you can use the word for "Overview". -#: mmpanel.js:333 -msgid "Activities" -msgstr "Attività" - -#: mmpanel.js:414 -msgid "Top Bar" -msgstr "Barra Superiore" - -#: prefs.js:62 -msgid "Show Multi Monitors indicator on Top Panel." -msgstr "Mostra l'icona Multi Monitor sul pannello superiore." - -#: prefs.js:63 -msgid "Show Panel on additional monitors." -msgstr "Mostra Menu su monitor secondari." - -#: prefs.js:64 -msgid "Show Thumbnails-Slider on additional monitors." -msgstr "Visualizza le aree di lavoro sui monitor secondari." - -#: prefs.js:65 -msgid "Show Activities-Button on additional monitors." -msgstr "Mostra il Bottone Attività sui monitor secondari." - -#: prefs.js:66 -msgid "Show AppMenu-Button on additional monitors." -msgstr "Visualizza il pulsante del menu Applicazioni sui monitor secondari." - -#: prefs.js:67 -msgid "Show DateTime-Button on additional monitors." -msgstr "Mostra il Bottone Data/Ora sui monitor secondari." - -#: prefs.js:71 -msgid "Enable hot corners." -msgstr "" - -#: prefs.js:77 -msgid "A list of indicators for transfer to additional monitors." -msgstr "Un elenco di indicatori per il trasferimento a monitor secondari." - -#: prefs.js:124 -msgid "Select indicator" -msgstr "Seleziona indicatore" - -#: prefs.js:127 -msgid "Add" -msgstr "Aggiungere" - -#: prefs.js:141 -msgid "Indicators on Top Panel" -msgstr "Indicatore nel pannello superiore" - -#: prefs.js:170 -msgid "Monitor index:" -msgstr "Indice monitor:" - -#~ msgid "Test" -#~ msgstr "Test" diff --git a/multi-monitors-add-on/multi-monitors-add-on@spin83/locale/pl/LC_MESSAGES/multi-monitors-add-on.mo b/multi-monitors-add-on/multi-monitors-add-on@spin83/locale/pl/LC_MESSAGES/multi-monitors-add-on.mo deleted file mode 100644 index 84f0f8e..0000000 Binary files a/multi-monitors-add-on/multi-monitors-add-on@spin83/locale/pl/LC_MESSAGES/multi-monitors-add-on.mo and /dev/null differ diff --git a/multi-monitors-add-on/multi-monitors-add-on@spin83/locale/pl/LC_MESSAGES/multi-monitors-add-on.po b/multi-monitors-add-on/multi-monitors-add-on@spin83/locale/pl/LC_MESSAGES/multi-monitors-add-on.po deleted file mode 100644 index 80116d8..0000000 --- a/multi-monitors-add-on/multi-monitors-add-on@spin83/locale/pl/LC_MESSAGES/multi-monitors-add-on.po +++ /dev/null @@ -1,94 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. -# FIRST AUTHOR , YEAR. -# -msgid "" -msgstr "" -"Project-Id-Version: \n" -"Report-Msgid-Bugs-To: https://github.com/spin83/multi-monitors-add-on/" -"issues\n" -"POT-Creation-Date: 2019-10-04 04:44-0300\n" -"PO-Revision-Date: 2016-12-29 14:25+0100\n" -"Last-Translator: \n" -"Language-Team: \n" -"Language: pl_PL\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Generator: Poedit 1.8.11\n" -"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 " -"|| n%100>=20) ? 1 : 2);\n" - -#: indicator.js:46 -msgid "Preferences" -msgstr "Ustawienia" - -#: indicator.js:115 -msgid "Multi Monitors Add-On" -msgstr "Multi Monitors Add-On" - -#: mmoverview.js:642 -msgid "Overview" -msgstr "" - -#. Translators: If there is no suitable word for "Activities" -#. in your language, you can use the word for "Overview". -#: mmpanel.js:333 -msgid "Activities" -msgstr "" - -#: mmpanel.js:414 -msgid "Top Bar" -msgstr "" - -#: prefs.js:62 -msgid "Show Multi Monitors indicator on Top Panel." -msgstr "Wyświetl wskaźnik rozszerzenia na głównym pasku." - -#: prefs.js:63 -msgid "Show Panel on additional monitors." -msgstr "Wyświetl główny pasek na dodatkowych monitorach." - -#: prefs.js:64 -msgid "Show Thumbnails-Slider on additional monitors." -msgstr "Wyświetl pasek miniatur na dodatkowych monitorach." - -#: prefs.js:65 -msgid "Show Activities-Button on additional monitors." -msgstr "Wyświetl przycisk podglądu na dodatkowych monitorach." - -#: prefs.js:66 -msgid "Show AppMenu-Button on additional monitors." -msgstr "Wyświetl przycisk aplikacji na dodatkowych monitorach." - -#: prefs.js:67 -msgid "Show DateTime-Button on additional monitors." -msgstr "Wyświetl przycisk daty i czasu na dodatkowych monitorach." - -#: prefs.js:71 -msgid "Enable hot corners." -msgstr "Włączenie podglądu po najechaniu rogu ekranu." - -#: prefs.js:77 -msgid "A list of indicators for transfer to additional monitors." -msgstr "Lista wskaźników do przesunięcia na dodatkowe monitory." - -#: prefs.js:124 -msgid "Select indicator" -msgstr "Wybierz wskaźnik" - -#: prefs.js:127 -msgid "Add" -msgstr "Dodaj" - -#: prefs.js:141 -msgid "Indicators on Top Panel" -msgstr "Wskaźniki na głównym panelu" - -#: prefs.js:170 -msgid "Monitor index:" -msgstr "Indeks monitora:" - -#~ msgid "Test" -#~ msgstr "Test" diff --git a/multi-monitors-add-on/multi-monitors-add-on@spin83/locale/pt_BR/LC_MESSAGES/multi-monitors-add-on.mo b/multi-monitors-add-on/multi-monitors-add-on@spin83/locale/pt_BR/LC_MESSAGES/multi-monitors-add-on.mo deleted file mode 100644 index beae2e9..0000000 Binary files a/multi-monitors-add-on/multi-monitors-add-on@spin83/locale/pt_BR/LC_MESSAGES/multi-monitors-add-on.mo and /dev/null differ diff --git a/multi-monitors-add-on/multi-monitors-add-on@spin83/locale/pt_BR/LC_MESSAGES/multi-monitors-add-on.po b/multi-monitors-add-on/multi-monitors-add-on@spin83/locale/pt_BR/LC_MESSAGES/multi-monitors-add-on.po deleted file mode 100644 index 94c370c..0000000 --- a/multi-monitors-add-on/multi-monitors-add-on@spin83/locale/pt_BR/LC_MESSAGES/multi-monitors-add-on.po +++ /dev/null @@ -1,89 +0,0 @@ -# Brazilian Portuguese translation for multi-monitors-add-on -# Copyright (C) 2019 THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the multi-monitors-add-on package. -# Rafael Fontenelle , 2019. -# -msgid "" -msgstr "" -"Project-Id-Version: Multi Monitors Add On Gnome Shell Extension\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-01-23 22:29+0100\n" -"PO-Revision-Date: 2019-10-03 06:49-0300\n" -"Last-Translator: Rafael Fontenelle \n" -"Language-Team: Brazilian Portuguese \n" -"Language: pt_BR\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=2; plural=(n > 1)\n" -"X-Generator: Gtranslator 3.32.0\n" -"X-Project-Style: gnome\n" - -#: prefs.js:61 -msgid "Show Multi Monitors indicator on Top Panel." -msgstr "Mostrar o indicador do Multi Monitors no painel superior" - -#: prefs.js:62 -msgid "Show Panel on additional monitors." -msgstr "Mostrar o painel em monitores adicionais" - -#: prefs.js:63 -msgid "Show Thumbnails-Slider on additional monitors." -msgstr "Mostrar controle deslizante de miniaturas em monitores adicionais" - -#: prefs.js:64 -msgid "Show Activities-Button on additional monitors." -msgstr "Mostrar botão de Atividades em monitores adicionais" - -#: prefs.js:65 -msgid "Show AppMenu-Button on additional monitors." -msgstr "Mostrar botão de menu de aplicativos em monitores adicionais" - -#: prefs.js:67 -msgid "Show DateTime-Button on additional monitors." -msgstr "Mostrar o botão de data e hora em monitores adicionais" - -#: prefs.js:75 -msgid "A list of indicators for transfer to additional monitors." -msgstr "Uma lista de indicadores para transferir para monitores adicionais." - -#: prefs.js:71 -msgid "Enable hot corners." -msgstr "" - -#: prefs.js:122 -msgid "Select indicator" -msgstr "Selecionar indicador" - -#: prefs.js:125 -msgid "Add" -msgstr "Adicionar" - -#: prefs.js:139 -msgid "Indicators on Top Panel" -msgstr "Indicadores no painel superior" - -#: prefs.js:168 -msgid "Monitor index:" -msgstr "Índice do monitor:" - -#: indicator.js:106 -msgid "Preferences" -msgstr "Preferências" - -#: indicator.js:107 -msgid "Test" -msgstr "Testar" - -#: indicator.js:129 -msgid "Multi Monitors Add-On" -msgstr "Multi Monitors Add-On" - -#~ msgid "Overview" -#~ msgstr "Panorama" - -#~ msgid "Activities" -#~ msgstr "Atividades" - -#~ msgid "Top Bar" -#~ msgstr "Barra superior" diff --git a/multi-monitors-add-on/multi-monitors-add-on@spin83/metadata.json b/multi-monitors-add-on/multi-monitors-add-on@spin83/metadata.json deleted file mode 100644 index 68b1295..0000000 --- a/multi-monitors-add-on/multi-monitors-add-on@spin83/metadata.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "shell-version": ["40", "41", "42", "43"], - "uuid": "multi-monitors-add-on@spin83", - "name": "Multi Monitors Add-On", - "settings-schema": "org.gnome.shell.extensions.multi-monitors-add-on", - "gettext-domain": "multi-monitors-add-on", - "description": "Add multiple monitors overview and panel for gnome-shell.", - "url": "https://github.com/spin83/multi-monitors-add-on.git", - "version": 25 -} diff --git a/multi-monitors-add-on/multi-monitors-add-on@spin83/mmcalendar.js b/multi-monitors-add-on/multi-monitors-add-on@spin83/mmcalendar.js deleted file mode 100644 index 66237f4..0000000 --- a/multi-monitors-add-on/multi-monitors-add-on@spin83/mmcalendar.js +++ /dev/null @@ -1,412 +0,0 @@ -/* -Copyright (C) 2014 spin83 - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, visit https://www.gnu.org/licenses/. -*/ - -const Signals = imports.signals; - -const { St, Gio, Shell, Clutter, GnomeDesktop, Pango, GObject, GLib } = imports.gi; - -const Main = imports.ui.main; -const PanelMenu = imports.ui.panelMenu; -const MessageList = imports.ui.messageList; -const DateMenu = imports.ui.dateMenu; -const Calendar = imports.ui.calendar; -const PopupMenu = imports.ui.popupMenu; - -const ExtensionUtils = imports.misc.extensionUtils; -const CE = ExtensionUtils.getCurrentExtension(); -const MultiMonitors = CE.imports.extension; -const Convenience = CE.imports.convenience; - -// Calendar.DoNotDisturbSwitch is const, so not exported. Either -// is untrue, or -// GObject.type_from_name() is broken, so we can't get its constructor via GI -// either. Luckily it's a short class, so we can copy & paste. -const MultiMonitorsDoNotDisturbSwitch = GObject.registerClass( -class MultiMonitorsDoNotDisturbSwitch extends PopupMenu.Switch { - _init() { - this._settings = new Gio.Settings({ - schema_id: 'org.gnome.desktop.notifications', - }); - - super._init(this._settings.get_boolean('show-banners')); - - this._settings.bind('show-banners', - this, 'state', - Gio.SettingsBindFlags.INVERT_BOOLEAN); - - this.connect('destroy', () => { - this._settings.run_dispose(); - this._settings = null; - }); - } -}); - -var MultiMonitorsCalendar = (() => { - let MultiMonitorsCalendar = class MultiMonitorsCalendar extends St.Widget { - _init () { - this._weekStart = Shell.util_get_week_start(); - this._settings = new Gio.Settings({ schema_id: 'org.gnome.desktop.calendar' }); - - this._showWeekdateKeyId = this._settings.connect('changed::%s'.format(Calendar.SHOW_WEEKDATE_KEY), this._onSettingsChange.bind(this)); - this._useWeekdate = this._settings.get_boolean(Calendar.SHOW_WEEKDATE_KEY); - - this._headerFormatWithoutYear = _('%OB'); - this._headerFormat = _('%OB %Y'); - - // Start off with the current date - this._selectedDate = new Date(); - - this._shouldDateGrabFocus = false; - - super._init({ - style_class: 'calendar', - layout_manager: new Clutter.GridLayout(), - reactive: true, - }); - - this._buildHeader(); - this.connect('destroy', this._onDestroy.bind(this)); - } - - _onDestroy() { - this._settings.disconnect(this._showWeekdateKeyId); - } - }; - MultiMonitors.copyClass(Calendar.Calendar, MultiMonitorsCalendar); - return GObject.registerClass({ - Signals: { 'selected-date-changed': { param_types: [GLib.DateTime.$gtype] } }, - }, MultiMonitorsCalendar); -})(); - -var MultiMonitorsEventsSection = (() => { - let MultiMonitorsEventsSection = class MultiMonitorsEventsSection extends St.Button { - _init() { - super._init({ - style_class: 'events-button', - can_focus: true, - x_expand: true, - child: new St.BoxLayout({ - style_class: 'events-box', - vertical: true, - x_expand: true, - }), - }); - - this._startDate = null; - this._endDate = null; - - this._eventSource = null; - this._calendarApp = null; - - this._title = new St.Label({ - style_class: 'events-title', - }); - this.child.add_child(this._title); - - this._eventsList = new St.BoxLayout({ - style_class: 'events-list', - vertical: true, - x_expand: true, - }); - this.child.add_child(this._eventsList); - - this._appSys = Shell.AppSystem.get_default(); - this._appInstalledChangedId = this._appSys.connect('installed-changed', - this._appInstalledChanged.bind(this)); - this._appInstalledChanged(); - - this.connect('destroy', this._onDestroy.bind(this)); - this._appInstalledChanged(); - } - - _onDestroy() { - this._appSys.disconnect(this._appInstalledChangedId); - }}; - - MultiMonitors.copyClass(DateMenu.EventsSection, MultiMonitorsEventsSection); - return GObject.registerClass(MultiMonitorsEventsSection); -})(); - -var MultiMonitorsNotificationSection = (() => { - let MultiMonitorsNotificationSection = class MultiMonitorsNotificationSection extends MessageList.MessageListSection { - _init() { - super._init(); - - this._sources = new Map(); - this._nUrgent = 0; - - this._sourceAddedId = Main.messageTray.connect('source-added', this._sourceAdded.bind(this)); - Main.messageTray.getSources().forEach(source => { - this._sourceAdded(Main.messageTray, source); - }); - - this.connect('destroy', this._onDestroy.bind(this)); - } - - _onDestroy() { - Main.messageTray.disconnect(this._sourceAddedId); - let source, obj; - for ([source, obj] of this._sources.entries()) { - this._onSourceDestroy(source, obj); - } - }}; - - MultiMonitors.copyClass(Calendar.NotificationSection, MultiMonitorsNotificationSection); - return GObject.registerClass(MultiMonitorsNotificationSection); -})(); - -var MultiMonitorsCalendarMessageList = (() => { - let MultiMonitorsCalendarMessageList = class MultiMonitorsCalendarMessageList extends St.Widget { - _init() { - super._init({ - style_class: 'message-list', - layout_manager: new Clutter.BinLayout(), - x_expand: true, - y_expand: true, - }); - - this._sessionModeUpdatedId = 0; - - this._placeholder = new Calendar.Placeholder(); - this.add_actor(this._placeholder); - - let box = new St.BoxLayout({ vertical: true, - x_expand: true, y_expand: true }); - this.add_actor(box); - - this._scrollView = new St.ScrollView({ - style_class: 'vfade', - overlay_scrollbars: true, - x_expand: true, y_expand: true, - }); - this._scrollView.set_policy(St.PolicyType.NEVER, St.PolicyType.AUTOMATIC); - box.add_actor(this._scrollView); - - let hbox = new St.BoxLayout({ style_class: 'message-list-controls' }); - box.add_child(hbox); - - const dndLabel = new St.Label({ - text: _('Do Not Disturb'), - y_align: Clutter.ActorAlign.CENTER, - }); - hbox.add_child(dndLabel); - - this._dndSwitch = new MultiMonitorsDoNotDisturbSwitch(); - this._dndButton = new St.Button({ - can_focus: true, - toggle_mode: true, - child: this._dndSwitch, - label_actor: dndLabel, - }); - - this._dndSwitch.bind_property('state', - this._dndButton, 'checked', - GObject.BindingFlags.BIDIRECTIONAL | GObject.BindingFlags.SYNC_CREATE); - - hbox.add_child(this._dndButton); - - this._clearButton = new St.Button({ - style_class: 'message-list-clear-button button', - label: _('Clear'), - can_focus: true, - x_expand: true, - x_align: Clutter.ActorAlign.END, - }); - this._clearButton.connect('clicked', () => { - this._sectionList.get_children().forEach(s => s.clear()); - }); - hbox.add_actor(this._clearButton); - - this._placeholder.bind_property('visible', - this._clearButton, 'visible', - GObject.BindingFlags.INVERT_BOOLEAN); - - this._sectionList = new St.BoxLayout({ style_class: 'message-list-sections', - vertical: true, - x_expand: true, - y_expand: true, - y_align: Clutter.ActorAlign.START }); - this._sectionList.connect('actor-added', this._sync.bind(this)); - this._sectionList.connect('actor-removed', this._sync.bind(this)); - this._scrollView.add_actor(this._sectionList); - - this._notificationSection = new MultiMonitorsNotificationSection(); - this._addSection(this._notificationSection); - - this._sessionModeUpdatedId = Main.sessionMode.connect('updated', this._sync.bind(this)); - this.connect('destroy', this._onDestroy.bind(this)); - } - - _onDestroy() { - Main.sessionMode.disconnect(this._sessionModeUpdatedId); - this._sessionModeUpdatedId = 0; - } - - _sync() { - if (this._sessionModeUpdatedId === 0) return; - Calendar.CalendarMessageList.prototype._sync.call(this); - }}; - - MultiMonitors.copyClass(Calendar.CalendarMessageList, MultiMonitorsCalendarMessageList); - return GObject.registerClass(MultiMonitorsCalendarMessageList); -})(); - -var MultiMonitorsMessagesIndicator = (() => { - let MultiMonitorsMessagesIndicator = class MultiMonitorsMessagesIndicator extends St.Icon { - _init() { - super._init({ - icon_size: 16, - visible: false, - y_expand: true, - y_align: Clutter.ActorAlign.CENTER, - }); - - this._sources = []; - this._count = 0; - - this._settings = new Gio.Settings({ - schema_id: 'org.gnome.desktop.notifications', - }); - this._settings.connect('changed::show-banners', this._sync.bind(this)); - - this._sourceAddedId = Main.messageTray.connect('source-added', this._onSourceAdded.bind(this)); - this._sourceRemovedId = Main.messageTray.connect('source-removed', this._onSourceRemoved.bind(this)); - this._queueChangedId = Main.messageTray.connect('queue-changed', this._updateCount.bind(this)); - - let sources = Main.messageTray.getSources(); - sources.forEach(source => this._onSourceAdded(null, source)); - - this._sync(); - - this.connect('destroy', () => { - this._settings.run_dispose(); - this._settings = null; - Main.messageTray.disconnect(this._sourceAddedId); - Main.messageTray.disconnect(this._sourceRemovedId); - Main.messageTray.disconnect(this._queueChangedId); - }); - }}; - - MultiMonitors.copyClass(DateMenu.MessagesIndicator, MultiMonitorsMessagesIndicator); - return GObject.registerClass(MultiMonitorsMessagesIndicator); -})(); - -var MultiMonitorsDateMenuButton = (() => { - let MultiMonitorsDateMenuButton = class MultiMonitorsDateMenuButton extends PanelMenu.Button { - _init() { - let hbox; - let vbox; - - super._init(0.5); - - this._clockDisplay = new St.Label({ style_class: 'clock' }); - this._clockDisplay.clutter_text.y_align = Clutter.ActorAlign.CENTER; - this._clockDisplay.clutter_text.ellipsize = Pango.EllipsizeMode.NONE; - - this._indicator = new MultiMonitorsMessagesIndicator(); - - const indicatorPad = new St.Widget(); - this._indicator.bind_property('visible', - indicatorPad, 'visible', - GObject.BindingFlags.SYNC_CREATE); - indicatorPad.add_constraint(new Clutter.BindConstraint({ - source: this._indicator, - coordinate: Clutter.BindCoordinate.SIZE, - })); - - let box = new St.BoxLayout({ style_class: 'clock-display-box' }); - box.add_actor(indicatorPad); - box.add_actor(this._clockDisplay); - box.add_actor(this._indicator); - - this.label_actor = this._clockDisplay; - this.add_actor(box); - this.add_style_class_name('clock-display'); - - let layout = new DateMenu.FreezableBinLayout(); - let bin = new St.Widget({ layout_manager: layout }); - // For some minimal compatibility with PopupMenuItem - bin._delegate = this; - this.menu.box.add_child(bin); - - hbox = new St.BoxLayout({ name: 'calendarArea' }); - bin.add_actor(hbox); - - this._calendar = new MultiMonitorsCalendar(); - this._calendar.connect('selected-date-changed', (_calendar, datetime) => { - let date = DateMenu._gDateTimeToDate(datetime); - layout.frozen = !DateMenu._isToday(date); - this._eventsItem.setDate(date); - }); - this._date = new DateMenu.TodayButton(this._calendar); - - this.menu.connect('open-state-changed', (menu, isOpen) => { - // Whenever the menu is opened, select today - if (isOpen) { - let now = new Date(); - this._calendar.setDate(now); - this._date.setDate(now); - this._eventsItem.setDate(now); - } - }); - - // Fill up the first column - this._messageList = new MultiMonitorsCalendarMessageList(); - hbox.add_child(this._messageList); - - // Fill up the second column - const boxLayout = new DateMenu.CalendarColumnLayout([this._calendar, this._date]); - vbox = new St.Widget({ style_class: 'datemenu-calendar-column', - layout_manager: boxLayout }); - boxLayout.hookup_style(vbox); - hbox.add(vbox); - - vbox.add_actor(this._date); - vbox.add_actor(this._calendar); - - this._displaysSection = new St.ScrollView({ style_class: 'datemenu-displays-section vfade', - x_expand: true, - overlay_scrollbars: true }); - this._displaysSection.set_policy(St.PolicyType.NEVER, St.PolicyType.EXTERNAL); - vbox.add_actor(this._displaysSection); - - let displaysBox = new St.BoxLayout({ vertical: true, - x_expand: true, - style_class: 'datemenu-displays-box' }); - this._displaysSection.add_actor(displaysBox); - - this._eventsItem = new MultiMonitorsEventsSection(); - displaysBox.add_child(this._eventsItem); - - this._clock = new GnomeDesktop.WallClock(); - this._clock.bind_property('clock', this._clockDisplay, 'text', GObject.BindingFlags.SYNC_CREATE); - this._clockNotifyTimezoneId = this._clock.connect('notify::timezone', this._updateTimeZone.bind(this)); - - this._sessionModeUpdatedId = Main.sessionMode.connect('updated', this._sessionUpdated.bind(this)); - this._sessionUpdated(); - } - - _onDestroy() { - Main.sessionMode.disconnect(this._sessionModeUpdatedId); - this._clock.disconnect(this._clockNotifyTimezoneId); - super._onDestroy(); - }}; - - MultiMonitors.copyClass(DateMenu.DateMenuButton, MultiMonitorsDateMenuButton); - return GObject.registerClass(MultiMonitorsDateMenuButton); -})(); - diff --git a/multi-monitors-add-on/multi-monitors-add-on@spin83/mmlayout.js b/multi-monitors-add-on/multi-monitors-add-on@spin83/mmlayout.js deleted file mode 100644 index a354ec1..0000000 --- a/multi-monitors-add-on/multi-monitors-add-on@spin83/mmlayout.js +++ /dev/null @@ -1,251 +0,0 @@ -/** - * New node file - */ - -const { St, Meta } = imports.gi; - -const Main = imports.ui.main; -const Panel = imports.ui.panel; -const Layout = imports.ui.layout; - -const Config = imports.misc.config; - -const ExtensionUtils = imports.misc.extensionUtils; -const CE = ExtensionUtils.getCurrentExtension(); -const Convenience = CE.imports.convenience; -const MultiMonitors = CE.imports.extension; -const MMPanel = CE.imports.mmpanel; - -var SHOW_PANEL_ID = 'show-panel'; -var ENABLE_HOT_CORNERS = 'enable-hot-corners'; - -const MultiMonitorsPanelBox = class MultiMonitorsPanelBox { - constructor(monitor) { - this.panelBox = new St.BoxLayout({ name: 'panelBox', vertical: true, clip_to_allocation: true }); - Main.layoutManager.addChrome(this.panelBox, { affectsStruts: true, trackFullscreen: true }); - this.panelBox.set_position(monitor.x, monitor.y); - this.panelBox.set_size(monitor.width, -1); - Main.uiGroup.set_child_below_sibling(this.panelBox, Main.layoutManager.panelBox); - } - - destroy() { - this.panelBox.destroy(); - } - - updatePanel(monitor) { - this.panelBox.set_position(monitor.x, monitor.y); - this.panelBox.set_size(monitor.width, -1); - } -}; - -var MultiMonitorsLayoutManager = class MultiMonitorsLayoutManager { - constructor() { - this._settings = Convenience.getSettings(); - this._desktopSettings = Convenience.getSettings("org.gnome.desktop.interface"); - - Main.mmPanel = []; - - this._monitorIds = []; - this.mmPanelBox = []; - this.mmappMenu = false; - - this._showAppMenuId = null; - this._monitorsChangedId = null; - - this.statusIndicatorsController = null; - this._layoutManager_updateHotCorners = null; - this._changedEnableHotCornersId = null; - } - - showPanel() { - if (this._settings.get_boolean(SHOW_PANEL_ID)) { - if (!this._monitorsChangedId) { - this._monitorsChangedId = Main.layoutManager.connect('monitors-changed', this._monitorsChanged.bind(this)); - this._monitorsChanged(); - } - if (!this._showAppMenuId) { - this._showAppMenuId = this._settings.connect('changed::'+MMPanel.SHOW_APP_MENU_ID, this._showAppMenu.bind(this)); - } - - if (!this.statusIndicatorsController) { - this.statusIndicatorsController = new MMPanel.StatusIndicatorsController(); - } - - if (!this._layoutManager_updateHotCorners) { - this._layoutManager_updateHotCorners = Main.layoutManager._updateHotCorners; - - const _this = this; - Main.layoutManager._updateHotCorners = function() { - this.hotCorners.forEach((corner) => { - if (corner) - corner.destroy(); - }); - this.hotCorners = []; - - if (!_this._desktopSettings.get_boolean(ENABLE_HOT_CORNERS)) { - this.emit('hot-corners-changed'); - return; - } - - let size = this.panelBox.height; - - for (let i = 0; i < this.monitors.length; i++) { - let monitor = this.monitors[i]; - let cornerX = this._rtl ? monitor.x + monitor.width : monitor.x; - let cornerY = monitor.y; - - let corner = new Layout.HotCorner(this, monitor, cornerX, cornerY); - corner.setBarrierSize(size); - this.hotCorners.push(corner); - } - - this.emit('hot-corners-changed'); - }; - - if (!this._changedEnableHotCornersId) { - this._changedEnableHotCornersId = this._desktopSettings.connect('changed::'+ENABLE_HOT_CORNERS, - Main.layoutManager._updateHotCorners.bind(Main.layoutManager)); - } - - Main.layoutManager._updateHotCorners(); - } - } - else { - this.hidePanel(); - } - } - - hidePanel() { - if (this._changedEnableHotCornersId) { - global.settings.disconnect(this._changedEnableHotCornersId); - this._changedEnableHotCornersId = null; - } - - if (this._layoutManager_updateHotCorners) { - Main.layoutManager['_updateHotCorners'] = this._layoutManager_updateHotCorners; - this._layoutManager_updateHotCorners = null; - Main.layoutManager._updateHotCorners(); - } - - if (this.statusIndicatorsController) { - this.statusIndicatorsController.destroy(); - this.statusIndicatorsController = null; - } - - if (this._showAppMenuId) { - this._settings.disconnect(this._showAppMenuId); - this._showAppMenuId = null; - } - this._hideAppMenu(); - - if (this._monitorsChangedId) { - Main.layoutManager.disconnect(this._monitorsChangedId); - this._monitorsChangedId = null; - } - - let panels2remove = this._monitorIds.length; - for (let i = 0; i < panels2remove; i++) { - let monitorId = this._monitorIds.pop(); - this._popPanel(); - global.log("remove: "+monitorId); - } - } - - _monitorsChanged () { - let monitorChange = Main.layoutManager.monitors.length - this._monitorIds.length -1; - if (monitorChange<0) { - for (let idx = 0; idx<-monitorChange; idx++) { - let monitorId = this._monitorIds.pop(); - this._popPanel(); - global.log("remove: "+monitorId); - } - } - - let j = 0; - let tIndicators = false; - for (let i = 0; i < Main.layoutManager.monitors.length; i++) { - if (i!=Main.layoutManager.primaryIndex) { - let monitor = Main.layoutManager.monitors[i]; - let monitorId = "i"+i+"x"+monitor.x+"y"+monitor.y+"w"+monitor.width+"h"+monitor.height; - if (monitorChange>0 && j==this._monitorIds.length) { - this._monitorIds.push(monitorId); - this._pushPanel(i, monitor); - global.log("new: "+monitorId); - tIndicators = true; - } - else if (this._monitorIds[j]>monitorId || this._monitorIds[j]"+monitorId); - } - j++; - } - } - this._showAppMenu(); - if (tIndicators && this.statusIndicatorsController) { - this.statusIndicatorsController.transferIndicators(); - } - } - - _pushPanel(i, monitor) { - let mmPanelBox = new MultiMonitorsPanelBox(monitor); - let panel = new MMPanel.MultiMonitorsPanel(i, mmPanelBox); - - Main.mmPanel.push(panel); - this.mmPanelBox.push(mmPanelBox); - } - - _popPanel() { - let panel = Main.mmPanel.pop(); - if (this.statusIndicatorsController) { - this.statusIndicatorsController.transferBack(panel); - } - let mmPanelBox = this.mmPanelBox.pop(); - mmPanelBox.destroy(); - } - - _changeMainPanelAppMenuButton(appMenuButton) { - let role = "appMenu"; - let panel = Main.panel; - let indicator = panel.statusArea[role]; - panel.menuManager.removeMenu(indicator.menu); - indicator.destroy(); - if (indicator._actionGroupNotifyId) { - indicator._targetApp.disconnect(indicator._actionGroupNotifyId); - indicator._actionGroupNotifyId = 0; - } - if (indicator._busyNotifyId) { - indicator._targetApp.disconnect(indicator._busyNotifyId); - indicator._busyNotifyId = 0; - } - if (indicator.menu._windowsChangedId) { - indicator.menu._app.disconnect(indicator.menu._windowsChangedId); - indicator.menu._windowsChangedId = 0; - } - indicator = new appMenuButton(panel); - panel.statusArea[role] = indicator; - let box = panel._leftBox; - panel._addToPanelBox(role, indicator, box.get_n_children()+1, box); - } - - _showAppMenu() { - if (this._settings.get_boolean(MMPanel.SHOW_APP_MENU_ID) && Main.mmPanel.length>0) { - if (!this.mmappMenu) { - this._changeMainPanelAppMenuButton(MMPanel.MultiMonitorsAppMenuButton); - this.mmappMenu = true; - } - } - else { - this._hideAppMenu(); - } - } - - _hideAppMenu() { - if (this.mmappMenu) { - this._changeMainPanelAppMenuButton(Panel.AppMenuButton); - this.mmappMenu = false; - Main.panel._updatePanel() - } - } -}; diff --git a/multi-monitors-add-on/multi-monitors-add-on@spin83/mmoverview.js b/multi-monitors-add-on/multi-monitors-add-on@spin83/mmoverview.js deleted file mode 100644 index b7555d2..0000000 --- a/multi-monitors-add-on/multi-monitors-add-on@spin83/mmoverview.js +++ /dev/null @@ -1,678 +0,0 @@ -/* -Copyright (C) 2014 spin83 - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, visit https://www.gnu.org/licenses/. -*/ - -const { Clutter, GObject, St, Shell, GLib, Gio, Meta } = imports.gi; - -const Main = imports.ui.main; -const Params = imports.misc.params; -const WorkspaceThumbnail = imports.ui.workspaceThumbnail; -const OverviewControls = imports.ui.overviewControls; -const Overview = imports.ui.overview; -const SearchController = imports.ui.searchController; -const LayoutManager = imports.ui.layout; -const Background = imports.ui.background; -const WorkspacesView = imports.ui.workspacesView; - -const ExtensionUtils = imports.misc.extensionUtils; -const CE = ExtensionUtils.getCurrentExtension(); -const MultiMonitors = CE.imports.extension; -const Convenience = CE.imports.convenience; - -const THUMBNAILS_SLIDER_POSITION_ID = 'thumbnails-slider-position'; - -var MultiMonitorsWorkspaceThumbnail = (() => { - let MultiMonitorsWorkspaceThumbnail = class MultiMonitorsWorkspaceThumbnail extends St.Widget { - _init(metaWorkspace, monitorIndex) { - super._init({ - clip_to_allocation: true, - style_class: 'workspace-thumbnail', - }); - this._delegate = this; - - this.metaWorkspace = metaWorkspace; - this.monitorIndex = monitorIndex; - - this._removed = false; - - this._contents = new Clutter.Actor(); - this.add_child(this._contents); - - this.connect('destroy', this._onDestroy.bind(this)); - - this._createBackground(); - - let workArea = Main.layoutManager.getWorkAreaForMonitor(this.monitorIndex); - this.setPorthole(workArea.x, workArea.y, workArea.width, workArea.height); - - let windows = global.get_window_actors().filter(actor => { - let win = actor.meta_window; - return win.located_on_workspace(metaWorkspace); - }); - - // Create clones for windows that should be visible in the Overview - this._windows = []; - this._allWindows = []; - this._minimizedChangedIds = []; - for (let i = 0; i < windows.length; i++) { - let minimizedChangedId = - windows[i].meta_window.connect('notify::minimized', - this._updateMinimized.bind(this)); - this._allWindows.push(windows[i].meta_window); - this._minimizedChangedIds.push(minimizedChangedId); - - if (this._isMyWindow(windows[i]) && this._isOverviewWindow(windows[i])) - this._addWindowClone(windows[i]); - } - - // Track window changes - this._windowAddedId = this.metaWorkspace.connect('window-added', - this._windowAdded.bind(this)); - this._windowRemovedId = this.metaWorkspace.connect('window-removed', - this._windowRemoved.bind(this)); - this._windowEnteredMonitorId = global.display.connect('window-entered-monitor', - this._windowEnteredMonitor.bind(this)); - this._windowLeftMonitorId = global.display.connect('window-left-monitor', - this._windowLeftMonitor.bind(this)); - - this.state = WorkspaceThumbnail.ThumbnailState.NORMAL; - this._slidePosition = 0; // Fully slid in - this._collapseFraction = 0; // Not collapsed - } - - _createBackground() { - this._bgManager = new Background.BackgroundManager({ monitorIndex: this.monitorIndex, - container: this._contents, - vignette: false }); - }}; - - MultiMonitors.copyClass(WorkspaceThumbnail.WorkspaceThumbnail, MultiMonitorsWorkspaceThumbnail); - return GObject.registerClass({ - Properties: { - 'collapse-fraction': GObject.ParamSpec.double( - 'collapse-fraction', 'collapse-fraction', 'collapse-fraction', - GObject.ParamFlags.READWRITE, - 0, 1, 0), - 'slide-position': GObject.ParamSpec.double( - 'slide-position', 'slide-position', 'slide-position', - GObject.ParamFlags.READWRITE, - 0, 1, 0), - }, - }, MultiMonitorsWorkspaceThumbnail); -})(); - -const MultiMonitorsThumbnailsBox = (() => { - let MultiMonitorsThumbnailsBox = class MultiMonitorsThumbnailsBox extends St.Widget { - _init(scrollAdjustment, monitorIndex) { - - super._init({ reactive: true, - style_class: 'workspace-thumbnails', - request_mode: Clutter.RequestMode.WIDTH_FOR_HEIGHT }); - - this._delegate = this; - this._monitorIndex = monitorIndex; - - let indicator = new St.Bin({ style_class: 'workspace-thumbnail-indicator' }); - - // We don't want the indicator to affect drag-and-drop - Shell.util_set_hidden_from_pick(indicator, true); - - this._indicator = indicator; - this.add_actor(indicator); - - // The porthole is the part of the screen we're showing in the thumbnails - this._porthole = { width: global.stage.width, height: global.stage.height, - x: global.stage.x, y: global.stage.y }; - - this._dropWorkspace = -1; - this._dropPlaceholderPos = -1; - this._dropPlaceholder = new St.Bin({ style_class: 'placeholder' }); - this.add_actor(this._dropPlaceholder); - this._spliceIndex = -1; - - this._targetScale = 0; - this._scale = 0; - this._pendingScaleUpdate = false; - this._stateUpdateQueued = false; - this._animatingIndicator = false; - - this._stateCounts = {}; - for (let key in WorkspaceThumbnail.ThumbnailState) - this._stateCounts[WorkspaceThumbnail.ThumbnailState[key]] = 0; - - this._thumbnails = []; - - this._showingId = Main.overview.connect('showing', - this._createThumbnails.bind(this)); - this._hiddenId = Main.overview.connect('hidden', - this._destroyThumbnails.bind(this)); - - this._itemDragBeginId = Main.overview.connect('item-drag-begin', - this._onDragBegin.bind(this)); - this._itemDragEndId = Main.overview.connect('item-drag-end', - this._onDragEnd.bind(this)); - this._itemDragCancelledId = Main.overview.connect('item-drag-cancelled', - this._onDragCancelled.bind(this)); - this._windowDragBeginId = Main.overview.connect('window-drag-begin', - this._onDragBegin.bind(this)); - this._windowDragEndId = Main.overview.connect('window-drag-end', - this._onDragEnd.bind(this)); - this._windowDragCancelledId = Main.overview.connect('window-drag-cancelled', - this._onDragCancelled.bind(this)); - - this._settings = new Gio.Settings({ schema_id: WorkspaceThumbnail.MUTTER_SCHEMA }); - this._changedDynamicWorkspacesId = this._settings.connect('changed::dynamic-workspaces', - this._updateSwitcherVisibility.bind(this)); - - this._monitorsChangedId = Main.layoutManager.connect('monitors-changed', () => { - this._destroyThumbnails(); - if (Main.overview.visible) - this._createThumbnails(); - }); - - this._workareasChangedPortholeId = global.display.connect('workareas-changed', - this._updatePorthole.bind(this)); - - this._switchWorkspaceNotifyId = 0; - this._nWorkspacesNotifyId = 0; - this._syncStackingId = 0; - this._workareasChangedId = 0; - - this._scrollAdjustment = scrollAdjustment; - - this._scrollAdjustmentNotifyValueId = this._scrollAdjustment.connect('notify::value', adj => { - let workspaceManager = global.workspace_manager; - let activeIndex = workspaceManager.get_active_workspace_index(); - - this._animatingIndicator = adj.value !== activeIndex; - - if (!this._animatingIndicator) - this._queueUpdateStates(); - - this.queue_relayout(); - }); - - this.connect('destroy', this._onDestroy.bind(this)); - } - - _onDestroy() { - this._destroyThumbnails(); - this._scrollAdjustment.disconnect(this._scrollAdjustmentNotifyValueId); - Main.overview.disconnect(this._showingId); - Main.overview.disconnect(this._hiddenId); - - Main.overview.disconnect(this._itemDragBeginId); - Main.overview.disconnect(this._itemDragEndId); - Main.overview.disconnect(this._itemDragCancelledId); - Main.overview.disconnect(this._windowDragBeginId); - Main.overview.disconnect(this._windowDragEndId); - Main.overview.disconnect(this._windowDragCancelledId); - - this._settings.disconnect(this._changedDynamicWorkspacesId); - Main.layoutManager.disconnect(this._monitorsChangedId); - global.display.disconnect(this._workareasChangedPortholeId); - } - - addThumbnails(start, count) { - let workspaceManager = global.workspace_manager; - - for (let k = start; k < start + count; k++) { - let metaWorkspace = workspaceManager.get_workspace_by_index(k); - let thumbnail = new MultiMonitorsWorkspaceThumbnail(metaWorkspace, this._monitorIndex); - thumbnail.setPorthole(this._porthole.x, this._porthole.y, - this._porthole.width, this._porthole.height); - this._thumbnails.push(thumbnail); - this.add_actor(thumbnail); - - if (start > 0 && this._spliceIndex == -1) { - // not the initial fill, and not splicing via DND - thumbnail.state = WorkspaceThumbnail.ThumbnailState.NEW; - thumbnail.slide_position = 1; // start slid out - this._haveNewThumbnails = true; - } else { - thumbnail.state = WorkspaceThumbnail.ThumbnailState.NORMAL; - } - - this._stateCounts[thumbnail.state]++; - } - - this._queueUpdateStates(); - - // The thumbnails indicator actually needs to be on top of the thumbnails - this.set_child_above_sibling(this._indicator, null); - - // Clear the splice index, we got the message - this._spliceIndex = -1; - } - - _updatePorthole() { - this._porthole = Main.layoutManager.getWorkAreaForMonitor(this._monitorIndex); - this.queue_relayout(); - }}; - - MultiMonitors.copyClass(WorkspaceThumbnail.ThumbnailsBox, MultiMonitorsThumbnailsBox); - return GObject.registerClass({ - Properties: { - 'indicator-y': GObject.ParamSpec.double( - 'indicator-y', 'indicator-y', 'indicator-y', - GObject.ParamFlags.READWRITE, - 0, Infinity, 0), - 'scale': GObject.ParamSpec.double( - 'scale', 'scale', 'scale', - GObject.ParamFlags.READWRITE, - 0, Infinity, 0), - }, - }, MultiMonitorsThumbnailsBox); -})(); - -/* This isn't compatible with GNOME 40 and i don't know how to fix it -- TH -var MultiMonitorsSlidingControl = (() => { - let MultiMonitorsSlidingControl = class MultiMonitorsSlidingControl extends St.Widget { - _init(params) { - params = Params.parse(params, { slideDirection: OverviewControls.SlideDirection.LEFT }); - - this.layout = new OverviewControls.SlideLayout(); - this.layout.slideDirection = params.slideDirection; - super._init({ - layout_manager: this.layout, - style_class: 'overview-controls', - clip_to_allocation: true, - }); - - this._visible = true; - this._inDrag = false; - - this.connect('destroy', this._onDestroy.bind(this)); - this._hidingId = Main.overview.connect('hiding', this._onOverviewHiding.bind(this)); - - this._itemDragBeginId = Main.overview.connect('item-drag-begin', this._onDragBegin.bind(this)); - this._itemDragEndId = Main.overview.connect('item-drag-end', this._onDragEnd.bind(this)); - this._itemDragCancelledId = Main.overview.connect('item-drag-cancelled', this._onDragEnd.bind(this)); - - this._windowDragBeginId = Main.overview.connect('window-drag-begin', this._onWindowDragBegin.bind(this)); - this._windowDragCancelledId = Main.overview.connect('window-drag-cancelled', this._onWindowDragEnd.bind(this)); - this._windowDragEndId = Main.overview.connect('window-drag-end', this._onWindowDragEnd.bind(this)); - } - - _onDestroy() { - Main.overview.disconnect(this._hidingId); - - Main.overview.disconnect(this._itemDragBeginId); - Main.overview.disconnect(this._itemDragEndId); - Main.overview.disconnect(this._itemDragCancelledId); - - Main.overview.disconnect(this._windowDragBeginId); - Main.overview.disconnect(this._windowDragCancelledId); - Main.overview.disconnect(this._windowDragEndId); - }}; - - MultiMonitors.copyClass(OverviewControls.SlidingControl, MultiMonitorsSlidingControl); - return GObject.registerClass(MultiMonitorsSlidingControl); -})(); - -var MultiMonitorsThumbnailsSlider = (() => { - let MultiMonitorsThumbnailsSlider = class MultiMonitorsThumbnailsSlider extends MultiMonitorsSlidingControl { - _init(thumbnailsBox) { - super._init({ slideDirection: OverviewControls.SlideDirection.RIGHT }); - - this._thumbnailsBox = thumbnailsBox; - - this.request_mode = Clutter.RequestMode.WIDTH_FOR_HEIGHT; - this.reactive = true; - this.track_hover = true; - this.add_actor(this._thumbnailsBox); - - this._monitorsChangedId = Main.layoutManager.connect('monitors-changed', this._updateSlide.bind(this)); - this._activeWorkspaceChangedId = global.workspace_manager.connect('active-workspace-changed', - this._updateSlide.bind(this)); - this._notifyNWorkspacesId = global.workspace_manager.connect('notify::n-workspaces', - this._updateSlide.bind(this)); - this.connect('notify::hover', this._updateSlide.bind(this)); - this._thumbnailsBox.bind_property('visible', this, 'visible', GObject.BindingFlags.SYNC_CREATE); - } - - _onDestroy() { - global.workspace_manager.disconnect(this._activeWorkspaceChangedId); - global.workspace_manager.disconnect(this._notifyNWorkspacesId); - Main.layoutManager.disconnect(this._monitorsChangedId); - super._onDestroy(); - }}; - - MultiMonitors.copyClass(OverviewControls.ThumbnailsSlider, MultiMonitorsThumbnailsSlider); - return GObject.registerClass(MultiMonitorsThumbnailsSlider); -})(); -*/ - -var MultiMonitorsControlsManager = GObject.registerClass( -class MultiMonitorsControlsManager extends St.Widget { - _init(index) { - this._monitorIndex = index; - this._workspacesViews = null; - this._spacer_height = 0; - this._fixGeometry = 0; - this._visible = false; - - let layout - if (OverviewControls.ControlsManagerLayout) { - layout = new OverviewControls.ControlsManagerLayout(); - } else { - layout = new OverviewControls.ControlsLayout(); - } - super._init({ - layout_manager: layout, - x_expand: true, - y_expand: true, - clip_to_allocation: true, - }); - - this._workspaceAdjustment = Main.overview._overview._controls._workspaceAdjustment; - - this._thumbnailsBox = - new MultiMonitorsThumbnailsBox(this._workspaceAdjustment, this._monitorIndex); - //this._thumbnailsSlider = new MultiMonitorsThumbnailsSlider(this._thumbnailsBox); - - this._searchController = new St.Widget({ visible: false, x_expand: true, y_expand: true, clip_to_allocation: true }); - this._pageChangedId = Main.overview.searchController.connect('page-changed', this._setVisibility.bind(this)); - this._pageEmptyId = Main.overview.searchController.connect('page-empty', this._onPageEmpty.bind(this)); - - this._group = new St.BoxLayout({ name: 'mm-overview-group-'+index, - x_expand: true, y_expand: true }); - this.add_actor(this._group); - - this._group.add_child(this._searchController); - //this._group.add_actor(this._thumbnailsSlider); - - this._settings = Convenience.getSettings(); - - this._monitorsChanged(); - //this._thumbnailsSlider.slideOut(); - this._thumbnailsBox._updatePorthole(); - - this.connect('notify::allocation', this._updateSpacerVisibility.bind(this)); - this.connect('destroy', this._onDestroy.bind(this)); - //this._thumbnailsSelectSideId = this._settings.connect('changed::'+THUMBNAILS_SLIDER_POSITION_ID, - // this._thumbnailsSelectSide.bind(this)); - this._monitorsChangedId = Main.layoutManager.connect('monitors-changed', this._monitorsChanged.bind(this)); - } - - _onDestroy() { - Main.overview.searchController.disconnect(this._pageChangedId); - Main.overview.searchController.disconnect(this._pageEmptyId); - this._settings.disconnect(this._thumbnailsSelectSideId); - Main.layoutManager.disconnect(this._monitorsChangedId); - } - - _monitorsChanged() { - this._primaryMonitorOnTheLeft = Main.layoutManager.monitors[this._monitorIndex].x > Main.layoutManager.primaryMonitor.x; - this._thumbnailsSelectSide(); - } - - /* - _thumbnailsSelectSide() { - let thumbnailsSlider; - thumbnailsSlider = this._thumbnailsSlider; - - let sett = this._settings.get_string(THUMBNAILS_SLIDER_POSITION_ID); - let onLeftSide = sett === 'left' || (sett === 'auto' && this._primaryMonitorOnTheLeft); - - if (onLeftSide) { - let first = this._group.get_first_child(); - if (first != thumbnailsSlider) { - this._thumbnailsSlider.layout.slideDirection = OverviewControls.SlideDirection.LEFT; - this._thumbnailsBox.remove_style_class_name('workspace-thumbnails'); - this._thumbnailsBox.set_style_class_name('workspace-thumbnails workspace-thumbnails-left'); - this._group.set_child_below_sibling(thumbnailsSlider, first) - } - } - else { - let last = this._group.get_last_child(); - if (last != thumbnailsSlider) { - this._thumbnailsSlider.layout.slideDirection = OverviewControls.SlideDirection.RIGHT; - this._thumbnailsBox.remove_style_class_name('workspace-thumbnails workspace-thumbnails-left'); - this._thumbnailsBox.set_style_class_name('workspace-thumbnails'); - this._group.set_child_above_sibling(thumbnailsSlider, last); - } - } - this._fixGeometry = 3; - } - */ - - _updateSpacerVisibility() { - if (Main.layoutManager.monitors.length { - this._searchController.visible = false; - }, - }); - this._workspacesViews = null; - } -}); - -var MultiMonitorsOverviewActor = GObject.registerClass( -class MultiMonitorsOverviewActor extends St.BoxLayout { - _init(index) { - this._monitorIndex = index; - super._init({ - name: 'mm-overview-'+index, - /* Translators: This is the main view to select - activities. See also note for "Activities" string. */ - accessible_name: _("MMOverview@"+index), - vertical: true, - }); - - this.add_constraint(new LayoutManager.MonitorConstraint({ index: this._monitorIndex })); - - this._panelGhost = null; - if (Main.mmPanel) { - for (let idx in Main.mmPanel) { - if (Main.mmPanel[idx].monitorIndex !== this._monitorIndex) - continue - // Add a clone of the panel to the overview so spacing and such is - // automatic - this._panelGhost = new St.Bin({ - child: new Clutter.Clone({ source: Main.mmPanel[idx] }), - reactive: false, - opacity: 0, - }); - this.add_actor(this._panelGhost); - break; - } - } - - this._spacer = new St.Widget(); - this.add_actor(this._spacer); - - this._controls = new MultiMonitorsControlsManager(this._monitorIndex); - - // Add our same-line elements after the search entry - this.add_child(this._controls); - } -}); - - -var MultiMonitorsOverview = class MultiMonitorsOverview { - constructor(index) { - this.monitorIndex = index; - - this._initCalled = true; - this._overview = new MultiMonitorsOverviewActor(this.monitorIndex); - this._overview._delegate = this; - this._overview.connect('destroy', this._onDestroy.bind(this)); - Main.layoutManager.overviewGroup.add_child(this._overview); - - this._showingId = Main.overview.connect('showing', this._show.bind(this)); - this._hidingId = Main.overview.connect('hiding', this._hide.bind(this)); - } - - getWorkspacesActualGeometry() { - return this._overview._controls.getWorkspacesActualGeometry(); - } - - _onDestroy() { - Main.overview.disconnect(this._showingId); - Main.overview.disconnect(this._hidingId); - - Main.layoutManager.overviewGroup.remove_child(this._overview); - this._overview._delegate = null; - } - - _show() { - this._overview._controls.show(); - } - - _hide() { - this._overview._controls.hide(); - } - - destroy() { - this._overview.destroy(); - } - - addAction(action) { - this._overview.add_action(action); - } - - removeAction(action) { - if (action.get_actor()) - this._overview.remove_action(action); - } -}; diff --git a/multi-monitors-add-on/multi-monitors-add-on@spin83/mmpanel.js b/multi-monitors-add-on/multi-monitors-add-on@spin83/mmpanel.js deleted file mode 100644 index a381f15..0000000 --- a/multi-monitors-add-on/multi-monitors-add-on@spin83/mmpanel.js +++ /dev/null @@ -1,520 +0,0 @@ -/* -Copyright (C) 2014 spin83 - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, visit https://www.gnu.org/licenses/. -*/ - -const { St, Shell, Meta, Atk, Clutter, GObject } = imports.gi; - -const Main = imports.ui.main; -const Panel = imports.ui.panel; -const PopupMenu = imports.ui.popupMenu; -const PanelMenu = imports.ui.panelMenu; -const CtrlAltTab = imports.ui.ctrlAltTab; -const ExtensionSystem = imports.ui.extensionSystem; - -const ExtensionUtils = imports.misc.extensionUtils; -const CE = ExtensionUtils.getCurrentExtension(); -const MultiMonitors = CE.imports.extension; -const Convenience = CE.imports.convenience; -const MMCalendar = CE.imports.mmcalendar; - -const SHOW_ACTIVITIES_ID = 'show-activities'; -var SHOW_APP_MENU_ID = 'show-app-menu'; -const SHOW_DATE_TIME_ID = 'show-date-time'; -const AVAILABLE_INDICATORS_ID = 'available-indicators'; -const TRANSFER_INDICATORS_ID = 'transfer-indicators'; - -var StatusIndicatorsController = class StatusIndicatorsController { - constructor() { - this._transfered_indicators = []; - this._settings = Convenience.getSettings(); - - this._updatedSessionId = Main.sessionMode.connect('updated', this._updateSessionIndicators.bind(this)); - this._updateSessionIndicators(); - this._extensionStateChangedId = Main.extensionManager.connect('extension-state-changed', - this._extensionStateChanged.bind(this)); - - this._transferIndicatorsId = this._settings.connect('changed::'+TRANSFER_INDICATORS_ID, - this.transferIndicators.bind(this)); - } - - destroy() { - this._settings.disconnect(this._transferIndicatorsId); - Main.extensionManager.disconnect(this._extensionStateChangedId); - Main.sessionMode.disconnect(this._updatedSessionId); - this._settings.set_strv(AVAILABLE_INDICATORS_ID, []); - this._transferBack(this._transfered_indicators); - } - - transferBack(panel) { - let transfer_back = this._transfered_indicators.filter((element) => { - return element.monitor==panel.monitorIndex; - }); - - this._transferBack(transfer_back, panel); - } - - transferIndicators() { - let boxs = ['_leftBox', '_centerBox', '_rightBox']; - let transfers = this._settings.get_value(TRANSFER_INDICATORS_ID).deep_unpack(); - let show_app_menu = this._settings.get_value(SHOW_APP_MENU_ID); - - let transfer_back = this._transfered_indicators.filter((element) => { - return !transfers.hasOwnProperty(element.iname); - }); - - this._transferBack(transfer_back); - - for(let iname in transfers) { - if(transfers.hasOwnProperty(iname) && Main.panel.statusArea[iname]) { - let monitor = transfers[iname]; - - let indicator = Main.panel.statusArea[iname]; - let panel = this._findPanel(monitor); - boxs.forEach((box) => { - if(Main.panel[box].contains(indicator.container) && panel) { - global.log('a '+box+ " > " + iname + " : "+ monitor); - this._transfered_indicators.push({iname:iname, box:box, monitor:monitor}); - Main.panel[box].remove_child(indicator.container); - if (show_app_menu && box === '_leftBox') - panel[box].insert_child_at_index(indicator.container, 1); - else - panel[box].insert_child_at_index(indicator.container, 0); - } - }); - } - } - } - - _findPanel(monitor) { - for (let i = 0; i < Main.mmPanel.length; i++) { - if (Main.mmPanel[i].monitorIndex == monitor) { - return Main.mmPanel[i]; - } - } - return null; - } - - _transferBack(transfer_back, panel) { - transfer_back.forEach((element) => { - this._transfered_indicators.splice(this._transfered_indicators.indexOf(element)); - if(Main.panel.statusArea[element.iname]) { - let indicator = Main.panel.statusArea[element.iname]; - if(!panel) { - panel = this._findPanel(element.monitor); - } - if(panel[element.box].contains(indicator.container)) { - global.log("r "+element.box+ " > " + element.iname + " : "+ element.monitor); - panel[element.box].remove_child(indicator.container); - if (element.box === '_leftBox') - Main.panel[element.box].insert_child_at_index(indicator.container, 1); - else - Main.panel[element.box].insert_child_at_index(indicator.container, 0); - } - } - }); - } - - _extensionStateChanged() { - this._findAvailableIndicators(); - this.transferIndicators(); - } - - _updateSessionIndicators() { - let session_indicators = []; - session_indicators.push('MultiMonitorsAddOn'); - let sessionPanel = Main.sessionMode.panel; - for (let sessionBox in sessionPanel){ - sessionPanel[sessionBox].forEach((sesionIndicator) => { - session_indicators.push(sesionIndicator); - }); - } - this._session_indicators = session_indicators; - this._available_indicators = []; - - this._findAvailableIndicators(); - this.transferIndicators(); - } - - _findAvailableIndicators() { - let available_indicators = []; - let statusArea = Main.panel.statusArea; - for(let indicator in statusArea) { - if(statusArea.hasOwnProperty(indicator) && this._session_indicators.indexOf(indicator)<0){ - available_indicators.push(indicator); - } - } - if(available_indicators.length!=this._available_indicators.length) { - this._available_indicators = available_indicators; -// global.log(this._available_indicators); - this._settings.set_strv(AVAILABLE_INDICATORS_ID, this._available_indicators); - } - } -}; - -var MultiMonitorsAppMenuButton = (() => { - let MultiMonitorsAppMenuButton = class MultiMonitorsAppMenuButton extends PanelMenu.Button { - _init(panel) { - if (panel.monitorIndex==undefined) - this._monitorIndex = Main.layoutManager.primaryIndex; - else - this._monitorIndex = panel.monitorIndex; - this._actionOnWorkspaceGroupNotifyId = 0; - this._targetAppGroup = null; - this._lastFocusedWindow = null; - Panel.AppMenuButton.prototype._init.call(this, panel); - - this._windowEnteredMonitorId = global.display.connect('window-entered-monitor', - this._windowEnteredMonitor.bind(this)); - this._windowLeftMonitorId = global.display.connect('window-left-monitor', - this._windowLeftMonitor.bind(this)); - } - - _windowEnteredMonitor (metaScreen, monitorIndex, metaWin) { - if (monitorIndex == this._monitorIndex) { - switch(metaWin.get_window_type()){ - case Meta.WindowType.NORMAL: - case Meta.WindowType.DIALOG: - case Meta.WindowType.MODAL_DIALOG: - case Meta.WindowType.SPLASHSCREEN: - this._sync(); - break; - } - } - } - - _windowLeftMonitor (metaScreen, monitorIndex, metaWin) { - if (monitorIndex == this._monitorIndex) { - switch(metaWin.get_window_type()){ - case Meta.WindowType.NORMAL: - case Meta.WindowType.DIALOG: - case Meta.WindowType.MODAL_DIALOG: - case Meta.WindowType.SPLASHSCREEN: - this._sync(); - break; - } - } - } - - _findTargetApp() { - - if (this._actionOnWorkspaceGroupNotifyId) { - this._targetAppGroup.disconnect(this._actionOnWorkspaceGroupNotifyId); - this._actionOnWorkspaceGroupNotifyId = 0; - this._targetAppGroup = null; - } - let groupWindow = false; - let groupFocus = false; - - let workspaceManager = global.workspace_manager; - let workspace = workspaceManager.get_active_workspace(); - let tracker = Shell.WindowTracker.get_default(); - let focusedApp = tracker.focus_app; - if (focusedApp && focusedApp.is_on_workspace(workspace)){ - let windows = focusedApp.get_windows(); - for (let i = 0; i < windows.length; i++) { - let win = windows[i]; - if (win.located_on_workspace(workspace)){ - if (win.get_monitor() == this._monitorIndex){ - if (win.has_focus()){ - this._lastFocusedWindow = win; - // global.log(this._monitorIndex+": focus :"+win.get_title()+" : "+win.has_focus()); - return focusedApp; - } - else - groupWindow = true; - } - else { - if(win.has_focus()) - groupFocus = true; - } - if (groupFocus && groupWindow) { - if(focusedApp != this._targetApp){ - this._targetAppGroup = focusedApp; - this._actionOnWorkspaceGroupNotifyId = this._targetAppGroup.connect('notify::action-group', - this._sync.bind(this)); - // global.log(this._monitorIndex+": gConnect :"+win.get_title()+" : "+win.has_focus()); - } - break; - } - } - } - } - - for (let i = 0; i < this._startingApps.length; i++) - if (this._startingApps[i].is_on_workspace(workspace)){ - // global.log(this._monitorIndex+": newAppFocus"); - return this._startingApps[i]; - } - - if (this._lastFocusedWindow && this._lastFocusedWindow.located_on_workspace(workspace) && - this._lastFocusedWindow.get_monitor() == this._monitorIndex){ - // global.log(this._monitorIndex+": lastFocus :"+this._lastFocusedWindow.get_title()); - return tracker.get_window_app(this._lastFocusedWindow); - } - - let windows = global.display.get_tab_list(Meta.TabList.NORMAL_ALL, workspace); - - for (let i = 0; i < windows.length; i++) { - if(windows[i].get_monitor() == this._monitorIndex){ - this._lastFocusedWindow = windows[i]; - // global.log(this._monitorIndex+": appFind :"+windows[i].get_title()); - return tracker.get_window_app(windows[i]); - } - } - - return null; - } - - _sync() { - if (!this._switchWorkspaceNotifyId) - return; - Panel.AppMenuButton.prototype._sync.call(this); - } - - _onDestroy() { - if (this._actionGroupNotifyId) { - this._targetApp.disconnect(this._actionGroupNotifyId); - this._actionGroupNotifyId = 0; - } - - global.display.disconnect(this._windowEnteredMonitorId); - global.display.disconnect(this._windowLeftMonitorId); - - if (this._busyNotifyId) { - this._targetApp.disconnect(this._busyNotifyId); - this._busyNotifyId = 0; - } - - if (this.menu._windowsChangedId) { - this.menu._app.disconnect(this.menu._windowsChangedId); - this.menu._windowsChangedId = 0; - } - Panel.AppMenuButton.prototype._onDestroy.call(this); - } - }; - MultiMonitors.copyClass(Panel.AppMenuButton, MultiMonitorsAppMenuButton); - return GObject.registerClass({Signals: {'changed': {}},}, MultiMonitorsAppMenuButton); -})(); - -var MultiMonitorsActivitiesButton = (() => { - let MultiMonitorsActivitiesButton = class MultiMonitorsActivitiesButton extends PanelMenu.Button { - _init() { - super._init(0.0, null, true); - this.accessible_role = Atk.Role.TOGGLE_BUTTON; - - this.name = 'mmPanelActivities'; - - /* Translators: If there is no suitable word for "Activities" - in your language, you can use the word for "Overview". */ - this._label = new St.Label({ text: _("Activities"), - y_align: Clutter.ActorAlign.CENTER }); - this.add_actor(this._label); - - this.label_actor = this._label; - - this._showingId = Main.overview.connect('showing', () => { - this.add_style_pseudo_class('overview'); - this.add_accessible_state (Atk.StateType.CHECKED); - }); - this._hidingId = Main.overview.connect('hiding', () => { - this.remove_style_pseudo_class('overview'); - this.remove_accessible_state (Atk.StateType.CHECKED); - }); - - this._xdndTimeOut = 0; - } - - _onDestroy() { - Main.overview.disconnect(this._showingId); - Main.overview.disconnect(this._hidingId); - super._onDestroy(); - } - } - MultiMonitors.copyClass(Panel.ActivitiesButton, MultiMonitorsActivitiesButton); - return GObject.registerClass(MultiMonitorsActivitiesButton); -})(); - -const MULTI_MONITOR_PANEL_ITEM_IMPLEMENTATIONS = { - 'activities': MultiMonitorsActivitiesButton, - 'appMenu': MultiMonitorsAppMenuButton, - 'dateMenu': MMCalendar.MultiMonitorsDateMenuButton, -}; - -var MultiMonitorsPanel = (() => { - let MultiMonitorsPanel = class MultiMonitorsPanel extends St.Widget { - _init(monitorIndex, mmPanelBox) { - super._init({ name: 'panel', - reactive: true }); - - this.monitorIndex = monitorIndex; - - this.set_offscreen_redirect(Clutter.OffscreenRedirect.ALWAYS); - - this._sessionStyle = null; - - this.statusArea = {}; - - this.menuManager = new PopupMenu.PopupMenuManager(this); - - this._leftBox = new St.BoxLayout({ name: 'panelLeft' }); - this.add_child(this._leftBox); - this._centerBox = new St.BoxLayout({ name: 'panelCenter' }); - this.add_child(this._centerBox); - this._rightBox = new St.BoxLayout({ name: 'panelRight' }); - this.add_child(this._rightBox); - - this._showingId = Main.overview.connect('showing', () => { - this.add_style_pseudo_class('overview'); - }); - this._hidingId = Main.overview.connect('hiding', () => { - this.remove_style_pseudo_class('overview'); - }); - - mmPanelBox.panelBox.add(this); - Main.ctrlAltTabManager.addGroup(this, _("Top Bar"), 'focus-top-bar-symbolic', - { sortGroup: CtrlAltTab.SortGroup.TOP }); - - this._updatedId = Main.sessionMode.connect('updated', this._updatePanel.bind(this)); - - this._workareasChangedId = global.display.connect('workareas-changed', () => this.queue_relayout()); - this._updatePanel(); - - this._settings = Convenience.getSettings(); - this._showActivitiesId = this._settings.connect('changed::'+SHOW_ACTIVITIES_ID, - this._showActivities.bind(this)); - this._showActivities(); - - this._showAppMenuId = this._settings.connect('changed::'+SHOW_APP_MENU_ID, - this._showAppMenu.bind(this)); - this._showAppMenu(); - - this._showDateTimeId = this._settings.connect('changed::'+SHOW_DATE_TIME_ID, - this._showDateTime.bind(this)); - this._showDateTime(); - - this.connect('destroy', this._onDestroy.bind(this)); - } - - _onDestroy() { - global.display.disconnect(this._workareasChangedId); - Main.overview.disconnect(this._showingId); - Main.overview.disconnect(this._hidingId); - - this._settings.disconnect(this._showActivitiesId); - this._settings.disconnect(this._showAppMenuId); - this._settings.disconnect(this._showDateTimeId); - - Main.ctrlAltTabManager.removeGroup(this); - Main.sessionMode.disconnect(this._updatedId); - } - - _showActivities() { - let name = 'activities'; - if (this._settings.get_boolean(SHOW_ACTIVITIES_ID)) { - if (this.statusArea[name]) - this.statusArea[name].visible = true; - } - else { - if (this.statusArea[name]) - this.statusArea[name].visible = false; - } - } - - _showDateTime() { - let name = 'dateMenu'; - if (this._settings.get_boolean(SHOW_DATE_TIME_ID)) { - if (this.statusArea[name]) - this.statusArea[name].visible = true; - } - else { - if (this.statusArea[name]) - this.statusArea[name].visible = false; - } - } - - _showAppMenu() { - let name = 'appMenu'; - if (this._settings.get_boolean(SHOW_APP_MENU_ID)) { - if (!this.statusArea[name]) { - let indicator = new MultiMonitorsAppMenuButton(this); - this.statusArea[name] = indicator; - let box = this._leftBox; - this._addToPanelBox(name, indicator, box.get_n_children()+1, box); - } - } - else { - if (this.statusArea[name]) { - let indicator = this.statusArea[name]; - this.menuManager.removeMenu(indicator.menu); - indicator.destroy(); - delete this.statusArea[name]; - } - } - } - - vfunc_get_preferred_width(forHeight) { - if (Main.layoutManager.monitors.length>this.monitorIndex) - return [0, Main.layoutManager.monitors[this.monitorIndex].width]; - - return [0, 0]; - } - - _hideIndicators() { - for (let role in MULTI_MONITOR_PANEL_ITEM_IMPLEMENTATIONS) { - let indicator = this.statusArea[role]; - if (!indicator) - continue; - indicator.container.hide(); - } - } - - _ensureIndicator(role) { - let indicator = this.statusArea[role]; - if (indicator) { - indicator.container.show(); - return null; - } - else { - let constructor = MULTI_MONITOR_PANEL_ITEM_IMPLEMENTATIONS[role]; - if (!constructor) { - // This icon is not implemented (this is a bug) - return null; - } - indicator = new constructor(this); - this.statusArea[role] = indicator; - } - return indicator; - } - - _getDraggableWindowForPosition(stageX) { - let workspaceManager = global.workspace_manager; - const windows = workspaceManager.get_active_workspace().list_windows(); - const allWindowsByStacking = - global.display.sort_windows_by_stacking(windows).reverse(); - - return allWindowsByStacking.find(metaWindow => { - let rect = metaWindow.get_frame_rect(); - return metaWindow.get_monitor() == this.monitorIndex && - metaWindow.showing_on_its_workspace() && - metaWindow.get_window_type() != Meta.WindowType.DESKTOP && - metaWindow.maximized_vertically && - stageX > rect.x && stageX < rect.x + rect.width; - }); - }}; - - MultiMonitors.copyClass(Panel.Panel, MultiMonitorsPanel); - return GObject.registerClass(MultiMonitorsPanel); -})(); diff --git a/multi-monitors-add-on/multi-monitors-add-on@spin83/multi-monitors-add-on.pot b/multi-monitors-add-on/multi-monitors-add-on@spin83/multi-monitors-add-on.pot deleted file mode 100644 index 6b18906..0000000 --- a/multi-monitors-add-on/multi-monitors-add-on@spin83/multi-monitors-add-on.pot +++ /dev/null @@ -1,89 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the multi-monitors-add-on package. -# FIRST AUTHOR , YEAR. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: multi-monitors-add-on\n" -"Report-Msgid-Bugs-To: https://github.com/spin83/multi-monitors-add-on/" -"issues\n" -"POT-Creation-Date: 2019-10-04 04:44-0300\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"Language: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=CHARSET\n" -"Content-Transfer-Encoding: 8bit\n" - -#: indicator.js:46 -msgid "Preferences" -msgstr "" - -#: indicator.js:115 -msgid "Multi Monitors Add-On" -msgstr "" - -#: mmoverview.js:642 -msgid "Overview" -msgstr "" - -#. Translators: If there is no suitable word for "Activities" -#. in your language, you can use the word for "Overview". -#: mmpanel.js:333 -msgid "Activities" -msgstr "" - -#: mmpanel.js:414 -msgid "Top Bar" -msgstr "" - -#: prefs.js:62 -msgid "Show Multi Monitors indicator on Top Panel." -msgstr "" - -#: prefs.js:63 -msgid "Show Panel on additional monitors." -msgstr "" - -#: prefs.js:64 -msgid "Show Thumbnails-Slider on additional monitors." -msgstr "" - -#: prefs.js:65 -msgid "Show Activities-Button on additional monitors." -msgstr "" - -#: prefs.js:66 -msgid "Show AppMenu-Button on additional monitors." -msgstr "" - -#: prefs.js:67 -msgid "Show DateTime-Button on additional monitors." -msgstr "" - -#: prefs.js:68 -msgid "Show Thumbnails-Slider on left side of additional monitors." -msgstr "" - -#: prefs.js:77 -msgid "A list of indicators for transfer to additional monitors." -msgstr "" - -#: prefs.js:124 -msgid "Select indicator" -msgstr "" - -#: prefs.js:127 -msgid "Add" -msgstr "" - -#: prefs.js:141 -msgid "Indicators on Top Panel" -msgstr "" - -#: prefs.js:170 -msgid "Monitor index:" -msgstr "" diff --git a/multi-monitors-add-on/multi-monitors-add-on@spin83/prefs.js b/multi-monitors-add-on/multi-monitors-add-on@spin83/prefs.js deleted file mode 100644 index d1ba7ea..0000000 --- a/multi-monitors-add-on/multi-monitors-add-on@spin83/prefs.js +++ /dev/null @@ -1,289 +0,0 @@ -/* -Copyright (C) 2014 spin83 - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, visit https://www.gnu.org/licenses/. -*/ - -const Lang = imports.lang; - -const GObject = imports.gi.GObject; -const Gdk = imports.gi.Gdk; -const Gtk = imports.gi.Gtk; -const Gio = imports.gi.Gio; -const GLib = imports.gi.GLib; - -const Gettext = imports.gettext.domain('multi-monitors-add-on'); -const _ = Gettext.gettext; - -const ExtensionUtils = imports.misc.extensionUtils; -const MultiMonitors = ExtensionUtils.getCurrentExtension(); -const Convenience = MultiMonitors.imports.convenience; - -const SHOW_INDICATOR_ID = 'show-indicator'; -const SHOW_PANEL_ID = 'show-panel'; -const SHOW_ACTIVITIES_ID = 'show-activities'; -const SHOW_APP_MENU_ID = 'show-app-menu'; -const SHOW_DATE_TIME_ID = 'show-date-time'; -const THUMBNAILS_SLIDER_POSITION_ID = 'thumbnails-slider-position'; -const AVAILABLE_INDICATORS_ID = 'available-indicators'; -const TRANSFER_INDICATORS_ID = 'transfer-indicators'; -const ENABLE_HOT_CORNERS = 'enable-hot-corners'; - -const Columns = { - INDICATOR_NAME: 0, - MONITOR_NUMBER: 1 -}; - - -var MultiMonitorsPrefsWidget = GObject.registerClass( -class MultiMonitorsPrefsWidget extends Gtk.Grid { - _init() { - super._init({ - margin_top: 6, margin_end: 6, margin_bottom: 6, margin_start: 6 - }); - - this._numRows = 0; - - this.set_orientation(Gtk.Orientation.VERTICAL); - - this._settings = Convenience.getSettings(); - this._desktopSettings = Convenience.getSettings("org.gnome.desktop.interface"); - - this._display = Gdk.Display.get_default(); - this._monitors = this._display.get_monitors() - - this._addBooleanSwitch(_('Show Multi Monitors indicator on Top Panel.'), SHOW_INDICATOR_ID); - this._addBooleanSwitch(_('Show Panel on additional monitors.'), SHOW_PANEL_ID); - this._addBooleanSwitch(_('Show Activities-Button on additional monitors.'), SHOW_ACTIVITIES_ID); - this._addBooleanSwitch(_('Show AppMenu-Button on additional monitors.'), SHOW_APP_MENU_ID); - this._addBooleanSwitch(_('Show DateTime-Button on additional monitors.'), SHOW_DATE_TIME_ID); - this._addComboBoxSwitch(_('Show Thumbnails-Slider on additional monitors.'), THUMBNAILS_SLIDER_POSITION_ID, { - none: _('No'), - right: _('On the right'), - left: _('On the left'), - auto: _('Auto') - }); - this._addSettingsBooleanSwitch(_('Enable hot corners.'), this._desktopSettings, ENABLE_HOT_CORNERS); - - this._store = new Gtk.ListStore(); - this._store.set_column_types([GObject.TYPE_STRING, GObject.TYPE_INT]); - - this._treeView = new Gtk.TreeView({ model: this._store, hexpand: true, vexpand: true }); - this._treeView.get_selection().set_mode(Gtk.SelectionMode.SINGLE); - - let appColumn = new Gtk.TreeViewColumn({ expand: true, sort_column_id: Columns.INDICATOR_NAME, - title: _("A list of indicators for transfer to additional monitors.") }); - - let nameRenderer = new Gtk.CellRendererText; - appColumn.pack_start(nameRenderer, true); - appColumn.add_attribute(nameRenderer, "text", Columns.INDICATOR_NAME); - - nameRenderer = new Gtk.CellRendererText; - appColumn.pack_start(nameRenderer, true); - appColumn.add_attribute(nameRenderer, "text", Columns.MONITOR_NUMBER); - - this._treeView.append_column(appColumn); - this.add(this._treeView); - - let toolbar = new Gtk.Box({orientation: Gtk.Orientation.HORIZONTAL}); - toolbar.get_style_context().add_class("inline-toolbar"); - - this._settings.connect('changed::'+TRANSFER_INDICATORS_ID, Lang.bind(this, this._updateIndicators)); - this._updateIndicators(); - - let addTButton = new Gtk.Button({ icon_name: "list-add" }); - addTButton.connect('clicked', Lang.bind(this, this._addIndicator)); - toolbar.append(addTButton); - - let removeTButton = new Gtk.Button({ icon_name: "list-remove" }); - removeTButton.connect('clicked', Lang.bind(this, this._removeIndicator)); - toolbar.append(removeTButton); - - this.add(toolbar); - } - - add(child) { - this.attach(child, 0, this._numRows++, 1, 1); - } - - _updateIndicators() { - this._store.clear(); - - let transfers = this._settings.get_value(TRANSFER_INDICATORS_ID).deep_unpack(); - - for(let indicator in transfers) { - if(transfers.hasOwnProperty(indicator)){ - let monitor = transfers[indicator]; - let iter = this._store.append(); - this._store.set(iter, [Columns.INDICATOR_NAME, Columns.MONITOR_NUMBER], [indicator, monitor]); - } - } - } - - _addIndicator() { - - let dialog = new Gtk.Dialog({ title: _("Select indicator"), - transient_for: this.get_toplevel(), modal: true }); - dialog.add_button(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL); - dialog.add_button(_("Add"), Gtk.ResponseType.OK); - dialog.set_default_response(Gtk.ResponseType.OK); - - let grid = new Gtk.Grid({ column_spacing: 10, row_spacing: 15, - margin_top: 10, margin_end: 10, margin_bottom: 10, margin_start: 10 }); - - grid.set_orientation(Gtk.Orientation.VERTICAL); - - dialog._store = new Gtk.ListStore(); - dialog._store.set_column_types([GObject.TYPE_STRING]); - - dialog._treeView = new Gtk.TreeView({ model: dialog._store, hexpand: true, vexpand: true }); - dialog._treeView.get_selection().set_mode(Gtk.SelectionMode.SINGLE); - - let appColumn = new Gtk.TreeViewColumn({ expand: true, sort_column_id: Columns.INDICATOR_NAME, - title: _("Indicators on Top Panel") }); - - let nameRenderer = new Gtk.CellRendererText; - appColumn.pack_start(nameRenderer, true); - appColumn.add_attribute(nameRenderer, "text", Columns.INDICATOR_NAME); - - dialog._treeView.append_column(appColumn); - - let availableIndicators = () => { - let transfers = this._settings.get_value(TRANSFER_INDICATORS_ID).unpack(); - dialog._store.clear(); - this._settings.get_strv(AVAILABLE_INDICATORS_ID).forEach((indicator) => { - if(!transfers.hasOwnProperty(indicator)){ - let iter = dialog._store.append(); - dialog._store.set(iter, [Columns.INDICATOR_NAME], [indicator]); - } - }); - }; - - let availableIndicatorsId = this._settings.connect('changed::'+AVAILABLE_INDICATORS_ID, - availableIndicators); - let transferIndicatorsId = this._settings.connect('changed::'+TRANSFER_INDICATORS_ID, - availableIndicators); - - availableIndicators.apply(this); - grid.attach(dialog._treeView, 0, 0, 2, 1); - - let gHBox = new Gtk.Box({orientation: Gtk.Orientation.HORIZONTAL, - margin_top: 10, margin_end: 10, margin_bottom: 10, margin_start: 10, - spacing: 20, hexpand: true}); - let gLabel = new Gtk.Label({label: _('Monitor index:'), halign: Gtk.Align.START}); - gHBox.append(gLabel); - dialog._adjustment = new Gtk.Adjustment({lower: 0.0, upper: 0.0, step_increment:1.0}); - let spinButton = new Gtk.SpinButton({halign: Gtk.Align.END, adjustment: dialog._adjustment, numeric: 1}); - gHBox.append(spinButton); - - let monitorsChanged = () => { - let n_monitors = this._monitors.get_n_items() -1; - dialog._adjustment.set_upper(n_monitors) - dialog._adjustment.set_value(n_monitors); - }; - - let monitorsChangedId = this._monitors.connect('items-changed', monitorsChanged); - - monitorsChanged.apply(this); - grid.append(gHBox); - - dialog.get_content_area().append(grid); - - dialog.connect('response', (dialog, id) => { - this._monitors.disconnect(monitorsChangedId); - this._settings.disconnect(availableIndicatorsId); - this._settings.disconnect(transferIndicatorsId); - if (id != Gtk.ResponseType.OK) { - dialog.destroy(); - return; - } - - let [any, model, iter] = dialog._treeView.get_selection().get_selected(); - if (any) { - let indicator = model.get_value(iter, Columns.INDICATOR_NAME); - - let transfers = this._settings.get_value(TRANSFER_INDICATORS_ID).deep_unpack(); - if(!transfers.hasOwnProperty(indicator)){ - transfers[indicator] = dialog._adjustment.get_value(); - this._settings.set_value(TRANSFER_INDICATORS_ID, new GLib.Variant('a{si}', transfers)); - } - } - - dialog.destroy(); - }); - } - - _removeIndicator() { - let [any, model, iter] = this._treeView.get_selection().get_selected(); - if (any) { - let indicator = model.get_value(iter, Columns.INDICATOR_NAME); - - let transfers = this._settings.get_value(TRANSFER_INDICATORS_ID).deep_unpack(); - if(transfers.hasOwnProperty(indicator)){ - delete transfers[indicator]; - this._settings.set_value(TRANSFER_INDICATORS_ID, new GLib.Variant('a{si}', transfers)); - } - } - } - - _addComboBoxSwitch(label, schema_id, options) { - this._addSettingsComboBoxSwitch(label, this._settings, schema_id, options) - } - - _addSettingsComboBoxSwitch(label, settings, schema_id, options) { - let gHBox = new Gtk.Box({orientation: Gtk.Orientation.HORIZONTAL, - margin_top: 10, margin_end: 10, margin_bottom: 10, margin_start: 10, - spacing: 20, hexpand: true}); - let gLabel = new Gtk.Label({label: _(label), halign: Gtk.Align.START}); - gHBox.append(gLabel); - - let gCBox = new Gtk.ComboBoxText({halign: Gtk.Align.END}); - Object.entries(options).forEach(function(entry) { - const [key, val] = entry; - gCBox.append(key, val); - }); - gHBox.append(gCBox); - - this.add(gHBox); - - settings.bind(schema_id, gCBox, 'active-id', Gio.SettingsBindFlags.DEFAULT); - } - - _addBooleanSwitch(label, schema_id) { - this._addSettingsBooleanSwitch(label, this._settings, schema_id); - } - - _addSettingsBooleanSwitch(label, settings, schema_id) { - let gHBox = new Gtk.Box({orientation: Gtk.Orientation.HORIZONTAL, - margin_top: 10, margin_end: 10, margin_bottom: 10, margin_start: 10, - spacing: 20, hexpand: true}); - let gLabel = new Gtk.Label({label: _(label), halign: Gtk.Align.START}); - gHBox.append(gLabel); - let gSwitch = new Gtk.Switch({halign: Gtk.Align.END}); - gHBox.append(gSwitch); - this.add(gHBox); - - settings.bind(schema_id, gSwitch, 'active', Gio.SettingsBindFlags.DEFAULT); - } -}); - -function init() { - Convenience.initTranslations(); -} - -function buildPrefsWidget() { - let widget = new MultiMonitorsPrefsWidget(); - - return widget; -} diff --git a/multi-monitors-add-on/multi-monitors-add-on@spin83/schemas/gschemas.compiled b/multi-monitors-add-on/multi-monitors-add-on@spin83/schemas/gschemas.compiled deleted file mode 100644 index 5a9e945..0000000 Binary files a/multi-monitors-add-on/multi-monitors-add-on@spin83/schemas/gschemas.compiled and /dev/null differ diff --git a/multi-monitors-add-on/multi-monitors-add-on@spin83/schemas/org.gnome.shell.extensions.multi-monitors-add-on.gschema.xml b/multi-monitors-add-on/multi-monitors-add-on@spin83/schemas/org.gnome.shell.extensions.multi-monitors-add-on.gschema.xml deleted file mode 100644 index 4a42a23..0000000 --- a/multi-monitors-add-on/multi-monitors-add-on@spin83/schemas/org.gnome.shell.extensions.multi-monitors-add-on.gschema.xml +++ /dev/null @@ -1,59 +0,0 @@ - - - - - true - Show Multi Monitors indicator on Top Panel. - Add or remove Multi Monitors indicator from Top Panel. - - - - true - Show Panel on additional monitors. - Add or remove Panel from additional monitors. - - - - true - Show Activities-Button on additional monitors. - Change visibility of Activities-Button on additional monitors. - - - - true - Show AppMenu-Button on additional monitors. - Change visibility of AppMenu-Button on additional monitors. - - - - true - Show DateTime-Button on additional monitors. - Change visibility of DateTime-Button on additional monitors. - - - - - - - - - - 'auto' - Show Thumbnails-Slider on additional monitors. - Select position of Thumbnails-Slider on additional monitors. - - - - [] - A list of available indicators. - A list of indicators that are available for transfer. For internal use only. - - - - {} - A list of indicators for transfer. - A list of indicators selected for transfer to additional Panel. - - - - \ No newline at end of file diff --git a/multi-monitors-add-on/multi-monitors-add-on@spin83/stylesheet.css b/multi-monitors-add-on/multi-monitors-add-on@spin83/stylesheet.css deleted file mode 100644 index b1d20c5..0000000 --- a/multi-monitors-add-on/multi-monitors-add-on@spin83/stylesheet.css +++ /dev/null @@ -1,29 +0,0 @@ - -.helloworld-label { - font-size: 72px; - font-weight: bold; - color: #ffffff; - background-color: rgba(0,0,0,0.5); - border-radius: 5px; - padding: .5em; -} - -.multimonitor-spacer { - height: 4em; -} - -.multimonitor-status-indicators-box { - spacing: 0px; -} - -.multimonitor-status-icon { - padding: 0 2px; -} - -.workspace-thumbnails-left { - border-radius: 0 9px 9px 0; -} - -.workspace-thumbnails-left:rtl { - border-radius: 9px 0 0 9px; -} diff --git a/share/man/Makefile b/share/man/Makefile new file mode 100644 index 0000000..70442a6 --- /dev/null +++ b/share/man/Makefile @@ -0,0 +1,59 @@ +# Progress Linux: gnome-shell-extensions-extra + +# Copyright (C) 2010-2023 Daniel Baumann +# +# SPDX-License-Identifier: GPL-3.0+ +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Depends: python3-docutils + +RST2MAN = rst2man \ + --no-datestamp \ + --no-generator \ + --strict \ + --strip-comments \ + --tab-width=4 \ + --verbose + +VERSION := $(shell cat ../../VERSION.txt) + +SHELL := sh -e + +all: build + +build: man + +rebuild: clean build + +man: man.in *.rst + @echo -n "Creating manpages... " + + @for FILE in *.rst; \ + do \ + cp man.in $$(basename $${FILE} .rst); \ + $(RST2MAN) $${FILE} | \ + sed -e '/^.\\" Man page generated/d' \ + -e '/^.\\" Generated by/d' \ + -e "s|^\(.TH .*\) \(\"\" \"\"\) |\1 $${VERSION} gnome-shell-extensions-extra |" \ + >> $$(basename $${FILE} .rst); \ + echo -n "."; \ + done + + @echo " done." + +clean: + rm -f *.[0-9] + +.PHONY: all clean build rebuild man diff --git a/share/man/gnome-shell-extensions-extra.7.rst b/share/man/gnome-shell-extensions-extra.7.rst new file mode 100644 index 0000000..5b23756 --- /dev/null +++ b/share/man/gnome-shell-extensions-extra.7.rst @@ -0,0 +1,77 @@ +.. Progress Linux: gnome-shell-extensions-extra + +.. Copyright (C) 2010-2023 Daniel Baumann +.. +.. SPDX-License-Identifier: GPL-3.0+ +.. +.. This program is free software: you can redistribute it and/or modify +.. it under the terms of the GNU General Public License as published by +.. the Free Software Foundation, either version 3 of the License, or +.. (at your option) any later version. +.. +.. This program is distributed in the hope that it will be useful, +.. but WITHOUT ANY WARRANTY; without even the implied warranty of +.. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +.. GNU General Public License for more details. +.. +.. You should have received a copy of the GNU General Public License +.. along with this program. If not, see . + +============================ +gnome-shell-extensions-extra +============================ + +------------------------------------------------ +Conglomeration package of GNOME Shell extensions +------------------------------------------------ + +:manual section: 7 +:manual group: Progress Linux + +Contents +======== + +| disable-workspace-switcher: +| disables the popup displayed during workspace switching +| https://github.com/jbradaric/disable-workspace-switcher + +| hibernate-status: +| adds a hibernate/hybrid suspend button in status menu +| https://github.com/arelange/gnome-shell-extension-hibernate-status + +| middleclickclose +| closes apps in overview with a middle click +| https://github.com/p91paul/middleclickclose + +| multi-monitors-add-on: +| adds panels and thumbnails for additional monitors +| https://github.com/realh/multi-monitors-add-on + +| no-overview: +| disables the switch to overview at login +| https://github.com/fthx/no-overview + +| vertical-workspaces: +| changes the horizontal stacking of workspaces to vertical, but also customizes layout, content, appearance and behavior of the Shell +| https://github.com/G-dH/vertical-workspaces + +Download +======== + +| Upstream Releases: +| https://get.progress-linux.org/packages/gnome-shell-extensions-extra/upstream + +| Upstream Sources: +| https://git.progress-linux.org/software/progress-linux/gnome-shell-extensions-extra + +| Debian Releases: +| https://get.progress-linux.org/packages/gnome-shell-extensions-extra/debian + +| Debian Sources: +| https://git.progress-linux.org/users/daniel.baumann/debian/packages/gnome-shell-extensions-extra + +Authors +======= + +gnome-shell-extensions-extras were written by Daniel Baumann + and others. diff --git a/share/man/man.in b/share/man/man.in new file mode 100644 index 0000000..b6d2407 --- /dev/null +++ b/share/man/man.in @@ -0,0 +1,19 @@ +.\" Progress Linux: gnome-shell-extensions-extra +.\" +.\" Copyright (C) 2010-2023 Daniel Baumann +.\" +.\" SPDX-License-Identifier: GPL-3.0+ +.\" +.\" This program is free software: you can redistribute it and/or modify +.\" it under the terms of the GNU General Public License as published by +.\" the Free Software Foundation, either version 3 of the License, or +.\" (at your option) any later version. +.\" +.\" This program is distributed in the hope that it will be useful, +.\" but WITHOUT ANY WARRANTY; without even the implied warranty of +.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +.\" GNU General Public License for more details. +.\" +.\" You should have received a copy of the GNU General Public License +.\" along with this program. If not, see . +.\" -- cgit v1.2.3