[Xfce4-commits] [panel-plugins/xfce4-hardware-monitor-plugin] 87/96: Script to allow users to maintain configuration when upgrading to v1.4.6

noreply at xfce.org noreply at xfce.org
Thu Nov 27 22:21:32 CET 2014


This is an automated email from the git hooks/post-receive script.

nick pushed a commit to branch master
in repository panel-plugins/xfce4-hardware-monitor-plugin.

commit e7a9a679fab68c68014491cbcd7922fe083ef235
Author: OmegaPhil <OmegaPhil00 at startmail.com>
Date:   Fri Oct 24 16:11:24 2014 +0100

    Script to allow users to maintain configuration when upgrading to v1.4.6
---
 1.4.6-upgrade-fix-xfce4-config.bash |   30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/1.4.6-upgrade-fix-xfce4-config.bash b/1.4.6-upgrade-fix-xfce4-config.bash
new file mode 100755
index 0000000..0b5eb27
--- /dev/null
+++ b/1.4.6-upgrade-fix-xfce4-config.bash
@@ -0,0 +1,30 @@
+#!/bin/bash
+
+# This script updates references to this plugin of 'hardware-monitor' with 'xfce4-hardware-monitor-plugin' to be ran after the v1.4.6 upgrade
+
+# Rename plugin configuration files
+OIFS="$IFS"
+IFS=$'\n'
+for filename in $(ls -1 ~/.config/xfce4/panel)
+do
+    [[ $filename =~ ^hardware-monitor-([[:digit:]]+)\.rc$ ]] && {
+        mv ~/".config/xfce4/panel/$filename" ~/".config/xfce4/panel/xfce4-hardware-monitor-plugin-${BASH_REMATCH[1]}.rc" || echo "Unable to rename '$filename' plugin configuration file!" >&2
+    }
+done
+IFS="$OIFS"
+
+# Update panel config
+echo "Creating panel config backup at '~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml.bak'..."
+cp ~/".config/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml" ~/".config/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml.bak" || {
+    echo "Backup creation failed!" >&2
+    exit 1
+}
+sed 's/value="hardware-monitor"/value="xfce4-hardware-monitor-plugin"/g' ~/".config/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml" > ~/".config/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml.modified" || {
+    echo "Unable to update panel config!" >&2
+    exit 1
+}
+mv -f ~/".config/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml.modified" ~/".config/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml" || {
+    echo "Unable to replace old panel config with new one!" >&2
+    exit 1
+}
+echo "XFCE4 configuration has been updated - please log out now and back in again - once you've confirmed the change has worked, please delete the backup file '~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml.bak'"

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list