I need to programmatically get the value of com.ubuntu.user-interface scale-factor from gsettings in my C++ program. Is there any elegant way to do this, instead of calling gsettings binary and parsing it's output?
相关问题
- Sorting 3 numbers without branching [closed]
- How to compile C++ code in GDB?
- Why does const allow implicit conversion of refere
- thread_local variables initialization
- What uses more memory in c++? An 2 ints or 2 funct
I can't post a comment to Wintermute answer because of low reputation so I post it here.
Newbe, like me, could have problem including
<giomm/settings.h>
(not found): a solution is to append to gcc compile command`pkg-config --cflags --libs glibmm-2.4 giomm-2.4`
(with backticks)From here
There is a C++ binding to gsettings in glibmm. With it, reading a value from a schema can be done as shown below. Note that I do not have an Ubuntu system on which to test this, so specifics rely on a short look into the documentation that told me
scale-factor
is an integral value. With this in mind:See also here.