summary refs log tree commit diff
path: root/run_gnome_tweaks.sh.tmpl
diff options
context:
space:
mode:
Diffstat (limited to 'run_gnome_tweaks.sh.tmpl')
-rwxr-xr-xrun_gnome_tweaks.sh.tmpl16
1 files changed, 5 insertions, 11 deletions
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