Editing metadata.json file

The following is background for my question:

After I do a clean install of Fedora Linux Workstation on a PC, I have a script I run to get the PC ready for use. The script does a bunch of dnf installs and removes. It also does a bunch of Gsettings and it turns off tracker.

Now for my question:

The last step of my install is: sudo nano /usr/share/gnome-shell/extensions/freon@UshakovVasilii_Github.yahoo.com/metadata.json

I do this so when I notice that the script is done I can set the gnome version number so Freon will work. Is their a nice way I can just edit the file from the script?

I know this is a temporary since their will come a day when Freon no longer works with gnome. My users and I depend on Freon since the system monitor extension doesn’t monitor disk drives.

There are a lot of ways but a common way would be to use sed to search for and replace the text you are editing.

Alternatively, if that file is always the same, you could create patch and apply it in the script.

You could also just pull a copy down from an external source and overwrite it.

You might have better luck installing the extension via extensions.gnome.org and editing it from ~/.local/share/gnome-extensions. This way your chance won’t get overwritten on a package yum package update or Fedora system upgrade.

Thanks SED works great. I had only used SED once before in the last several years, but it didn’t take long with the help of an on line tip.

Thanks for this: ~/.local/share/gnome-extensions. If Freon stays around and I run into the problem I will try this. I prefer to load things from the Fedora repo’s. Besides from what I can tell Freon has been orphaned. So I’ll use it while I can with this work around. In the mean time I’ll be looking for something else. Do you happen to know if it’s written in Python? If so perhaps I can help when the time comes.

1 Like

I have never looked at freon, but it is easy to tell by using the file command.
file /path/to/file will return a result that tells you what the file in question is.
This is the output on a couple entries in my /home/user/bin directory

$ file bin/*
bin/freecad:                                                  symbolic link to FreeCAD_0.19-24276-Linux-Conda_glibc2.12-x86_64.AppImage
bin/FreeCAD_0.19-24276-Linux-Conda_glibc2.12-x86_64.AppImage: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=9fdbc145689e0fb79cb7291203431012ae8e1911, stripped