Skip to content

Instantly share code, notes, and snippets.

@seidler2547
Created July 17, 2017 15:43
Show Gist options
  • Save seidler2547/0e7f40c9c48edeade5c589abbffea6b4 to your computer and use it in GitHub Desktop.
Save seidler2547/0e7f40c9c48edeade5c589abbffea6b4 to your computer and use it in GitHub Desktop.
True DPI settings in X
# change this to whatever you need
export DPI=165
# hardly useful
xrandr --dpi $DPI
# used by a couple of legacy applications
echo 'Xft.dpi: '$DPI | xrdb -merge -
# the point here is to increase the mouse cursor size - adjust to your preference
echo 'Xcursor.size: 32' | xrdb -merge -
# select a larger default font for old X applications or terminals like urxvt
echo '*font: -*-helvetica-medium-r-*-*-*-140-*-*-*-*-iso10646-*' | xrdb -merge -
# this is probably the most important setting, most applications read the DPI from xsettings
echo Xft/DPI $((DPI*1024)) >> ~/.xsettingsd
xsettingsd & # or pkill -HUP xsettingsd if it is already running
pref("general.config.obscure_value", 0); // only needed if you do not want to obscure the content with ROT-13
pref("general.config.filename", "mozilla.cfg");
//
defaultPref('layout.css.devPixelsPerPx', ''+(Math.floor(parseFloat(getenv('DPI'))/9.6)/10));
lockPref('layout.css.devPixelsPerPx', ''+(Math.floor(parseFloat(getenv('DPI'))/9.6)/10));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment