mirror of
https://github.com/frebib/dotfiles.git
synced 2024-06-14 12:57:23 +00:00
scripts/dpi: Add more xsettings configuration from xrdb
Read some standard xsettings values out of xrdb and set them in xsettingsd. Use bash instead of sh to allow for `set -o pipefail`. Signed-off-by: Joe Groocock <me@frebib.net>
This commit is contained in:
parent
85ab256484
commit
a6f162b7e2
11
scripts/dpi
11
scripts/dpi
@ -1,9 +1,14 @@
|
|||||||
#!/bin/sh
|
#!/bin/bash
|
||||||
set -eu
|
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}"
|
||||||
|
|
||||||
|
xrdbget() {
|
||||||
|
set -o pipefail
|
||||||
|
xrdb -query | grep -i -m1 "$1" | sed 's/^.*:\s//g' || echo "$2"
|
||||||
|
}
|
||||||
|
|
||||||
dpi=$1
|
dpi=$1
|
||||||
|
|
||||||
if [ -z "$1" ]; then
|
if [ -z "$1" ]; then
|
||||||
@ -24,6 +29,10 @@ mkdir -p "$CONF_DIR/xsettingsd"
|
|||||||
cat "$CONF_DIR/xsettingsd.local" 2>/dev/null || true
|
cat "$CONF_DIR/xsettingsd.local" 2>/dev/null || true
|
||||||
echo "Xcursor/size $cursor"
|
echo "Xcursor/size $cursor"
|
||||||
echo "Gtk/CursorThemeSize $cursor"
|
echo "Gtk/CursorThemeSize $cursor"
|
||||||
|
echo "Gtk/CursorThemeName \"$(xrdbget Xcursor.theme Adwaita)\""
|
||||||
|
echo "Xft/HintStyle \"$(xrdbget Xft.hintstyle hintfull)\""
|
||||||
|
echo "Xft/Hinting \"$(xrdbget Xft.hinting -1)\""
|
||||||
|
echo "Xft/RGBA \"$(xrdbget Xft.rgba rgb)\""
|
||||||
echo "Xft/DPI $(( dpi*1024 ))"
|
echo "Xft/DPI $(( dpi*1024 ))"
|
||||||
echo "Gdk/WindowScalingFactor $scale"
|
echo "Gdk/WindowScalingFactor $scale"
|
||||||
echo "Gdk/UnscaledDPI $(( dpi*1024/scale ))"
|
echo "Gdk/UnscaledDPI $(( dpi*1024/scale ))"
|
||||||
|
Loading…
Reference in New Issue
Block a user