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:
parent
8b490aa2d0
commit
3d670565f7
24
xeventbind/.config/xeventbind/on-resolution-change.sh
Executable file
24
xeventbind/.config/xeventbind/on-resolution-change.sh
Executable 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 &
|
Loading…
Reference in New Issue
Block a user