Created
August 28, 2018 17:45
-
-
Save maz-1/936308f198ac33dc5358b0f72b9034b7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
#/etc/X11/xinit/xinitrc.d/kde-gtk-hidpi.sh | |
#dependencies: crudini, xsettingsd | |
if [ "z$XDG_SESSION_DESKTOP" = "zKDE" ] | |
then | |
ScaleFactor=$(crudini --get $HOME/.config/kdeglobals KScreen ScaleFactor || echo 1) | |
export GDK_SCALE=$ScaleFactor | |
export GDK_DPI_SCALE=$(echo "scale=1;1/$ScaleFactor"|bc|sed 's/^\./0./') | |
smallSize=$(printf %.0f $(echo "scale=0;12*$ScaleFactor"|bc)) | |
bigSize=$(printf %.0f $(echo "scale=0;20*$ScaleFactor"|bc)) | |
xsettingsd_conf="/run/user/$UID/xsettingsd.conf" | |
xsettingsd_log="/run/user/$UID/xsettingsd.log" | |
echo "Gtk/IconSizes \"panel-menu=$bigSize,$bigSize:panel=$bigSize,$bigSize:gtk-menu=$smallSize,$smallSize:gtk-large-toolbar=$bigSize,$bigSize:gtk-small-toolbar=$bigSize,$bigSize:gtk-button=$smallSize,$smallSize\"" > $xsettingsd_conf | |
nohup xsettingsd -c $xsettingsd_conf >$xsettingsd_log 2>&1 & | |
fi | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment