From 0266521687393cb5e1f816bcdb9631147a23b19c Mon Sep 17 00:00:00 2001 From: Alen Date: Thu, 14 Sep 2023 01:18:30 +0400 Subject: Fix and simplify run_gnome_tweaks.sh.tmpl --- run_gnome_tweaks.sh.tmpl | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'run_gnome_tweaks.sh.tmpl') diff --git a/run_gnome_tweaks.sh.tmpl b/run_gnome_tweaks.sh.tmpl index eaa37d2..b5d440e 100755 --- a/run_gnome_tweaks.sh.tmpl +++ b/run_gnome_tweaks.sh.tmpl @@ -2,21 +2,15 @@ set -e -# TODO: Move settings to .chezmoi.toml.tmpl - dconf write /org/gnome/desktop/interface/color-scheme "'prefer-dark'" -{{ if eq .chezmoi.username "sophie" }} - dconf write /org/gnome/desktop/wm/preferences/button-layout "':appmenu,close'" -{{ else }} - dconf write /org/gnome/desktop/wm/preferences/button-layout "'close,appmenu:'" -{{ end }} +dconf write /org/gnome/desktop/wm/preferences/button-layout "'{{ .gnome.buttonLayout }}'" -{{ if and (lookPath "systemd-detect-virt") (ne (output "systemd-detect-virt") "none") }} +if systemd-detect-virt &>/dev/null; then dconf write /org/gnome/desktop/session/idle-delay "uint32 0" dconf write /org/gnome/settings-daemon/plugins/power/sleep-inactive-ac-type "'nothing'" -{{ end }} +fi -{{ if and (lookPath "hostnamectl") (eq (output "hostnamectl" "chassis") "laptop" "vm") }} +if [[ "$(hostnamectl chassis 2>/dev/null)" =~ ^(vm|laptop)$ ]]; then dconf write /org/gnome/desktop/peripherals/mouse/natural-scroll "true" dconf write /org/gnome/desktop/peripherals/touchpad/two-finger-scrolling-enabled "true" -{{ end }} +fi -- cgit 1.4.1-2-gfad0