From 4c89ef385a5d4ad441e4ef96fac8b69503ca53ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ole=20J=C3=B8rgen=20Br=C3=B8nner?= Date: Sun, 16 Jun 2019 15:26:12 +0200 Subject: [PATCH] set-recommended-gnome-shell-settings: use 'gsettings' instead of 'dconf' dconf can't reliable get default values(?) According to https://bugzilla.redhat.com/show_bug.cgi?id=1541448 the dconf default value might also differ from the gsettings default value(?) I did not find a way to differentiate between "use default value" and the actual default value - so running the script might change some settings from "use default value" to the actual default value. IIUC 'gsettings' require the gsettings daemon to run, while 'dconf' is lower level and modify the database directly. Fixes #121 --- set-recommended-gnome-shell-settings.sh | 27 +++++++++++++------------ 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/set-recommended-gnome-shell-settings.sh b/set-recommended-gnome-shell-settings.sh index 7d4315b..b16d140 100755 --- a/set-recommended-gnome-shell-settings.sh +++ b/set-recommended-gnome-shell-settings.sh @@ -14,43 +14,44 @@ if [[ $GNOME_SHELL_VERSION > "GNOME Shell 3.3" ]]; then fi function set-with-backup { - DPATH=$1 + SCHEMA=$1 + KEY=$2 + TARGET_VAL=$3 if [[ $USE_OVERRIDE_SCHEMA == true ]]; then # Gnome 3.3x doesn't use the override path # https://gitlab.gnome.org/GNOME/gnome-shell/commit/393d7246cc176cbe8200a62bd661830597ca2fb6 - DPATH=$(echo $DPATH | - sed "s|^/org/gnome/shell/overrides/|/org/gnome/mutter/|g") + SCHEMA=$(echo $SCHEMA | + sed "s|^org\.gnome\.shell\.overrides|org.gnome.mutter|g") fi - TARGET_VAL=$2 - CURRENT_VAL=$(dconf read $DPATH) + CURRENT_VAL=$(gsettings get $SCHEMA $KEY) if [[ "$CURRENT_VAL" == "$TARGET_VAL" ]]; then return fi - echo "dconf write $DPATH $CURRENT_VAL" >> $RESTORE_SETTINGS_SCRIPT + echo "gsettings set $SCHEMA $KEY $CURRENT_VAL" >> $RESTORE_SETTINGS_SCRIPT - dconf write $DPATH $TARGET_VAL - echo "Changed $DPATH from '$CURRENT_VAL' to '$TARGET_VAL'" + gsettings set $SCHEMA $KEY $TARGET_VAL + echo "Changed $SCHEMA $KEY from '$CURRENT_VAL' to '$TARGET_VAL'" } ##### Recommended settings -set-with-backup /org/gnome/mutter/auto-maximize false +set-with-backup org.gnome.mutter auto-maximize false # Multi-monitor support is much more complete with workspaces spanning monitors -set-with-backup /org/gnome/shell/overrides/workspaces-only-on-primary false +set-with-backup org.gnome.shell.overrides workspaces-only-on-primary false # PaperWM currently works best using static workspaces -set-with-backup /org/gnome/shell/overrides/dynamic-workspaces false +set-with-backup org.gnome.shell.overrides dynamic-workspaces false # We make no attempt at handing edge-tiling -set-with-backup /org/gnome/shell/overrides/edge-tiling false +set-with-backup org.gnome.shell.overrides edge-tiling false # Attached modal dialogs isn't handled very well -set-with-backup /org/gnome/shell/overrides/attach-modal-dialogs false +set-with-backup org.gnome.shell.overrides attach-modal-dialogs false echo