mirror of
https://github.com/frebib/dotfiles.git
synced 2024-06-14 12:57:23 +00:00
systemd: add & enable xsettingsd service
Update `dpi` script to interact with systemd units
This commit is contained in:
parent
bbfb8fff3f
commit
505a8d255d
12
.config/systemd/user/xsettingsd.service
Normal file
12
.config/systemd/user/xsettingsd.service
Normal file
@ -0,0 +1,12 @@
|
||||
[Unit]
|
||||
Description=xsettingsd - provide settings to X11 applications
|
||||
Requires=xorg.target
|
||||
After=xorg.target profile.service
|
||||
|
||||
[Service]
|
||||
ExecStart=/bin/sh -c 'xsettingsd -c $XDG_CONFIG_HOME/xsettingsd/xsettingsd.local'
|
||||
ExecReload=/bin/kill -s HUP $MAINPID
|
||||
Restart=always
|
||||
|
||||
[Install]
|
||||
WantedBy=graphical-session.target
|
12
scripts/dpi
12
scripts/dpi
@ -21,11 +21,9 @@ mkdir -p "$CONF_DIR"
|
||||
echo Gdk/UnscaledDPI $(( $dpi*1024/($dpi/96) ))
|
||||
} > $CONF_DIR/xsettingsd.local
|
||||
|
||||
pid=$(xprop -name xsettingsd _NET_WM_PID 2> /dev/null | awk '{print $NF}')
|
||||
if [ -z "$pid" ]; then
|
||||
xsettingsd -c $CONF_DIR/xsettingsd.local &
|
||||
else
|
||||
kill -HUP $pid
|
||||
fi
|
||||
|
||||
echo Xft.dpi: $dpi | xrdb -merge
|
||||
xrandr --dpi $dpi
|
||||
|
||||
systemctl --user reload-or-restart xsettingsd
|
||||
systemctl --user --no-block reload i3
|
||||
systemctl --user --no-block restart polybar@i3bar dunst
|
||||
|
Loading…
Reference in New Issue
Block a user