summaryrefslogtreecommitdiffstats
path: root/tools/gnome-shell-overrides-migration.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 15:07:22 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 15:07:22 +0000
commitf9d480cfe50ca1d7a0f0b5a2b8bb9932962bfbe7 (patch)
treece9e8db2d4e8799780fa72ae8f1953039373e2ee /tools/gnome-shell-overrides-migration.sh
parentInitial commit. (diff)
downloadgnome-shell-f9d480cfe50ca1d7a0f0b5a2b8bb9932962bfbe7.tar.xz
gnome-shell-f9d480cfe50ca1d7a0f0b5a2b8bb9932962bfbe7.zip
Adding upstream version 3.38.6.upstream/3.38.6upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tools/gnome-shell-overrides-migration.sh')
-rwxr-xr-xtools/gnome-shell-overrides-migration.sh38
1 files changed, 38 insertions, 0 deletions
diff --git a/tools/gnome-shell-overrides-migration.sh b/tools/gnome-shell-overrides-migration.sh
new file mode 100755
index 0000000..a1b4cb6
--- /dev/null
+++ b/tools/gnome-shell-overrides-migration.sh
@@ -0,0 +1,38 @@
+#!/bin/sh
+
+PKG_DATA_DIR=${XDG_DATA_HOME:-$HOME/.local/share}/gnome-shell
+
+MIGRATION_GUARD=$PKG_DATA_DIR/gnome-overrides-migrated
+OVERRIDE_SCHEMA=
+
+if [ -f $MIGRATION_GUARD ]; then
+ exit # already migrated
+fi
+
+# Find the right session
+if echo $XDG_CURRENT_DESKTOP | grep -q -v GNOME; then
+ exit # not a GNOME session
+fi
+
+if echo $XDG_CURRENT_DESKTOP | grep -q Classic; then
+ OVERRIDE_SCHEMA=org.gnome.shell.extensions.classic-overrides
+else
+ OVERRIDE_SCHEMA=org.gnome.shell.overrides
+fi
+
+mkdir -p $PKG_DATA_DIR
+
+for k in `gsettings list-keys $OVERRIDE_SCHEMA`
+do
+ if [ $k = button-layout ]; then
+ orig_schema=org.gnome.desktop.wm.preferences
+ else
+ orig_schema=org.gnome.mutter
+ fi
+
+ oldValue=`gsettings get $OVERRIDE_SCHEMA $k`
+ curValue=`gsettings get $orig_schema $k`
+ if [ $oldValue != $curValue ]; then
+ gsettings set $orig_schema $k $oldValue
+ fi
+done && touch $MIGRATION_GUARD