# specifying a path for a gsettings command

A while back I was having a problem understanding how to specify a path in a gsettings command. I needed to do this becasue I was getting errors that the group of keys I was trying to set is relocatable so I must specify the path to the key I want to set. none of my attempts worked, but I got a reply to the question I asked here that mostly worked, but I need a little more help.

The command I am using is:

(gsettings set org.gnome.Terminal.Legacy.Profile:/org/gnome/terminal/legacy/profiles:/:$(gsettings get org.gnome.Terminal.ProfilesList default)/ use-system-font false) I ran the one above and another to set the font. When I run them, the terminal just comes back to the prompt with no messages, but when I open the gnome terminal the font is still set at the default. I also ran the (gsettings get org.gnome.Terminal.ProfilesList default) by itself and got the big long number. I thought there should be a file with this number, but the search didn't find anything. Any ideas on what the problem is? Thanks in advance for your continued help. edit retag close merge delete ## 2 Answers 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

I have tried it the way you suggest, and it works just fine. I did the following:

1.)

gsettings get org.gnome.Terminal.Legacy.Profile:/org/gnome/terminal/legacy/profiles:/:$(gsettings get org.gnome.Terminal.ProfilesList default)/ use-system-font It returns a true. Then I run 2.) gsettings set org.gnome.Terminal.Legacy.Profile:/org/gnome/terminal/legacy/profiles:/:$(gsettings get org.gnome.Terminal.ProfilesList default)/ use-system-font false

the command used in 1.) returns a false now. So, everything looks fine.

I guess the problem is that turning the switch use-system-font on or off is not enough - if you want to use something else than the system font, you need to define that new font:

So, what does

gsettings get org.gnome.Terminal.Legacy.Profile:/org/gnome/terminal/legacy/profiles:/:\$(gsettings get org.gnome.Terminal.ProfilesList default)/ font

return? That's the font that is used if system font is set to false.

more

I get monospace 12. I can use the Set to set the font to monospace 18 and when I check it with a Get it shows monospace 18. When I do a Set of the use system font to false and I check it with a Get I get False, but when I open the gnome terminal and look under Edit -> Preferences - Text I see that the Custom font check box is unchecked and the font is still at monospace 12.

I was thinking that perhaps the default path is not the path my gnome terminal is looking at, but I don't know how to check into that.

At the bottom there is a Profile ID of b1dcc9dd-5262-4d8d-a863-c897e6d979b9

( 2018-08-16 16:12:02 -0600 )edit

weird. it didn't work for me neither. I've tried to set use-system-font to false and font to 'Monospace 24' but any new terminal with the default profile appears in `Monospace 12'. Not sure what's wrong here.

I have the feeling the switch use-system-font doesn't work as expected.

(Changing the Settings in Terminal works just fine).

( 2018-08-17 09:33:40 -0600 )edit
1

Thanks for confirming my result. I'm thinking that I should file an issue in regard to gnome-terminal at the gnome gitlab site unless you've already done so.

( 2018-08-17 11:32:17 -0600 )edit

Yes, good idea to file a bug/issue.

( 2018-08-17 13:59:59 -0600 )edit
1

I filed the issue and got an almost immediate reply. They say the Get (gsettings get org.gnome.Terminal.ProfilesList default) returns Profile ID enclosed in single quotes. and the Set can't match the profile with single quotes so it makes a new profile with single quotes and sets the parameter. Dconf show the two different profiles. That's why the Gets show the correct results, but the terminal doesn't change.

I need help to understand how to remove the single quotes from from the Get.

( 2018-08-18 09:41:43 -0600 )edit