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

scripts/dpi: Constant blur/corner-radius/cursor scaling

Scale picom blur and corner radius and X cursor size according to a
constant scale factor. This ideally would be defined somewhere
centrally, but this is better than nothing.

Signed-off-by: Joe Groocock <me@frebib.net>
This commit is contained in:
Joe Groocock 2022-10-26 22:54:02 +01:00
parent fa136cbd2a
commit d538b61cb1
Signed by: frebib
GPG Key ID: E0B16BEACFBB6A86
2 changed files with 8 additions and 4 deletions

View File

@ -38,7 +38,7 @@ opacity-rule = [
blur:
{
method = "dual_kawase";
strength = 8;
strength = 10;
};
blur-background-frame = true;
blur-background-fixed = true;

View File

@ -4,6 +4,10 @@ set -eu
# Based on https://github.com/vincentbernat/awesome-configuration/blob/master/bin/xsettingsd-setup
CONF_DIR="${XDG_CONFIG_HOME:-$HOME/.config}"
BLUR_STRENGTH=10
CORNER_RADIUS=9
CURSOR_SIZE=16
xrdbget() {
set -o pipefail
xrdb -query | grep -i -m1 "$1" | sed 's/^.*:\s//g' || echo "$2"
@ -26,11 +30,11 @@ fi
dpi=$1
scale=$(( dpi/96 ))
cursor=$(( dpi/6 ))
cursor=$(( (dpi*CURSOR_SIZE)/96 ))
# Update picom scale
sed -i -e "s/strength =.*$/strength = $(( dpi*8/96 ));/" \
-e "s/corner-radius =.*$/corner-radius = $(( dpi/13 ));/" \
sed -i -e "s/strength =.*$/strength = $(( (dpi*BLUR_STRENGTH)/96 ));/" \
-e "s/corner-radius =.*$/corner-radius = $(( (dpi*CORNER_RADIUS)/96 ));/" \
"$CONF_DIR/picom/picom.conf" &
# Build xsettingsd.conf