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:
parent
fa136cbd2a
commit
d538b61cb1
@ -38,7 +38,7 @@ opacity-rule = [
|
|||||||
blur:
|
blur:
|
||||||
{
|
{
|
||||||
method = "dual_kawase";
|
method = "dual_kawase";
|
||||||
strength = 8;
|
strength = 10;
|
||||||
};
|
};
|
||||||
blur-background-frame = true;
|
blur-background-frame = true;
|
||||||
blur-background-fixed = true;
|
blur-background-fixed = true;
|
||||||
|
10
scripts/dpi
10
scripts/dpi
@ -4,6 +4,10 @@ set -eu
|
|||||||
# Based on https://github.com/vincentbernat/awesome-configuration/blob/master/bin/xsettingsd-setup
|
# Based on https://github.com/vincentbernat/awesome-configuration/blob/master/bin/xsettingsd-setup
|
||||||
CONF_DIR="${XDG_CONFIG_HOME:-$HOME/.config}"
|
CONF_DIR="${XDG_CONFIG_HOME:-$HOME/.config}"
|
||||||
|
|
||||||
|
BLUR_STRENGTH=10
|
||||||
|
CORNER_RADIUS=9
|
||||||
|
CURSOR_SIZE=16
|
||||||
|
|
||||||
xrdbget() {
|
xrdbget() {
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
xrdb -query | grep -i -m1 "$1" | sed 's/^.*:\s//g' || echo "$2"
|
xrdb -query | grep -i -m1 "$1" | sed 's/^.*:\s//g' || echo "$2"
|
||||||
@ -26,11 +30,11 @@ fi
|
|||||||
|
|
||||||
dpi=$1
|
dpi=$1
|
||||||
scale=$(( dpi/96 ))
|
scale=$(( dpi/96 ))
|
||||||
cursor=$(( dpi/6 ))
|
cursor=$(( (dpi*CURSOR_SIZE)/96 ))
|
||||||
|
|
||||||
# Update picom scale
|
# Update picom scale
|
||||||
sed -i -e "s/strength =.*$/strength = $(( dpi*8/96 ));/" \
|
sed -i -e "s/strength =.*$/strength = $(( (dpi*BLUR_STRENGTH)/96 ));/" \
|
||||||
-e "s/corner-radius =.*$/corner-radius = $(( dpi/13 ));/" \
|
-e "s/corner-radius =.*$/corner-radius = $(( (dpi*CORNER_RADIUS)/96 ));/" \
|
||||||
"$CONF_DIR/picom/picom.conf" &
|
"$CONF_DIR/picom/picom.conf" &
|
||||||
|
|
||||||
# Build xsettingsd.conf
|
# Build xsettingsd.conf
|
||||||
|
Loading…
Reference in New Issue
Block a user