# Need command line help

I've been working to automate set up of PCs. I need to change a couple settings in gnome-terminal, but since that schema is relocatable I had to specify the path. I had no luck, but one of the kind folks here showed me the basics of how to do it and I ended up trying the following two commands:

gsettings set org.gnome.Terminal.Legacy.Profile:/org/gnome/terminal/legacy/profiles:/:$(gsettings get org.gnome.Terminal.ProfilesList default)/ use-system-font false gsettings set org.gnome.Terminal.Legacy.Profile:/org/gnome/terminal/legacy/profiles:/:$(gsettings get org.gnome.Terminal.ProfilesList default)/ font 'Monospace 24'


These seemed to work since there were no error messages from gsettings and when I did Gets afterwards the returned values were what I expected (false and monospace 24). However, the settings in the terminal did not change. Another kind person here helped me verify the condition. and then I filed an issue with the folks at Gnome in regard to gnome-terminal.

The reply from the Gnome folks was the

gsettings get org.gnome.Terminal.ProfilesList default


part of the commands above returns the Profile ID enclosed in single quotes and that the Set part of the commands created a new profile with the single quotes and set the parameter. This led to the confusion where the parameters were verified as being set, but the terminal didn't change. They say I need to remove the single quotes from around the Provide ID that is returned in the get profile part of the command. I have no idea how to do that so the set parameter part of the command will work properly.

edit retag close merge delete

Sort by » oldest newest most voted

One of the kind folks at Fedora Forum helped me out and this form of the command works fine:

gsettings set org.gnome.Terminal.Legacy.Profile:/org/gnome/terminal/legacy/profiles:/:\$(gsettings get org.gnome.Terminal.ProfilesList default | tr -d "'")/ use-system-font false


The key is the | tr -d "'" that removes the single quotes. Care must be taken with this approach as this will remove all occurrences for the character; in this case single quote. The good news is that Profile IDs don't contain single quotes within them; so this works for this purpose.

more

If I understood correctly your problem, you need to change the default behaviour of gnome-terminal for several PCs.

May I suggest to modify the parameters contained in

/usr/share/glib-2.0/schemas/org.gnome.Terminal.gschema.xml


for, say, the default font Monospace 12 and spread the modified file across different boxes afterwards?

more

Two things hold me back from this approach I think fedora reads the settings from a compiled version of all the schema XML files and I don't know how to do that. Also, I already have a nice long bash script with most of the gnome setting I need to do in the form a gsettings commands; so I would rather get this figured out so I can have all the settings done the same way and in one script.

( 2018-08-20 14:49:15 -0600 )edit