1
0
mirror of https://github.com/frebib/dotfiles.git synced 2024-06-14 12:57:23 +00:00

dpi: set cursor size with xsettings

Signed-off-by: Joe Groocock <me@frebib.net>
This commit is contained in:
Joe Groocock 2021-01-30 11:47:07 +00:00
parent 3b34decb42
commit 69787bd90f
Signed by: frebib
GPG Key ID: E0B16BEACFBB6A86
2 changed files with 13 additions and 5 deletions

View File

@ -13,15 +13,23 @@ fi
CONF_DIR="${XDG_CONFIG_HOME:-$HOME/.config}/xsettingsd" CONF_DIR="${XDG_CONFIG_HOME:-$HOME/.config}/xsettingsd"
mkdir -p "$CONF_DIR" mkdir -p "$CONF_DIR"
cursor=$(echo $dpi/6 | bc | cut -d. -f1)
# Build xsettingsd.local # Build xsettingsd.local
{ {
cat $CONF_DIR/xsettingsd.conf 2>/dev/null || true cat $CONF_DIR/xsettingsd.conf 2>/dev/null || true
echo Xft/DPI $(( $dpi*1024 )) echo Xcursor/size $cursor
echo Gdk/WindowScalingFactor $(( $dpi/96 )) echo Gtk/CursorThemeSize $cursor
echo Gdk/UnscaledDPI $(( $dpi*1024/($dpi/96) )) echo Xft/DPI $(( dpi*1024 ))
echo Gdk/WindowScalingFactor $(( dpi/96 ))
echo Gdk/UnscaledDPI $(( dpi*1024/(dpi/96) ))
} > $CONF_DIR/xsettingsd.local } > $CONF_DIR/xsettingsd.local
echo Xft.dpi: $dpi | xrdb -merge {
echo Xft.dpi: $dpi
echo Xcursor.size: $cursor
} | xrdb -merge
xrandr --dpi $dpi xrandr --dpi $dpi
systemctl --user reload-or-restart xsettingsd systemctl --user reload-or-restart xsettingsd

View File

@ -6,7 +6,7 @@ After=xprofile.service xorg.target
[Service] [Service]
ExecStart=/usr/bin/i3 ExecStart=/usr/bin/i3
ExecReload=/usr/bin/i3-msg reload ExecReload=/usr/bin/i3-msg restart
Restart=always Restart=always
Slice=session.slice Slice=session.slice