Choose style:

Author Topic: dpi settings utility [SOLVED]  (Read 391 times)

0 Members and 1 Guest are viewing this topic.

Offline maxy2

  • Jr. Member
  • **
  • Posts: 45
  • Karma: 1
  • New Forum User
    • View Profile
  • Peppermint version(s): 8 and 9
dpi settings utility [SOLVED]
« on: July 09, 2019, 09:18:25 am »
Hello

I note in PM10 there is a dpi settings utility. On my PM desktop the menu labels and tray icons are very small on my laptop screen. Is it possible to use the dpi settings on PM 8. I cannot increase the size of the above items simply by increasing the resolution. I have tried already.
« Last Edit: July 20, 2019, 09:03:01 am by maxy2 »

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 26126
  • Karma: 2845
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 10
Re: dpi settings utility
« Reply #1 on: July 09, 2019, 10:19:05 am »
In Peppermint 8, what's the contents of
Code: [Select]
xed ~/.config/lxsession/Peppermint/desktop.conf
?
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline maxy2

  • Jr. Member
  • **
  • Posts: 45
  • Karma: 1
  • New Forum User
    • View Profile
  • Peppermint version(s): 8 and 9
Re: dpi settings utility
« Reply #2 on: July 10, 2019, 07:27:30 am »
Code: [Select]
[Session]
windows_manager/command=xfwm4
windows_manager/session=Peppermint
windows_manager/extras=
panel/command=xfce4-panel
panel/session=Peppermint
screensaver/command=
power_manager/command=xfce4-power-manager
file_manager/command=nemo
file_manager/session=peppermint
file_manager/extras=
desktop_manager/command=nemo -n
desktop_manager/wallpaper=
polkit/command=lxpolkit
network_gui/command=
audio_manager/command=pavucontrol
quit_manager/command=lxsession-logout
quit_manager/image=/usr/share/peppermint/images/logout-banner.png
quit_manager/layout=top
workspace_manager/command=peppermint-control-center
launcher_manager/command=xfrun4
launcher_manager/autostart=false
terminal_manager/command=x-terminal-emulator
screenshot_manager/command=pyshot
upgrade_manager/command=mintupdate
clipboard/command=
composite_manager/command=
composite_manager/autostart=
disable_autostart=no
upstart_user_session=false
webbrowser/command=x-www-browser
webbrowser/desktop=
im1/command=
im1/autostart=
webcam/command=guvcview
xsettings_manager/command=build-in
proxy_manager/command=build-in
keyring/command=ssh-agent
lock_manager/command=xflock4
image_display/command=xviewer

[State]
laptop_mode=yes
guess_default=true

[Dbus]
lxde=true
gnome=false

[Keymap]
mode=system
model=
layout=
variant=
options=

[XRandr]
mode=
command=

[Security]
keyring=no

[a11y]
activate=no
type=

[Updates]
activate=true

[Environment]
type=peppermint
menu_prefix=peppermint-

[GTK]
sNet/ThemeName=Peppermix-Dark-7
sNet/IconThemeName=Peppermix-7
sGtk/FontName=Ubuntu 14
iGtk/ToolbarStyle=3
iGtk/ButtonImages=1
iGtk/MenuImages=1
iGtk/CursorThemeSize=18
iXft/Antialias=1
iXft/Hinting=1
sXft/HintStyle=hintfull
sXft/RGBA=rgb
sGtk/CursorThemeName=DMZ-White
sGtk/ColorScheme=
iGtk/ToolbarIconSize=3
iNet/EnableEventSounds=1
iNet/EnableInputFeedbackSounds=1

[Mouse]
AccFactor=20
AccThreshold=10
LeftHanded=0

[Keyboard]
Delay=500
Interval=30
Beep=1
« Last Edit: July 10, 2019, 11:54:33 am by PCNetSpec »

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 26126
  • Karma: 2845
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 10
Re: dpi settings utility
« Reply #3 on: July 10, 2019, 11:53:45 am »
Okay run:
Code: [Select]
xed ~/.config/lxsession/Peppermint/desktop.conf
find the [GTK] section that currently reads:-
Code: [Select]
[GTK]
sNet/ThemeName=Peppermix-Dark-7
sNet/IconThemeName=Peppermix-7
sGtk/FontName=Ubuntu 14
iGtk/ToolbarStyle=3
iGtk/ButtonImages=1
iGtk/MenuImages=1
iGtk/CursorThemeSize=18
iXft/Antialias=1
iXft/Hinting=1
sXft/HintStyle=hintfull
sXft/RGBA=rgb
sGtk/CursorThemeName=DMZ-White
sGtk/ColorScheme=
iGtk/ToolbarIconSize=3
iNet/EnableEventSounds=1
iNet/EnableInputFeedbackSounds=1
and instead edit just that section to read:-
Code: [Select]
[GTK]
sNet/ThemeName=Peppermix-Dark-7
sNet/IconThemeName=Peppermix-7
sGtk/FontName=Ubuntu 14
iGtk/ToolbarStyle=3
iGtk/ButtonImages=1
iGtk/MenuImages=1
iGtk/CursorThemeSize=18
iXft/Antialias=1
iXft/Hinting=1
sXft/HintStyle=hintfull
sXft/RGBA=rgb
sGtk/CursorThemeName=DMZ-White
sGtk/ColorScheme=
iGtk/ToolbarIconSize=3
iNet/EnableEventSounds=1
iNet/EnableInputFeedbackSounds=1
iXft/DPI=98304
(so basically you're adding a single line to the end of the [GTK] section that reads iXft/DPI=98304)

SAVE the file and exit the text editor.

Now download this .deb file
https://launchpad.net/~peppermintos/+archive/ubuntu/p10-release/+files/peppermint-font-dpi-settings_10.0.0.3_all.deb
and double-click it to install it.

Once installed you should have a new item in the main menu at:-

Menu > Settings > Font DPI Settings

and hopefully it should work.
« Last Edit: July 10, 2019, 11:55:53 am by PCNetSpec »
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline maxy2

  • Jr. Member
  • **
  • Posts: 45
  • Karma: 1
  • New Forum User
    • View Profile
  • Peppermint version(s): 8 and 9
Re: dpi settings utility
« Reply #4 on: July 11, 2019, 09:57:21 am »
Adjustment made as suggested and downloaded but on clicking application - it does not open?

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 26126
  • Karma: 2845
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 10
Re: dpi settings utility
« Reply #5 on: July 11, 2019, 01:29:01 pm »
Does it work if you run:
Code: [Select]
sudo apt-get install yad
first ?

if not, do you get any error from running:
Code: [Select]
/usr/share/peppermint-font-dpi-settings/peppermint-font-dpi-settings
?
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline maxy2

  • Jr. Member
  • **
  • Posts: 45
  • Karma: 1
  • New Forum User
    • View Profile
  • Peppermint version(s): 8 and 9
Re: dpi settings utility
« Reply #6 on: July 12, 2019, 04:48:58 am »
Does it work if you run:
Code: [Select]
sudo apt-get install yad
first ?

if not, do you get any error from running:
Code: [Select]
/usr/share/peppermint-font-dpi-settings/peppermint-font-dpi-settings
?

dpi Gui  did not run after:sudo apt-get install yad

Output from running /usr/share/peppermint-font-dpi-settings/peppermint-font-dpi-settings

File "/usr/share/peppermint-font-dpi-settings/peppermint-font-dpi-settings", line 10
    path = f'{os.getenv("HOME")}/.config/lxsession/Peppermint/desktop.conf'
                                                                          ^
SyntaxError: invalid syntax

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 26126
  • Karma: 2845
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 10
Re: dpi settings utility
« Reply #7 on: July 12, 2019, 08:04:05 am »
Must be a difference in the syntax accepted between the different python versions

Do you know what you want the DPI to be ?



Maybe try making the contents read
Code: [Select]
#!/usr/bin/env python3

import os
import subprocess

home_folder = os.getenv("HOME")

nemo_desktop_stop = 'pkill -u $USER nemo-desktop'

nemo_desktop_start = 'nohup nemo-desktop >/dev/null 2>&1 &'

path = f'{home_folder}/.config/lxsession/Peppermint/desktop.conf'

with open(path, 'r+') as io:
    text = io.read()

active = False
lines = text.split('\n')
for line in lines:
    if line.startswith('iXft/DPI='):
        active = True
        value = int(int(line.split('=')[1])/1024)

if active:
    resultObject = subprocess.run([
        'yad',
        '--title="Font DPI Settings"',
        '--width=500',
        '--scale',
        '--text-align=center',
        '--text="Select desired Font DPI, then click OK to apply (Default = 96)"',
        '--min-value=72',
        '--max-value=240',
        '--window-icon=font-select-symbolic',
        f'--value={value}'
    ], stdout=subprocess.PIPE)

    if resultObject.returncode:
        print('iXft config cancelled')
    else:
        dpi = int(resultObject.stdout.decode())*1024
        for i in range(len(lines)):
            if lines[i].startswith('iXft/DPI='):
                lines[i]=f'iXft/DPI={dpi}'
        text = '\n'.join(lines)
        with open(path, 'w') as io:
            io.write(text)
        os.system(nemo_desktop_stop)
        os.system(nemo_desktop_start)
        print(f'iXft set to {dpi}')

else:
    print('(iXft not active)')
« Last Edit: July 12, 2019, 08:21:21 am by PCNetSpec »
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline maxy2

  • Jr. Member
  • **
  • Posts: 45
  • Karma: 1
  • New Forum User
    • View Profile
  • Peppermint version(s): 8 and 9
Re: dpi settings utility
« Reply #8 on: July 18, 2019, 04:30:31 am »
Thanks for the above suggestions. I have been playing with customize look and feel and the font settings and I can see some of the menu headings are possible to enlarge  but others not -  (this has helped but the effect is very gradual) . So for example in Nemo the title of the folder 'home' is very small but 'file, edit etc' can be increased?  This is not a huge problem. I wondered if this font size issue is why the new dpi utility was added to PM 10? I can see this issue has affected other distros.

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 26126
  • Karma: 2845
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 10
Re: dpi settings utility
« Reply #9 on: July 18, 2019, 08:39:10 am »
If you know what size you want the font DPI setting to be, you should be able to just edit the line:-
Code: [Select]
iXft/DPI=98304
but be VERY careful not to go below say 73728 (which is equal to a DPI of 72) or above 245760 (which equals a DPI of 240) .. if you enter too low a value, the second you hit save, all your text will disappear.

the value is calculated as:-

Required DPI x 1024 = value

(98304 1024 being the default setting of 96 DPI)



.. [snip] .. I wondered if this font size issue is why the new dpi utility was added to PM 10? I can see this issue has affected other distros.

Yep, that's one of the reasons why it was added .. the other being to make font sizes more easily adjustable GUI wide on HiDPI monitors.
« Last Edit: July 18, 2019, 08:54:12 am by PCNetSpec »
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline maxy2

  • Jr. Member
  • **
  • Posts: 45
  • Karma: 1
  • New Forum User
    • View Profile
  • Peppermint version(s): 8 and 9
Re: dpi settings utility
« Reply #10 on: July 20, 2019, 09:01:51 am »
Thanks for that PCNetSpec, I will use those adjustments if the font size issue becomes a problem again. At the moment font size is acceptable using customize look and feel,  and overall the system is  running well from a USB. ;D