- if chroot /root /usr/sbin/laptop-detect
- then
- echo "orca.settings.orcaModifierKeys = orca.settings.LAPTOP_MODIFIER_KEYS" >> /root/home/$USERNAME/.orca/user-settings.py
- echo "orca.settings.keyboardLayout = orca.settings.GENERAL_KEYBOARD_LAYOUT_LAPTOP" >> /root/home/$USERNAME/.orca/user-settings.py
- fi
+ # Code to remove an applet from the default panel setup
+ # This is rather hacky, but I can't think of a one or two line regular
+ # expression to do this any more efficiently. Patches welcome. In
+ # addition, setting these via gconf also doesn't work for some reason.
+
+ local line_no prior_line next_line
+
+ line_no="$(grep -n "<string>$1</string>" /root/usr/share/gconf/defaults/05_panel-default-setup.entries | cut -f 1 -d :)"
+ prior_line="$((line_no-1))"
+ next_line="$((line_no+1))"
+
+ sed -i -n "${prior_line},${next_line}!p" /root/usr/share/gconf/defaults/05_panel-default-setup.entries
+
+ chroot /root update-gconf-defaults