Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue installing on Ubuntu 20.04 #37

Open
asarchami opened this issue Mar 29, 2022 · 17 comments
Open

Issue installing on Ubuntu 20.04 #37

asarchami opened this issue Mar 29, 2022 · 17 comments
Labels
help wanted Extra attention is needed older gnome

Comments

@asarchami
Copy link

When I try to install the extension I get the following error.
I
Error: Type name AnotherWindowSessionManagerPrefs is already registered

Stack trace:
_init/GObject.Object._classInit@resource:///org/gnome/gjs/modules/core/overrides/GObject.js:448:27
registerClass@resource:///org/gnome/gjs/modules/core/overrides/GObject.js:94:22
@/home/ali/.local/share/gnome-shell/extensions/another-window-session-manager@gmail.com/prefs.js:7:23
_init@resource:///org/gnome/Shell/Extensions/js/extensionsService.js:204:33
OpenExtensionPrefsAsync/<@resource:///org/gnome/Shell/Extensions/js/extensionsService.js:122:28
asyncCallback@resource:///org/gnome/gjs/modules/core/overrides/Gio.js:132:13
run@resource:///org/gnome/Shell/Extensions/js/dbusService.js:175:20
main@resource:///org/gnome/Shell/Extensions/js/main.js:19:13
run@resource:///org/gnome/gjs/modules/script/package.js:222:19
start@resource:///org/gnome/gjs/modules/script/package.js:206:5
@/usr/share/gnome-shell/org.gnome.Shell.Extensions:1:17

@nlpsuge
Copy link
Owner

nlpsuge commented Mar 30, 2022

Hi @asarchami ,

grep -r 'AnotherWindowSessionManagerPrefs' /home/ali/.local/share/gnome-shell/extensions/

Please use the above command line to check out how many AnotherWindowSessionManagerPrefss are registered in the extension system.

There is probably another extension using the same name AnotherWindowSessionManagerPrefs under /home/ali/.local/share/gnome-shell/extensions/.

const Prefs = GObject.registerClass(
{
GTypeName: 'AnotherWindowSessionManagerPrefs',
},
.

The name AnotherWindowSessionManagerPrefs as the GTypeName of a GObject can't be duplicated.

https://gjs.guide/guides/gobject/subclassing.html#subclassing-gobject

@nlpsuge
Copy link
Owner

nlpsuge commented Apr 2, 2022

@asarchami

Does your Ubuntu 20.04 use Gnome 3.36.8?

I learned that Ubuntu 20.04 LTS is using Gnome 3.36.8. But currently this extension only supports Gnome 40 and 41.

I will check if it supports Gnome 42 recently.

P.S. Ubuntu 20.04 LTS has a long-time support, which is until April 2025. Maybe I should consider to support Gnome 3.36 and 3.38.

@asarchami
Copy link
Author

I think that's the issue. Thanks.

@slarrain
Copy link

Hi!
Any updates on supporting Gnome 3.36 and 3.38 so this awesome extension could be used with Ubuntu 20.04 LTS?
It would be great!
Thanks @nlpsuge !

@nlpsuge
Copy link
Owner

nlpsuge commented Jun 16, 2022

@slarrain

I guess there are a lot of changes have been made between Gnome 3.3x and Gnome 40+, I don't have enough time for supporting Gnome 3.3x.

I want to support Gnome 3.3.x, but the priority is not high.

@nlpsuge nlpsuge added the help wanted Extra attention is needed label Jun 27, 2022
@nlpsuge nlpsuge reopened this Jun 27, 2022
@nlpsuge
Copy link
Owner

nlpsuge commented Jul 19, 2022

Hi guys,

I just tested on Fedora 33 with Gnome shell 3.38.1. The main feature works actually, I mean save, restore and move session. The Preferences is written in Gtk4 and Gnome shell 3.38 and 3.36 only support gtk3, so you cannot open Preferences.

@slarrain
Copy link

slarrain commented Aug 1, 2022

Hi @nlpsuge

Thank you so much for revisiting this issue. It's awesome that it works on older versions, even if no configuration is possible.
However, I was wondering how did you enable it?
Screenshot from 2022-08-01 13-33-16
In my case, I can't enable the switch.

Thanks again!

@nlpsuge
Copy link
Owner

nlpsuge commented Aug 2, 2022

@slarrain

Hi, sorry for not mentioning that important info.

I enable it in the page https://extensions.gnome.org/extension/4709/another-window-session-manager/ in Firefox.

But I think it's because something is not up to date, so I can enable it. I tested it on the Fedora 33 Live Desktop and didn't update it.

If this is not working for you, you can add the gnome shell version to ~/.local/share/gnome-shell/extensions/another-window-session-manager@gmail.com. The gnome shell version in your case should be 3.38, like this:

{
  "_generated": "Generated by SweetTooth, do not edit",
  "description": "Close and save open windows. And restore them. Most importantly, it supports both X11 and Wayland!\n\nMain features:\n- Close open windows\n- Close apps with multiple windows via `ydotool` so you don't lose sessions of this app. Please see https://github.com/nlpsuge/gnome-shell-extension-another-window-session-manager#how-to-restore-a-session-at-startup to learn how to make `Close by rules` work\n- Save open windows\n- Restore session(s)\n- Restore a session at startup. Please note that this feature is disabled by default. See https://github.com/nlpsuge/gnome-shell-extension-another-window-session-manager#how-to-restore-a-session-at-startup to learn how to enable and use it\n- Restore window state, including Always on Top,  Always on Visible Workspace and maximization\n- Restore window workspace, size and position\n- Move windows to their own workspace according to a saved session\n- Support multi-monitor\n- Trash saved session\n- Search saved session by the session name fuzzily",
  "name": "Another Window Session Manager",
  "shell-version": [
    "3.38",
    "40",
    "41",
    "42"
  ],
  "url": "https://github.com/nlpsuge/gnome-shell-extension-another-window-session-manager",
  "uuid": "another-window-session-manager@gmail.com",
  "version": 24
}

@nlpsuge
Copy link
Owner

nlpsuge commented Aug 5, 2022

@slarrain

And recently the https://extensions.gnome.org/local/ allow you to enable incompatible / outdated extensions.
image

@systemoperator
Copy link

systemoperator commented Jan 6, 2023

@nlpsuge I'm using Debian 11 with GNOME Shell 3.38.6. Two weeks ago, the extensions still worked, but now there is this error 🤔 :

The settings of extension another-window-session-manager@gmail.com had an error:

Error: Type name AnotherWindowSessionManagerPrefs is already registered

Stack trace:

_init/GObject.Object._classInit@resource:///org/gnome/gjs/modules/core/overrides/GObject.js:451:27
registerClass@resource:///org/gnome/gjs/modules/core/overrides/GObject.js:95:22
@/home/xxx/.local/share/gnome-shell/extensions/another-window-session-manager@gmail.com/prefs.js:15:23
_init@resource:///org/gnome/Shell/Extensions/js/extensionsService.js:204:33
OpenExtensionPrefsAsync/<@resource:///org/gnome/Shell/Extensions/js/extensionsService.js:122:28
asyncCallback@resource:///org/gnome/gjs/modules/core/overrides/Gio.js:132:22
run@resource:///org/gnome/Shell/Extensions/js/dbusService.js:177:20
main@resource:///org/gnome/Shell/Extensions/js/main.js:19:13
run@resource:///org/gnome/gjs/modules/script/package.js:222:19
start@resource:///org/gnome/gjs/modules/script/package.js:206:8
@/usr/share/gnome-shell/org.gnome.Shell.Extensions:1:17

@nlpsuge
Copy link
Owner

nlpsuge commented Jan 7, 2023

Error: Type name AnotherWindowSessionManagerPrefs is already registered

/home/xxx/.local/share/gnome-shell/extensions/ probably has two another-window-session-manager@gmail.com, or has a copy of another-window-session-manager@gmail.com?

@systemoperator
Copy link

@nlpsuge I'm not sure, if I understood it correctly: I've checked now that there is no duplicate folder of this session-manager somewhere in /home/xxx/.local/share/gnome-shell/extensions/. Completely uninstalling (result: whole folder another-window-session-manager@gmail.com vanishes) and reinstalling the extension subsequently does not help. The extension can be enabled, but it is not operational and the above-mentioned error appears.

Are there any files (e.g., stored session files) stored outside the folder another-window-session-manager@gmail.com?
I could not find any older stored session files in there. Maybe e.g. some session file is corrupt.

@nlpsuge
Copy link
Owner

nlpsuge commented Jan 8, 2023

Can you search for AnotherWindowSessionManagerPrefs (using rg or grep) in the path ~/.local/share/gnome-shell/extensions? what's the result?

And you can also modify prefs.js and change AnotherWindowSessionManagerPrefs to AnotherWindowSessionManagerPrefs1, for example, to see if this can resolve this issue or not.

vim ~/.local/share/gnome-shell/extensions/another-window-session-manager@gmail.com/prefs.js
# search AnotherWindowSessionManagerPrefs and modify it

@systemoperator
Copy link

Where are saved session data stored on disk?

Using grep, results in:

lenovo ~/.local/share/gnome-shell/extensions % grep -r "AnotherWindowSessionManagerPrefs" .            
./another-window-session-manager@gmail.com/prefs.js:        GTypeName: 'AnotherWindowSessionManagerPrefs',
lenovo ~/.local/share/gnome-shell/extensions %

Interesting observation:

  1. Disabled Extension
  2. Changed GtypeName to AnotherWindowSessionManagerPrefs3
  3. Opened Settings of Extension, Result:

The settings of extension another-window-session-manager@gmail.com had an error:

Error: Invalid parameter interfaces (element 0 was not a GType)

Stack trace:

_init/GObject.Object._classInit@resource:///org/gnome/gjs/modules/core/overrides/GObject.js:451:27
registerClass@resource:///org/gnome/gjs/modules/core/overrides/GObject.js:95:22
@/home/xxx/.local/share/gnome-shell/extensions/another-window-session-manager@gmail.com/prefs.js:202:30
_init@resource:///org/gnome/Shell/Extensions/js/extensionsService.js:204:33
OpenExtensionPrefsAsync/<@resource:///org/gnome/Shell/Extensions/js/extensionsService.js:122:28
asyncCallback@resource:///org/gnome/gjs/modules/core/overrides/Gio.js:132:22
run@resource:///org/gnome/Shell/Extensions/js/dbusService.js:177:20
main@resource:///org/gnome/Shell/Extensions/js/main.js:19:13
run@resource:///org/gnome/gjs/modules/script/package.js:222:19
start@resource:///org/gnome/gjs/modules/script/package.js:206:8
@/usr/share/gnome-shell/org.gnome.Shell.Extensions:1:17
  1. Enabled Extension
  2. Opened Settings of Extension, Result:

The settings of extension another-window-session-manager@gmail.com had an error:

Error: Type name AnotherWindowSessionManagerPrefs3 is already registered

Stack trace:

_init/GObject.Object._classInit@resource:///org/gnome/gjs/modules/core/overrides/GObject.js:451:27
registerClass@resource:///org/gnome/gjs/modules/core/overrides/GObject.js:95:22
@/home/xxx/.local/share/gnome-shell/extensions/another-window-session-manager@gmail.com/prefs.js:15:23
_init@resource:///org/gnome/Shell/Extensions/js/extensionsService.js:204:33
OpenExtensionPrefsAsync/<@resource:///org/gnome/Shell/Extensions/js/extensionsService.js:122:28
asyncCallback@resource:///org/gnome/gjs/modules/core/overrides/Gio.js:132:22
run@resource:///org/gnome/Shell/Extensions/js/dbusService.js:177:20
main@resource:///org/gnome/Shell/Extensions/js/main.js:19:13
run@resource:///org/gnome/gjs/modules/script/package.js:222:19
start@resource:///org/gnome/gjs/modules/script/package.js:206:8
@/usr/share/gnome-shell/org.gnome.Shell.Extensions:1:17

@nlpsuge
Copy link
Owner

nlpsuge commented Jan 8, 2023

Where are saved session data stored on disk?

They are in ~/.config/another-window-session-manager/sessions and you can view session files on the popup menu of AWSM too by clicking the View button.

The settings of extension another-window-session-manager@gmail.com had an error:

Please note that this extension supports Gnome 40+. There will be some problems when you are using it on versions that less than Gnome 40.

Error: Type name AnotherWindowSessionManagerPrefs3 is already registered

Did the gnome shell update recently? And try to use the previous version of AWSM, you can download it from https://extensions.gnome.org/extension/4709/another-window-session-manager:

image

@nlpsuge
Copy link
Owner

nlpsuge commented Jan 8, 2023

_init/GObject.Object._classInit@resource:///org/gnome/gjs/modules/core/overrides/GObject.js:451:27
registerClass@resource:///org/gnome/gjs/modules/core/overrides/GObject.js:95:22
@/home/xxx/.local/share/gnome-shell/extensions/another-window-session-manager@gmail.com/prefs.js:15:23

What is the version of gjs are you using? Did gjs get updated recently?

@systemoperator
Copy link

systemoperator commented Jan 10, 2023

The thing is, that all my stored sessions vanished from the list and only the buttons Close open windows, Save open windows and the search box are shown. When I try to save a new session with a new name now, it also does not show up in the list anymore (but it gets stored as a file in the session folder). Thus, I could not look up, where the saved sessions are stored with the View button.

Now, when I delete the whole session folder and then save a new session, it shows up in the extension's session list as usual. But I can observe, when I now disable and again enable the extension, the sessions again vanish in the list.

I think, that neither gjs nor the gnome-shell has been updated recently. gjs --version shows: gjs 1.66.2. gnome-shell --version shows GNOME Shell 3.38.6.

I've tested all other version of the extension as well. They all behave in the same way, with the errors. I must have overlooked something.

But I don't want to bother you with the problem, since your extension is only supported for Gnome 40+. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed older gnome
Projects
None yet
Development

No branches or pull requests

4 participants