xlayoutdisplay icon indicating copy to clipboard operation
xlayoutdisplay copied to clipboard

Feature: support xsettingsd

Open infabo opened this issue 2 years ago • 2 comments

https://github.com/derat/xsettingsd is a lightweight replacement for gnome-settings-daemon. I use it together with i3wm.

It would be a nice if xlayoutdisplay would update Xft/DPI setting. see https://github.com/derat/xsettingsd/wiki/Settings

Settings-file is possibly always located at $HOME/.xsettingsd.

killall -HUP xsettingsd to reload the xsettingsd config.

infabo avatar Aug 11 '22 12:08 infabo

Today I Learned about xsettings. Under dwm, apps like chrome, inkscape, audacity, pavucontrol actively change their size when Xft/DPI is updated. Terminals alacritty, st and xterm do not read xsettingsd however that is to be expected.

An option could be added, something like:

-x [ --xsettingsd ]          update xsettingsd
...
echo "Xft.dpi: 156" | xrdb -merge

echo "Xft/DPI 159744" > ~/.xsettingsd

killall -HUP xsettingsd

Problem: The Xft/DPI setting in ~/.xsettingsd needs to be created or updated. Appending a new value to the file results in an error when there is already a value. Clobbering the whole file would result in other settings being lost.

Possible Solutions:

  1. Read ~/.xsettingsd if it's present, update or create Xft/DPI, write the file.
  2. Use a text processor like sed or awk to update ~/.xsettingsd

alex-courtis avatar Aug 13 '22 00:08 alex-courtis

xsettingsd seems a little immature and early in its lifecycle. An nicer API to update values would be useful, it may be added later.

However, I will happily accept a PR to add xsettingsd support.

Extension: No option, instead detect xsettingsd running (similar to xorgRunning) and perform the update.

alex-courtis avatar Aug 13 '22 00:08 alex-courtis