Adding script for initial xfce4-panel configuration.
authorRichard Nelson <unixabg@gmail.com>
Thu, 24 Jan 2013 17:42:38 +0000 (11:42 -0600)
committerDaniel Baumann <daniel@debian.org>
Thu, 24 Jan 2013 18:05:46 +0000 (19:05 +0100)
scripts/config/1170-xfce4-panel [new file with mode: 0755]

diff --git a/scripts/config/1170-xfce4-panel b/scripts/config/1170-xfce4-panel
new file mode 100755 (executable)
index 0000000..4cdd71b
--- /dev/null
@@ -0,0 +1,44 @@
+#!/bin/sh
+
+## live-config(7) - System Configuration Scripts
+## Copyright (C) 2006-2013 Daniel Baumann <daniel@debian.org>
+##
+## This program comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
+## This is free software, and you are welcome to redistribute it
+## under certain conditions; see COPYING for details.
+
+
+Xfce4_panel ()
+{
+       # Checking if package is installed or already configured
+       if [ ! -e /var/lib/dpkg/info/xfce4-panel.list ] || \
+          [ -e /var/lib/live/config/xfce4-panel ]
+       then
+               return
+       fi
+
+       echo -n " xfce4-panel"
+
+       # Reading kernel command line
+       for _PARAMETER in ${_CMDLINE}
+       do
+               case "${_PARAMETER}" in
+                       live-config.username=*|username=*)
+                               LIVE_USERNAME="${_PARAMETER#*username=}"
+                               ;;
+               esac
+       done
+
+       Configure_xfce4_panel
+}
+
+Configure_xfce4_panel ()
+{
+       sudo -u "${LIVE_USERNAME}" mkdir -p /home/"${LIVE_USERNAME}"/.config/xfce4/xfconf/xfce-perchannel-xml
+       sudo -u "${LIVE_USERNAME}" cp /etc/xdg/xfce4/panel/default.xml /home/"${LIVE_USERNAME}"/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml
+
+       # Creating state file
+       touch /var/lib/live/config/xfce4-panel
+}
+
+Xfce4_panel