From 69787bd90fa3678a01ce3d8fe3a6a32d805a8bd7 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Sat, 30 Jan 2021 11:47:07 +0000 Subject: [PATCH] dpi: set cursor size with xsettings Signed-off-by: Joe Groocock --- scripts/dpi | 16 ++++++++++++---- systemd/user/i3.service | 2 +- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/scripts/dpi b/scripts/dpi index e485b9a..361e1de 100755 --- a/scripts/dpi +++ b/scripts/dpi @@ -13,15 +13,23 @@ fi CONF_DIR="${XDG_CONFIG_HOME:-$HOME/.config}/xsettingsd" mkdir -p "$CONF_DIR" +cursor=$(echo $dpi/6 | bc | cut -d. -f1) + # Build xsettingsd.local { cat $CONF_DIR/xsettingsd.conf 2>/dev/null || true - echo Xft/DPI $(( $dpi*1024 )) - echo Gdk/WindowScalingFactor $(( $dpi/96 )) - echo Gdk/UnscaledDPI $(( $dpi*1024/($dpi/96) )) + echo Xcursor/size $cursor + echo Gtk/CursorThemeSize $cursor + echo Xft/DPI $(( dpi*1024 )) + echo Gdk/WindowScalingFactor $(( dpi/96 )) + echo Gdk/UnscaledDPI $(( dpi*1024/(dpi/96) )) } > $CONF_DIR/xsettingsd.local -echo Xft.dpi: $dpi | xrdb -merge +{ + echo Xft.dpi: $dpi + echo Xcursor.size: $cursor +} | xrdb -merge + xrandr --dpi $dpi systemctl --user reload-or-restart xsettingsd diff --git a/systemd/user/i3.service b/systemd/user/i3.service index 2957748..611cef5 100644 --- a/systemd/user/i3.service +++ b/systemd/user/i3.service @@ -6,7 +6,7 @@ After=xprofile.service xorg.target [Service] ExecStart=/usr/bin/i3 -ExecReload=/usr/bin/i3-msg reload +ExecReload=/usr/bin/i3-msg restart Restart=always Slice=session.slice