aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYanze Li <liyzunique@gmail.com>2019-09-02 14:52:00 -0500
committerPhilipp Hemmelmayr <fips.hem@gmail.com>2019-09-02 21:52:00 +0200
commit6c66db535fb6b83be74c2c84ede43352200f0968 (patch)
tree49f1b4b9036aec788033d4e3c1ca8f0208e85789
parent69ae265a4075c9fb890fe3c2d8b3364b20bad64a (diff)
fix scaling when Xft.dpi are set (#114)
-rwxr-xr-xbetterlockscreen5
1 files changed, 4 insertions, 1 deletions
diff --git a/betterlockscreen b/betterlockscreen
index b171e08..cc74275 100755
--- a/betterlockscreen
+++ b/betterlockscreen
@@ -158,7 +158,10 @@ lockselect() {
logical_px() {
# get dpi value from xrdb
local DPI
- DPI=""$(xdpyinfo | sed -En "s/\s*resolution:\s*([0-9]*)x([0-9]*)\s.*/\\$2/p" | head -n1)
+ DPI=$(cat ~/.Xresource | grep -oP 'Xft.dpi:\s*\K\d+' | bc)
+ if [ -z "$DPI" ]; then
+ DPI=$(xdpyinfo | sed -En "s/\s*resolution:\s*([0-9]*)x([0-9]*)\s.*/\\$2/p" | head -n1)
+ fi
# return the default value if no DPI is set
if [ -z "$DPI" ]; then