1
0
forked from extern/nix-config

meta: Add xeventbind package

This is an X-specific script that changes (mostly) everything that needs
to be changed on resolution change, with the exception of X cursor size.

Note that any programs already running are not affected. For this kind
of functionality, you probably want to use Wayland instead.
This commit is contained in:
Donovan Glover 2018-12-04 00:08:51 -05:00
parent 8b490aa2d0
commit 3d670565f7
No known key found for this signature in database
GPG Key ID: EA7408A77AE1BE65

View File

@ -0,0 +1,24 @@
#!/bin/sh
# Get the host width
HOST_WIDTH=$(bspc query -T -m | jq '.rectangle.width')
# Determine the DPI based on screen width
if [ "$HOST_WIDTH" -eq "1920" ]; then
X_DPI=96
fi
if [ "$HOST_WIDTH" -eq "3840" ]; then
X_DPI=192
fi
# Reposition the desktop background
~/.fehbg &
# If the DPI needs to be changed, change it
if [ "$X_DPI" ]; then
echo "Xft.dpi:$X_DPI" | xrdb -merge
fi
# Reload polybar with the new width / DPI
~/.config/polybar/launch.sh main &