+if $ROOTCMD update-alternatives --list editor 2>/dev/null | grep -q 'vim.gtk3' ; then
+ echo "Setting vim.gtk3 as editor using update-alternatives."
+ $ROOTCMD update-alternatives --set editor "${VIM_PATH}"/vim.gtk3
+ $ROOTCMD update-alternatives --set vi "${VIM_PATH}"/vim.gtk3
+ $ROOTCMD update-alternatives --set vim "${VIM_PATH}"/vim.gtk3
+elif $ROOTCMD update-alternatives --list editor 2>/dev/null | grep -q 'vim.gtk$' ; then
+ echo "Setting vim.gtk as editor using update-alternatives."
+ $ROOTCMD update-alternatives --set editor "${VIM_PATH}"/vim.gtk
+ $ROOTCMD update-alternatives --set vi "${VIM_PATH}"/vim.gtk
+ $ROOTCMD update-alternatives --set vim "${VIM_PATH}"/vim.gtk
+elif $ROOTCMD update-alternatives --list editor 2>/dev/null | grep -q 'vim.basic' ; then
+ echo "Setting vim.basic as editor using update-alternatives."
+ $ROOTCMD update-alternatives --set editor "${VIM_PATH}"/vim.basic
+ $ROOTCMD update-alternatives --set vi "${VIM_PATH}"/vim.basic
+ $ROOTCMD update-alternatives --set vim "${VIM_PATH}"/vim.basic
+elif $ROOTCMD update-alternatives --list editor 2>/dev/null | grep -q 'vim.tiny' ; then
+ echo "Setting vim.tiny as editor using update-alternatives."
+ $ROOTCMD update-alternatives --set editor "${VIM_PATH}"/vim.tiny
+ $ROOTCMD update-alternatives --set vi "${VIM_PATH}"/vim.tiny
+else
+ echo "Warning: No vim binary suitable for update-alternatives found."
+fi
+
+if $ROOTCMD update-alternatives --list x-terminal-emulator 2>/dev/null | grep -q '/uxterm' ; then
+ echo "Setting uxterm as x-terminal-emulator using update-alternatives."
+ $ROOTCMD update-alternatives --set x-terminal-emulator /usr/bin/uxterm
+elif $ROOTCMD update-alternatives --list x-terminal-emulator 2>/dev/null | grep -q '/xterm' ; then
+ echo "Setting xterm as x-terminal-emulator using update-alternatives."
+ $ROOTCMD update-alternatives --set x-terminal-emulator /usr/bin/xterm
+fi
+
+if $ROOTCMD update-alternatives --list x-cursor-theme 2>/dev/null | grep -q '/whiteglass.theme' ; then
+ echo "Setting whiteglass.theme as x-cursor-theme using update-alternatives."
+ $ROOTCMD update-alternatives --set x-cursor-theme /etc/X11/cursors/whiteglass.theme
+fi