<< January 2020 | Home | March 2020 >>

Multimonitor-Setup mit 4k and HD

Ubuntu Mate: Since I have a 4k monitor I want to get both monitors to be scaled accordingly. I had to increase the dpi on the 4k which resulted in too big fonts on the HD-Monitor. Now I found a way to set this up right base on one forum-entry . (Thx to user: dglt)

In my setup I set the font dpi to 125 and set scale for the HD-Monitor to 1.3x1.3. I actually don't know why higher numbers means to zoom out more but I didn't read too much about xrandr at all:

sudo xrandr --output HDMI-1 --auto --scale 1.3x1.3 --output HDMI-0 --auto --scale 1.0x1.0 --left-of HDMI-1

To check the monitor name, you can use:

xrandr --listmonitors 

One way to make it permanent you can create a .desktop file which will be executed on startup put it here:

[Desktop Entry]
Name=Set xrandr display scale
Exec=sh -c "xrandr --output HDMI-1 --auto --scale 1.3x1.3 --output HDMI-0 --auto --scale 1.0x1.0 --left-of HDMI-1"

Last thing to do to create 2 sym-links in some other autostart-locations:

sudo ln -s /usr/local/share/display-scale.desktop /usr/share/gdm/greeter/autostart/display-scale.desktop
sudo ln -s /usr/local/share/display-scale.desktop /etc/xdg/autostart/display-scale.desktop
Tags : ,

rapidjson: iterate over object and array

    // get an object    
    auto groups = doc["groups"].GetObject();

    // iterate over key-value-pairs ( group.name and group.value )
    for (auto const& group : groups){
        cout << "group:" << group.name.GetString() << endl;

        // the value is an array. The call to iterate over the array is basically the same as for the object 
        for (auto const& p : group.value.GetArray()){
            cout << "\t" << p.GetString() << endl;

obviously you don't need to const the value:

for (auto& group : groups){...
Tags : ,
<< January 2020 | Home | March 2020 >>