You are not logged in.

#1 2026-01-25 17:13:22

inkle
Member
Registered: 2026-01-25
Posts: 8

[solved] gtk-3.0/settings.ini syntax for comments

For gtk3, what is the syntax for placing comments in the settings.ini file?

answer is in this post

https://bbs.archlinux.org/viewtopic.php … 1#p2285241

Last edited by inkle (2026-01-29 20:21:03)


... going on 70

Offline

#2 2026-01-25 20:23:09

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 73,541

Re: [solved] gtk-3.0/settings.ini syntax for comments

Have you tried the normal ini syntax?
https://en.wikipedia.org/wiki/INI_file#Comments

Offline

#3 2026-01-26 00:47:01

inkle
Member
Registered: 2026-01-25
Posts: 8

Re: [solved] gtk-3.0/settings.ini syntax for comments

I started the comment lines with a pound sign, but those line seem to have been removed.


... going on 70

Offline

#4 2026-01-26 07:14:27

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 73,541

Re: [solved] gtk-3.0/settings.ini syntax for comments

In what universe and where in that wikipedia entry is  £ a comment indicator?
The gtk ini slang, as most, interprets lines starting w/ "#" as comment.

https://en.wikipedia.org/wiki/XY_problem - what is your *actual* problem?

Offline

#5 2026-01-26 19:49:37

teckk
Member
Registered: 2013-02-21
Posts: 573

Re: [solved] gtk-3.0/settings.ini syntax for comments

In the US, # was called the pound sign for decades or longer, until twitter started calling it hashtag, or programming in bash/python called it a remark.

20# or 20lbs. or 20 pounds of potatoes. I still call it a pound sign in my mind. (Anyone over 50 or so remembers that).

Edit:
And by pound, means a unit of weight, not a unit of money.

Last edited by teckk (2026-01-26 19:52:05)

Offline

#6 2026-01-26 20:38:31

tekstryder
Member
Registered: 2013-02-14
Posts: 504

Re: [solved] gtk-3.0/settings.ini syntax for comments

teckk wrote:

In the US, # was called the pound sign for decades or longer...
...Anyone over 50 or so remembers that.

Alas, 'tis true.

It's also the number sign and octothorpe.

A polysemous character indeed.

Offline

#7 2026-01-26 20:59:41

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 73,541

Re: [solved] gtk-3.0/settings.ini syntax for comments

Germans just named it after what it is tongue
https://de.wikipedia.org/wiki/Raute

Offline

#8 2026-01-27 03:48:54

dimich
Member
From: Kharkiv, Ukraine
Registered: 2009-11-03
Posts: 514

Re: [solved] gtk-3.0/settings.ini syntax for comments

Ukrainians often call it "ґрати" (a grille).

If "those line seem to have been removed", maybe topic starter ran some third-party "configurator" which parsed settings.ini and re-generated it stripping comments.
However, conventional character for comment in ini file is semicolon (;)

Offline

#9 2026-01-27 19:46:44

inkle
Member
Registered: 2026-01-25
Posts: 8

Re: [solved] gtk-3.0/settings.ini syntax for comments

dimich wrote:

However, conventional character for comment in ini file is semicolon (;)

Thanks, do you have a reference for that?


... going on 70

Offline

#10 2026-01-27 20:19:14

teckk
Member
Registered: 2013-02-21
Posts: 573

Re: [solved] gtk-3.0/settings.ini syntax for comments

Offline

#11 2026-01-27 20:32:38

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 73,541

Re: [solved] gtk-3.0/settings.ini syntax for comments

gtk will not interpret the semicolon ";" as comment indicator in settings.ini so

[Settings]
; foo=bar

will cause an error for the unknown key.

@inkle, whatever funny words we have for it, the "#" indicates a comment in gtk's ini syntax.
What problem are you *actually* trying to solve here?

Offline

#12 2026-01-28 05:23:25

dimich
Member
From: Kharkiv, Ukraine
Registered: 2009-11-03
Posts: 514

Re: [solved] gtk-3.0/settings.ini syntax for comments

inkle wrote:

Thanks, do you have a reference for that?

Good question, considering there is no specific standard.

Python's configparser recognizes both "#" and ";" by default: https://docs.python.org/3/library/confi … -structure

PHP uses ";": https://www.php.net/manual/en/function. … #example-1

Ruby gems uses ";": https://rubydoc.info/gems/ini/0.1.1/frames#comments

Git config recognizes both: https://git-scm.com/docs/git-config#EXAMPLES

Libinih uses ";": https://github.com/deepin-community/lib … /ini.h#L43

Interestingly, systemd configuration recognizes both: https://www.freedesktop.org/software/sy … yntax.html
It states:

The syntax is inspired by XDG Desktop Entry Specification .desktop files, which are in turn inspired by Microsoft Windows .ini files.

However, XDG Desktop Entry Specification states only "#": https://specifications.freedesktop.org/ … l#comments.
I didn't find MS Windows .ini specification but CHM spec states ";": https://www.nongnu.org/chmspec/latest/INI.html

