2

is it possible to extract the file libgnome-shell.so and then change content in some files and compile back?

i am using Ubuntu 18.04

I am trying to make some tweaking to gnome-shell by editing .js files in libgnome-shell.so file.

0

1 Answer 1

3

Use the gresource command to list and extract resources from an ELF file or a .gresource bundle:

gresource extract libgnome-shell.so /org/gnome/shell/ui/main.js > ~/GNOME_Shell/ui/main.js

The compiler, glib-compile-resources, requires an XML-formatted list of the resources to be compiled, and its output cannot be easily reattached to an existing .so ELF file.

An easier method is to remap some resources to be loaded from the filesystem using "overlays", by setting this environment variable (from ~/.xprofile or ~/.pam_environment):

G_RESOURCE_OVERLAYS="/org/gnome/shell=$HOME/GNOME_Shell"

Now, instead of the /org/gnome/shell/ui/main.js resource from libgnome-shell.so, GNOME Shell will automatically use the file ~/GNOME_Shell/ui/main.js with your edits in it.

1
  • Absolutely life-changing! Thank you!
    – Levente
    Jan 23, 2021 at 21:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.