Skip to content

use default gsettings schemas when installed system-wide - #1061

Open
niol wants to merge 5 commits into
paperwm:developfrom
niol:upstream
Open

niol wants to merge 5 commits into
paperwm:developfrom
niol:upstream

Conversation

@niol

@niol niol commented Aug 28, 2025

Copy link
Copy Markdown

No description provided.

@Thesola10
Thesola10 changed the base branch from release to develop August 28, 2025 08:50
@niol
niol marked this pull request as ready for review August 29, 2025 06:48
@niol
niol marked this pull request as draft September 2, 2025 05:46
@niol
niol marked this pull request as ready for review September 2, 2025 08:44

@SanTeeg0 SanTeeg0 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your contribution!
I think it would be better to keep the default behavior of make install(install the extension locally for user), as it's what will be used most often anyway. This will also ensure some backward compatibility.
Other than that, everything looks good to me.

@niol

niol commented Sep 5, 2025

Copy link
Copy Markdown
Author

I understand. What do you want as target name for system-wide install?
Please note make install is the standard way of installing software on Unixes system-wide.

@SanTeeg0

SanTeeg0 commented Sep 5, 2025 •

Copy link
Copy Markdown
Collaborator

Please note make install is the standard way of installing software on Unixes system-wide.

That's true, but mainly for packages, tools, etc. Extensions, themes, and so on are mostly user-specific. Also, PaperWM only had one way for users to install it locally, which was with make install, so changing this behavior could cause more confusion.

I understand. What do you want as target name for system-wide install?

Something like make install-system could be sufficient.

@SanTeeg0 SanTeeg0 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!
But currently, the only option is to install the extension in the system using make install-system, but I think it would be great if there was a way to uninstall it. Especially using the same make uninstall command (to remove both the local and system versions, if any).

Sorry for my oversight, I could have noticed this earlier.

Comment thread Makefile Resolved
@niol

niol commented Sep 8, 2025

Copy link
Copy Markdown
Author

Looks great! But currently, the only option is to install the extension in the system using make install-system, but I think it would be great if there was a way to uninstall it. Especially using the same make uninstall command (to remove both the local and system versions, if any).

Then I'll need $prefix so that I'll try to work out something.

@niol

niol commented Sep 9, 2025

Copy link
Copy Markdown
Author

The uninstall target is currently broken due to /bin/sh syntax errors when run on my machine.

@niol

niol commented Oct 14, 2026

Copy link
Copy Markdown
Author

What can I do to help this get merged?

@Thesola10
Thesola10 dismissed SanTeeg0’s stale review October 15, 2026 06:47

Points have been addressed, make uninstall is IMO out of scope

@Thesola10 Thesola10 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry, kinda forgot about it! Looks ready for merge

Comment thread workspace.js
Comment on lines +16 to +31
const extLocation = extension.dir.get_parent();
console.debug("Extension location " + extLocation.get_path());
console.debug("XDG_DATA_DIR=" + GLib.get_user_data_dir());
if (extLocation.get_parent().get_parent().get_path() == GLib.get_user_data_dir()) {
console.debug("We are installed in $XDG_DATA_HOME");
this.schemaSource = Gio.SettingsSchemaSource.new_from_directory(
GLib.build_filenamev([extension.path, "schemas"]),
Gio.SettingsSchemaSource.get_default(),
false
);
} else {
// assume we are installed system-wide and our schema source is in
// the default schema.
console.debug("We are installed in system $PREFIX.");
this.schemaSource = Gio.SettingsSchemaSource.get_default();
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this how extensions do it? I'd be tempted to believe GJS-side loading can be made agnostic since system-wide is also technically an XDG_DATA_DIR

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There may be a simpler way to do this using Extension.prototype.getSettings() which should lookup in the rights paths. I'll try to come up with something and report here.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants