config() {
  NEW="$1"
  OLD="$(dirname $NEW)/$(basename $NEW .new)"
  # If there's no config file by that name, mv it over:
  if [ ! -r $OLD ]; then
    mv $NEW $OLD
  elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then
    # toss the redundant copy
    rm $NEW
  fi
  # Otherwise, we leave the .new copy for the admin to consider...
}

config etc/xdg/lxqt/windowmanagers.conf.new
config etc/xdg/lxqt/lxqt.conf.new
config etc/xdg/lxqt/session.conf.new
config etc/xdg/pcmanfm-qt/lxqt/settings.conf.new

if [ -x usr/bin/update-desktop-database ]; then
  usr/bin/update-desktop-database usr/share/applications >/dev/null 2>&1
fi

if [ -x usr/bin/update-mime-database ]; then
  usr/bin/update-mime-database usr/share/mime >/dev/null 2>&1
fi

( cd usr/share/lxqt/graphics ; rm -rf lxqt_logo.png )
( cd usr/share/lxqt/graphics ; ln -sf helix_150.png lxqt_logo.png )
( cd usr/share/lxqt/graphics ; rm -rf lxqt_logo_doxygen.png )
( cd usr/share/lxqt/graphics ; ln -sf helix_60.png lxqt_logo_doxygen.png )
( cd usr/share/lxqt/themes/frost/spacer-plugin ; rm -rf spacer-line.svg )
( cd usr/share/lxqt/themes/frost/spacer-plugin ; ln -sf ../../../graphics/spacer-light-line.svg spacer-line.svg )
( cd usr/share/lxqt/themes/frost/spacer-plugin ; rm -rf spacer-dots.svg )
( cd usr/share/lxqt/themes/frost/spacer-plugin ; ln -sf ../../../graphics/spacer-light-dots.svg spacer-dots.svg )
( cd usr/share/lxqt/themes/dark/spacer-plugin ; rm -rf spacer-line.svg )
( cd usr/share/lxqt/themes/dark/spacer-plugin ; ln -sf ../../../graphics/spacer-light-line.svg spacer-line.svg )
( cd usr/share/lxqt/themes/dark/spacer-plugin ; rm -rf spacer-dots.svg )
( cd usr/share/lxqt/themes/dark/spacer-plugin ; ln -sf ../../../graphics/spacer-light-dots.svg spacer-dots.svg )
( cd usr/share/lxqt/themes/system/spacer-plugin ; rm -rf spacer-line.svg )
( cd usr/share/lxqt/themes/system/spacer-plugin ; ln -sf ../../../graphics/spacer-dark-line.svg spacer-line.svg )
( cd usr/share/lxqt/themes/system/spacer-plugin ; rm -rf spacer-dots.svg )
( cd usr/share/lxqt/themes/system/spacer-plugin ; ln -sf ../../../graphics/spacer-dark-dots.svg spacer-dots.svg )
( cd usr/share/lxqt/themes/kde-plasma/spacer-plugin ; rm -rf spacer-line.svg )
( cd usr/share/lxqt/themes/kde-plasma/spacer-plugin ; ln -sf ../../../graphics/spacer-dark-line.svg spacer-line.svg )
( cd usr/share/lxqt/themes/kde-plasma/spacer-plugin ; rm -rf spacer-dots.svg )
( cd usr/share/lxqt/themes/kde-plasma/spacer-plugin ; ln -sf ../../../graphics/spacer-dark-dots.svg spacer-dots.svg )
( cd usr/share/lxqt/themes/light/spacer-plugin ; rm -rf spacer-line.svg )
( cd usr/share/lxqt/themes/light/spacer-plugin ; ln -sf ../../../graphics/spacer-dark-line.svg spacer-line.svg )
( cd usr/share/lxqt/themes/light/spacer-plugin ; rm -rf spacer-dots.svg )
( cd usr/share/lxqt/themes/light/spacer-plugin ; ln -sf ../../../graphics/spacer-dark-dots.svg spacer-dots.svg )
( cd usr/share/lxqt/themes/ambiance/spacer-plugin ; rm -rf spacer-line.svg )
( cd usr/share/lxqt/themes/ambiance/spacer-plugin ; ln -sf ../../../graphics/spacer-dark-line.svg spacer-line.svg )
( cd usr/share/lxqt/themes/ambiance/spacer-plugin ; rm -rf spacer-dots.svg )
( cd usr/share/lxqt/themes/ambiance/spacer-plugin ; ln -sf ../../../graphics/spacer-dark-dots.svg spacer-dots.svg )
( cd usr/share/icons/hicolor/scalable/apps ; rm -rf lxqt.svg )
( cd usr/share/icons/hicolor/scalable/apps ; ln -sf ../places/start-here-lxqt.svg lxqt.svg )