seth wrote:

gtk will not interpret the semicolon ";" as comment indicator in settings.ini

Indeed, that's true. Good to know, thanks.

Offline

#13 2026-01-28 15:58:54

002445
Member
Registered: 2021-10-07
Posts: 36

Re: [solved] gtk-3.0/settings.ini syntax for comments

You guys sure have crazy names for the 'tic tac toe' sign.

Offline

#14 2026-01-29 03:44:49

inkle
Member
Registered: 2026-01-25
Posts: 8

Re: [solved] gtk-3.0/settings.ini syntax for comments

seth wrote:

What problem are you *actually* trying to solve here?

Sorry, I missed that when you first asked it.  I thought a particular application used GTK, so I created

.config/gtk-3.0/settings.ini

with this:

[Settings]
gtk-primary-button-warps-slider = false

It was purported to make the scrollbars always visible.  It didn't work.  So I thought GTK may have abandon the file once it say my # comments notes at the top of the file.

So maybe I'm using the wrong setting. Or maybe the XFCE window is not using GTK3.


... going on 70

Offline

#15 2026-01-29 09:23:42

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 73,541

Re: [solved] gtk-3.0/settings.ini syntax for comments

That controls what happens when you click into the scrollbar groove.
https://docs.gtk.org/gtk3/property.Sett … lling.html ?

Offline

#16 2026-01-29 20:17:54

inkle
Member
Registered: 2026-01-25
Posts: 8

Re: [solved] gtk-3.0/settings.ini syntax for comments

many thanks to @seth for pointing me to some very useful documentation.

I believe I found the answer to the question in the subject of this thread.  The answer is begin the line with a pound sign.

This page

    https://docs.gtk.org/gtk3/class.Settings.html

says

"GTK+ reads default values for settings from settings.ini files in /etc/gtk-3.0 .... must be valid key files (see GKeyFile), and have a section called Settings. "

and this page

    https://docs.gtk.org/glib/struct.KeyFile.html

says

The syntax of key files is described in detail in the Desktop Entry Specification, here is a quick summary: Key files consists of groups of key-value pairs, interspersed with comments.

# this is just an example
# there can be comments before the first group
[First Group]
Name=Key File Example\tthis value shows\nescaping
# localized strings are stored in multiple key-value pairs
Welcome=Hello
Welcome[de]=Hallo
Welcome[fr_FR]=Bonjour
Welcome[it]=Ciao
[Another Group]
Numbers=2;20;-200;0
Booleans=true;false;true;true

Lines beginning with a # and blank lines are considered comments.

Last edited by inkle (2026-01-29 20:33:10)


... going on 70

Offline

#17 2026-01-29 20:21:32

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 73,541

Re: [solved] gtk-3.0/settings.ini syntax for comments

Yeah, but that's never been the interesting question here - is gtk-overlay-scrolling the setting you were looking for?

Offline

#18 2026-01-29 20:28:35

inkle
Member
Registered: 2026-01-25
Posts: 8

Re: [solved] gtk-3.0/settings.ini syntax for comments

As for the problem I'm actually trying to solve, it might or might not be solvable after all, for several reasons, as explained on this page:

https://docs.gtk.org/gtk3/class.Settings.html

"Applications can override system-wide settings"

"GtkSettings are not meant as an application configuration facility. "

"settings that are specific to individual widgets may not be available before the widget type has been realized"

Regardless, I'll try to find the correct key

Last edited by inkle (2026-01-29 20:31:18)


... going on 70

Offline

#19 2026-01-29 20:49:39

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 73,541

Re: [solved] gtk-3.0/settings.ini syntax for comments

It was purported to make the scrollbars always visible.  It didn't work.  So I thought GTK may have abandon the file once it say my # comments notes at the top of the file.

So maybe I'm using the wrong setting. Or maybe the XFCE window is not using GTK3.

Where exactly do you want to change what behavior (application and which scrollbar does what atm and what do you want it to do)?

Offline

#20 2026-01-29 21:29:53

inkle
Member
Registered: 2026-01-25
Posts: 8

Re: [solved] gtk-3.0/settings.ini syntax for comments

seth wrote:

That controls what happens when you click into the scrollbar groove.
https://docs.gtk.org/gtk3/property.Sett … lling.html ?

Many thanks yet again to @seth for identifying the correct key. That works !

I also created .config/gtk-3.0/gtk.css with this, which seems to works for XFCE, emacs and localc:

scrollbar slider {
    /* Size of the slider */
    min-width: 20px;
    min-height: 20px;
    border-radius: 1px;

    /* Padding around the slider */
    border: 5px solid transparent;
}

For firefox 147, I used about:config to

widget.non-native-theme.scrollbar.size.override 30
widget.gtk.overlay-scrollbars.enabled = false


... going on 70

Offline

Board footer

Powered by FluxBB