I have made a clean installation of Kubuntu 16.04 and played around with the font sizes and other settings (such as the fonts DPI, but I tried resetting it...) to make it more to my liking and everything works fine, except for Viber; It is huge! It takes up pretty much the whole screen and cannot be resized to a smaller window (as the interface itself appears enormous, the letters, everything). Any other program I've used is completely normal...
5 Answers
Just updated to lastet Viber version and it became huge.
The reason is that 1920x1080 px on 13" screen has dpi of 166, what I have set in my xfce settings. A lot of apps powered with electron or other custom magic treat dpi over 140 as "retina" and double rendering size.
Viber settings screen cannot go UI scaling under 100%, so you can do it manually.
New solution (works for Viber >= v7.0)
Try running Viber from the terminal by specifying the QT_SCALE_FACTOR as follows:
QT_SCALE_FACTOR=0.6 /opt/viber/Viber
As a permanent solution, ensure the following line is in place in the Viber starter shortcut file (.desktop):
Exec=env QT_SCALE_FACTOR=0.6 /opt/viber/Viber
The Viber .desktop file is usually located at /usr/share/applications/viber.desktop. A locally editable copy can be placed in ~/local/share/applications/.
Old solution (works for Viber < v7.0)
Install sqlitebrowser from official repo, use it to open ~/.ViberPC/config.db
Go to table CommonSettings and modify Value of ScalingRatio to something under 1.0, I used 0.6.
- 706
- 6
- 6
-
1BTW this works also on gnome gui if some one needs it. – lewis4u May 01 '17 at 13:52
-
that's awesome! works ubuntu 17.04 with unity and 1920x1080 – borowis Jun 06 '17 at 14:07
-
seems to be not working any more, there is no ScalingRatio title and if created and set value to 0.6 nothing changes – Dmitriy Nov 08 '17 at 17:20
-
@geotavros tried with Viber v7 and updated answer, try now – Modo Ltunzher Nov 09 '17 at 18:19
-
Confirmed the Viber v7 update. It crashes the Mate panel when updating the application launcher for some reason - but running from the terminal works like a charm, thanks! – Mario Peshev Nov 12 '17 at 22:40
-
2@ModoLtunzher, thank you. It worked from terminal, but I struggled to get the .desktop file working. Eventually I did drag n drop of Viber icon from dash to desktop. Launched text editor and opened the Viber.desktop file from it. Then I had to add `env` keyword before the `QT_SCALE_FACTOR`. After that it worked – Dmitriy Nov 15 '17 at 13:12
-
The new solution doesn't seem to work for me... It managed to work once and then when I closed the terminal window it reverted. Now once again it says 'QApplication: invalid style override passed, ignoring it.' If I force it with sudo viber goes into a constant Online Offline state and terminal spams 'Qt WebEngine ICU data not found at /opt/viber/resources. Trying parent directory...' and 'qml: type="" '..... – Kristóf Jan 24 '18 at 16:47
-
2@Kristóf if you run application from terminal, then it becomes parent process and when you close terminal window it also destroys child processes. If you need to keep process, you better run it with ```/opt/Viber/Viber&```. If you want to run viber froum your applications menu with correct scaling, edit Viber menu entry with corresponding editor for your DE and change it from ```/opet/Viber/Viber %U``` to ```env QT_SCALE_FACTOR=0.6 /opt/Viber/Viber %U``` and save – Modo Ltunzher Jan 25 '18 at 15:34
-
I see, but which file do I change? I can't seem to be able to open the opt/Viber/Viber file with a text editor. Is the .desktop file somewhere else? – Kristóf Jan 25 '18 at 16:02
-
Nevermind, I found the desktop file. I'll try to see if it works, thanks. – Kristóf Jan 25 '18 at 16:13
-
That was not worked for me on my Xenial Xubuntu, but the `QT_AUTO_SCREEN_SCALE_FACTOR=0` solved my problem. - http://blog.qt.io/blog/2016/01/26/high-dpi-support-in-qt-5-6/ – andras.tim Jun 17 '18 at 22:48
-
@Kristof you have completed the answer thank you. – SudarP Jan 30 '19 at 11:33
-
This doesn't work with the most recent version. – Svetlana Belkin Mar 28 '19 at 20:27
-
@SvetlanaBelkin I'm using version 10.3.0 and this still works. What version are you using? – Hubro Mar 29 '19 at 15:32
-
10.3.0. Strange. – Svetlana Belkin Mar 30 '19 at 12:04
-
You need to modify the line in the viber.desktop file and set the resolution to your screen, adjust the value, it can be any small like 0.5 or anything higher like 1.5: "exec=env QT_SCALE_FACTOR=1.1 /opt/viber/Viber %u" There Viber.desktop files can be found at 2 places: "/usr/share/applications/" and "/home/username/.local/share/applications" When I edited the 1st file nothing happened. When I edited the .local file, it changed to correct resolution! So: adjust QT_SCALE_FACTOR in "/home/username/.local/share/applications/Viber.desktop" to a good value. – Gabor Apr 18 '22 at 07:52
If you have double screen this is not good solution.
I prefer to set the environment variable QT_AUTO_SCREEN_SCALE_FACTOR=0 with env.
For example:
env QT_AUTO_SCREEN_SCALE_FACTOR=0 /opt/viber/Viber
- 116,445
- 54
- 318
- 493
- 201
- 2
- 3
Or use sqlite3
$ sqlite3 ~/.ViberPC/config.db -interactive 'update CommonSettings set Value = 0.6 where Title = "ScalingRatio"'
- 81
- 1
- 1
-
4Welcome to Ask Ubuntu! This looks more like a (worthwhile) addition to the accepted answer and less like a self-contained answer. In such a case please suggest an edit to the post you want to improve instead of posting a partial answer. Thanks. – David Foerster May 12 '17 at 16:35
-
1
From Qt documentation:
QT_AUTO_SCREEN_SCALE_FACTOR [boolean]enables automatic scaling, based on the pixel density of the monitor. This will not change the size of point sized fonts, since point is a physical unit of measure. Multiple screens may get different scale factors.
So setting this to false (zero) will not always solve the scaling problem. I had to change QT_SCALE_FACTOR=0 to display Viber window normally:
env QT_SCALE_FACTOR=0 QT_AUTO_SCREEN_SCALE_FACTOR=0 /opt/viber/Viber
For Viber v7.0 and >
I create file
touch viber.desktop
in file write
Exec=env QT_SCREEN_SCALE_FACTORS=0.6 /opt/viber/Viber
Then if I want start Viber -> use command in terminal
source viber.desktop
It's QT bug. I hope someone fix it.
- 21
- 2