#!/bin/bash
#PupControl 3.6.1
#Copyright 2010-2026 GPL3
#Roger Grider (radky)

[ "`whoami`" != "root" ] && exec sudo -A ${0} ${@}

export TEXTDOMAIN=pupcontrol
export OUTPUT_CHARSET=UTF-8

export WORKDIR="/usr/local/PupControl"
export APPS_DIR="$WORKDIR/defaultapps"
export CPANEL_ICONS_DIR="$WORKDIR/icons"
export VERSION="3.6.1"

mkdir -p $WORKDIR/preferences /tmp/pupcontrol
export PREFDIR="$WORKDIR/preferences" TMPDIR="/tmp/pupcontrol"

. /etc/DISTRO_SPECS

#define gtkdialog
export GTKDIALOG=gtkdialog

#define title-bar icon
[ ! -f /usr/share/icons/hicolor/48x48/apps/control-panel_48.png ] && \
ln -sf $WORKDIR/icons/control-panel_48.png /usr/share/icons/hicolor/48x48/apps && gtk-update-icon-cache -f -i /usr/share/icons/hicolor 2>/dev/null

#define GTK theme settings
if [ "`ldd $(which gtkdialog) | grep -Fi 'gtk-3' 2>/dev/null`" ]; then
 [ -f $TMPDIR/gtkrc.css ] && rm -f $TMPDIR/gtkrc.css
 if [ -e "$HOME/.config/gtk-3.0/settings.ini" ] ; then
  THEME=$(grep 'gtk-theme-name' $HOME/.config/gtk-3.0/settings.ini | cut -d '=' -f2 | awk '{$1=$1};1')
  CSS=$(find /usr/share/themes/"$THEME"/gtk-3* -maxdepth 1 -name 'gtk.css' -print | head -n1)
 elif [ -e "/etc/gtk-3.0/settings.ini" ] ; then
  THEME=$(grep 'gtk-theme-name' /etc/gtk-3.0/settings.ini | cut -d '=' -f2 | awk '{$1=$1};1')
  CSS=$(find /usr/share/themes/"$THEME"/gtk-3* -maxdepth 1 -name 'gtk.css' -print | head -n1)
 fi
 if [ "$THEME" ] && [ -e "$CSS" ] ; then
  DEFINE="@import url(\"$CSS\");"
  echo "$DEFINE" > $TMPDIR/gtkrc.css
 fi
 cat $WORKDIR/gtk.css >> $TMPDIR/gtkrc.css
else
 echo 'style "user-font" {
 font_name="Sans 10" }
 widget_class "*" style "user-font"' > $WORKDIR/gtkrc_user-font
 export GTK2_RC_FILES=$HOME/.gtkrc-2.0:$WORKDIR/gtkrc_user-font
 FONTNAME=$(grep 'font_name' $HOME/.gtkrc-2.0 2>/dev/null | cut -d '=' -f2 | sed 's/\"//g' | awk '{$1=$1};1')
 [ -z "$FONTNAME" ] && FONTNAME="Sans 10" && sed -i "s/font_name=.*$/font_name=\"$FONTNAME\"/" $HOME/.gtkrc-2.0
fi

#auto-adjust header text color for light or dark GTK2 themes
if [ "`grep -a 'Stardust_dark' $HOME/.gtkrc-2.0 2>/dev/null`" ]; then #gold text for unique Stardust dark-grey-orange themes
  COLOR=#D7B740
else #light-blue text for common dark themes, otherwise medium blue
  [ "`grep -aEi 'black|dark|dusk|night|nox' $HOME/.gtkrc-2.0 2>/dev/null | grep -av xfdark`" ] && COLOR=#84aad9 || COLOR=#3272C0
fi
export COLOR

#Splash dlg...
echo 0 > $TMPDIR/pupcontrol-splash
export PC_SPLASH='
<window title="PCP" icon-name="control-panel_48" resizable="false" decorated="true">'"
<vbox>
 <pixmap><input file>$WORKDIR/icons/control-panel_48.png</input><height>48</height><width>48</width></pixmap>
 <text use-markup=\"true\"><label>\"<b><span size='"'x-large'"'>      Pup</span><span size='"'x-large'"' color='"$COLOR"'>Control      </span></b>\"</label></text>"'
 <text><label>'$(gettext 'Loading...')'</label></text>
 <progressbar visible="false">
  <input>while [ "$M" != "100" ]; do M=`cat $TMPDIR/pupcontrol-splash`; echo $M; usleep 500000; done</input>
  <action type="exit">Ready</action>
 </progressbar>
</vbox></window>'
$GTKDIALOG -p PC_SPLASH --center &

#define current window manager
CURRWM=`cat /etc/windowmanager`

#define active notebook page
ACTIVE_PAGE=`cat /tmp/PC-page 2>/dev/null`
[ ! "$ACTIVE_PAGE" ] && ACTIVE_PAGE="6" && echo "$ACTIVE_PAGE" > /tmp/PC-page
if [ "$ACTIVE_PAGE" = "9" ]; then
 PAGE=9 HAS_FOCUS1=false HAS_FOCUS2=true RADIO_SETTINGS=false RADIO_MYPANEL=true
else
 PAGE=6 HAS_FOCUS1=true HAS_FOCUS2=false RADIO_SETTINGS=true RADIO_MYPANEL=false
fi

#define GUI width and screen position
 GUI_RESIZABLE="false"
 if [ -e "$HOME/.config/gtk-3.0/settings.ini" ] ; then
  FONTSIZE=$(grep 'gtk-font-name' $HOME/.config/gtk-3.0/settings.ini 2>/dev/null | sed 's/[[:blank:]]*$//' | awk -F' ' '{print $NF}')
  if [[ $FONTSIZE -lt 10 ]]; then GUI_WIDTH="610"
  elif [[ $FONTSIZE == 10 ]]; then GUI_WIDTH="660"
  elif [[ $FONTSIZE == 11 ]]; then GUI_WIDTH="710"
  elif [[ $FONTSIZE == 12 ]]; then GUI_WIDTH="760"
  elif [[ $FONTSIZE == 13 ]]; then GUI_WIDTH="810"
  elif [[ $FONTSIZE == 14 ]]; then GUI_WIDTH="860"
  elif [[ $FONTSIZE == 15 ]]; then GUI_WIDTH="910"
  elif [[ $FONTSIZE == 16 ]]; then GUI_WIDTH="960"
  else GUI_WIDTH="660"
  fi
 else
  GUI_WIDTH="640"
  GUI_RESIZABLE="true"
 fi

[ ! "$GUI_WIDTH" ] && GUI_WIDTH="640"
echo "$GUI_WIDTH" > $PREFDIR/gui-width

if [ "`which xwininfo 2>/dev/null`" ]; then # X11
   read ROOTDIMS MX MY << EOF
`xwininfo -root | grep -F ' -geometry ' | cut -f 1 -d '+' | tr 'x' ' '`
EOF

elif [ "`which wlr-randr 2>/dev/null`" ]; then # Wayland
   read MX MY << EOF
`wlr-randr | grep -m1 'current' | awk '{print $1}' | tr 'x' ' '`
EOF

fi
GEO=+$((($MX/2)-$((($GUI_WIDTH+20)/2))))+$((($MY/2)-360))
[ ! "$GEO" ] && GEO=+50+50
export GEO

#define current default applications
BACKUP=`cat $APPS_DIR/backup | tail -1`
BURNER=`cat $APPS_DIR/burner | tail -1`
GRUB=`cat $APPS_DIR/grub | tail -1`
SCANNER=`cat $APPS_DIR/scanner | tail -1`
NOTEBOOK=`cat $APPS_DIR/notebook | tail -1`
ORGANIZER=`cat $APPS_DIR/organizer | tail -1`
TASK_MANAGER=`cat $APPS_DIR/taskmanager | tail -1 | sed 's/rxvt +sb -fn 9x15 -bg black -fg white -title htop -n htop -e htop/htop/'`
TIME_MANAGER=`cat $APPS_DIR/timemanager | tail -1 | sed 's/lsalarm/lightSwordAlarm/' | sed 's/sgtt/timetracker/'`
DOWNLOAD=`cat $APPS_DIR/download | tail -1`
P2P=`cat $APPS_DIR/p2p | tail -1`
FTP=`cat $APPS_DIR/ftp | tail -1`
NETWORK=`cat $APPS_DIR/network | tail -1 | sed 's/net-setup.sh/net-setup.sh (Puppy Network Wizard)/'`
REMOTE_DESKTOP=`cat $APPS_DIR/remotedesktop | tail -1`
SAMBA=`cat $APPS_DIR/samba | tail -1`
VPN_CLIENT=`cat $APPS_DIR/vpnclient | tail -1`
WIRELESS=`cat $APPS_DIR/wireless | tail -1`
FILE_ARCHIVER=`cat $APPS_DIR/archiver | tail -1 | sed 's/parchive_wrapper/parchive/'`
FILE_MANAGER=`cat $APPS_DIR/filemanager | tail -1 | sed 's/xterm -e mc/mc/' | sed 's/\brox\b \//rox/' | sed 's/Thunar \//Thunar/'`
FILE_FINDER=`cat $APPS_DIR/filefinder | tail -1`
SYSINFO=`cat $APPS_DIR/sysinfo | tail -1`
RUNDIALOG=`cat $APPS_DIR/rundialog | tail -1`
CONSOLE=`cat $APPS_DIR/console | tail -1`

MYCONTROL1=`grep -a MYCONTROL1= $WORKDIR/pupcontrol.rc | cut -d "=" -f 2 | sed 's/\"//g'`
MYCONTROL2=`grep -a MYCONTROL2= $WORKDIR/pupcontrol.rc | cut -d "=" -f 2 | sed 's/\"//g'`
MYCONTROL3=`grep -a MYCONTROL3= $WORKDIR/pupcontrol.rc | cut -d "=" -f 2 | sed 's/\"//g'`
MYCONTROL4=`grep -a MYCONTROL4= $WORKDIR/pupcontrol.rc | cut -d "=" -f 2 | sed 's/\"//g'`
MYCONTROL5=`grep -a MYCONTROL5= $WORKDIR/pupcontrol.rc | cut -d "=" -f 2 | sed 's/\"//g'`
MYCONTROL6=`grep -a MYCONTROL6= $WORKDIR/pupcontrol.rc | cut -d "=" -f 2 | sed 's/\"//g'`
MYCONTROL7=`grep -a MYCONTROL7= $WORKDIR/pupcontrol.rc | cut -d "=" -f 2 | sed 's/\"//g'`
MYCONTROL8=`grep -a MYCONTROL8= $WORKDIR/pupcontrol.rc | cut -d "=" -f 2 | sed 's/\"//g'`

MYCONTROL1_NAME=`grep -a MYCONTROL1= $WORKDIR/pupcontrol.rc | cut -d "=" -f 2 | sed 's/\"//g' | awk -F/ '{print $NF}'`
MYCONTROL2_NAME=`grep -a MYCONTROL2= $WORKDIR/pupcontrol.rc | cut -d "=" -f 2 | sed 's/\"//g' | awk -F/ '{print $NF}'`
MYCONTROL3_NAME=`grep -a MYCONTROL3= $WORKDIR/pupcontrol.rc | cut -d "=" -f 2 | sed 's/\"//g' | awk -F/ '{print $NF}'`
MYCONTROL4_NAME=`grep -a MYCONTROL4= $WORKDIR/pupcontrol.rc | cut -d "=" -f 2 | sed 's/\"//g' | awk -F/ '{print $NF}'`
MYCONTROL5_NAME=`grep -a MYCONTROL5= $WORKDIR/pupcontrol.rc | cut -d "=" -f 2 | sed 's/\"//g' | awk -F/ '{print $NF}'`
MYCONTROL6_NAME=`grep -a MYCONTROL6= $WORKDIR/pupcontrol.rc | cut -d "=" -f 2 | sed 's/\"//g' | awk -F/ '{print $NF}'`
MYCONTROL7_NAME=`grep -a MYCONTROL7= $WORKDIR/pupcontrol.rc | cut -d "=" -f 2 | sed 's/\"//g' | awk -F/ '{print $NF}'`
MYCONTROL8_NAME=`grep -a MYCONTROL8= $WORKDIR/pupcontrol.rc | cut -d "=" -f 2 | sed 's/\"//g' | awk -F/ '{print $NF}'`

#define programs to set locale and timezone
if [ "`which quickcountry`" ] && [ ! "`grep -a 'Copyright Barry Kauler' /usr/sbin/quicksetup`" = "" ]; then COUNTRY="quickcountry"
elif [ "`which countrywizard`" ]; then COUNTRY="countrywizard"
elif [ "`which countrywizard.qs`" ]; then COUNTRY="countrywizard.qs"
else COUNTRY="chooselocale & sleep 1.5 && timezone-set"
fi
if [ "`which quickcountry`" ] && [ ! "`grep -a 'Copyright Barry Kauler' /usr/sbin/quicksetup`" = "" ]; then COUNTRY_APP="quickcountry"
elif [ "`which countrywizard`" ]; then COUNTRY_APP="countrywizard"
elif [ "`which countrywizard.qs`" ]; then COUNTRY_APP="countrywizard.qs"
else COUNTRY_APP="chooselocale | timezone-set"
fi
if [ "`which quickcountry`" ] && [ ! "`grep -a 'Copyright Barry Kauler' /usr/sbin/quicksetup`" = "" ]; then
 BASIC_SETUP="quicksetup"
else
 BASIC_SETUP="Personalize Settings"
fi

#show icons and text in the PupControl GUI, only if corresponding applications are available
CURSOR="
    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" $CURRWM $(gettext 'compatible option') \">
      <input file>$CPANEL_ICONS_DIR/cursor20.png</input>
      <action>labwc-tweaks-gtk-wrapper &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  Cursor Theme </b>- Set mouse/touchpad screen cursor')\"</label></text>
    </hbox>"

if [ -f ~/.config/autostart/zzzfm.desktop ]; then
    DESKICONS="
    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" $CURRWM $(gettext 'compatible option') \">
      <input file>$CPANEL_ICONS_DIR/icons20.png</input>
      <action>desktop-icon-manager &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  Desktop Icons </b>- Manage icon theme and layout')\"</label></text>
    </hbox>"
else
    DESKICONS="
    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" icon_switcher \">
      <input file>$CPANEL_ICONS_DIR/icons20.png</input>
      <action>icon_switcher &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  Desktop Icons </b>- Change desktop icon theme')\"</label></text>
    </hbox>"
fi

if [ -f ~/.config/autostart/zzzfm.desktop ]; then
    DESKSETTINGS="
    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" $CURRWM $(gettext 'compatible option') \">
      <input file>$CPANEL_ICONS_DIR/desktop20.png</input><height>20</height><width>20</width>
      <action>zzzfm --show-pref=1 &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"<b>  Desktop Settings </b>- Manage desktop configuration \"</label></text>
    </hbox>"
else
DESKSETTINGS=""
fi

WALLPAPER="
    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" $CURRWM $(gettext 'compatible option') \">
      <input file>$CPANEL_ICONS_DIR/wallpaper20.png</input>
      <action>$WORKDIR/func -wallpaper &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  Desktop Wallpaper </b>- Set screen background image')\"</label></text>
    </hbox>"

SCREENLAYOUT="
    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" $CURRWM $(gettext 'compatible option') \">
      <input file>/usr/share/icons/wdisplays.svg</input><height>20</height><width>20</width>
      <action>wdisplays-wrapper &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  Display Manager </b>- Screen layout manager')\"</label></text>
    </hbox>"

if [ "`which gfontsel`" ]; then
    GFONTSEL="
    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" $CURRWM $(gettext 'compatible option') \">
      <input file>$CPANEL_ICONS_DIR/font20.png</input>
      <action>gfontsel &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  Font Preview </b>- View/Compare available screen fonts')\"</label></text>
    </hbox>"
else
    GFONTSEL=""
fi

GLOBAL_FONTSIZE="
    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" $CURRWM $(gettext 'compatible option') \">
      <input file>$CPANEL_ICONS_DIR/fontsize20.png</input>
      <action>desktop-font-manager &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  Font Size Manager </b>- Set display size of screen fonts')\"</label></text>
    </hbox>"

if [ "`which hotkey.sh`" ]; then
    HOTKEY="
    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" $CURRWM $(gettext 'compatible option') \">
      <input file>$CPANEL_ICONS_DIR/keyboard20.png</input>
      <action>hotkey.sh &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  Hotkey Manager </b>- Keyboard shortcut manager')\"</label></text>
    </hbox>"
else
    HOTKEY=""
fi

if [ "`which menumanager`" ]; then
    MENUMANAGER="
    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" menumanager \">
      <input file>$CPANEL_ICONS_DIR/menu20.png</input>
      <action>menumanager &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  Menu Manager </b>- Manage apps in the system menu')\"</label></text>
    </hbox>"
else
    MENUMANAGER=""
fi

    MENU_UPDATE="
    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" $(gettext 'refresh menu') \">
      <input file>$CPANEL_ICONS_DIR/reboot20.png</input>
      <action>$WORKDIR/func -menu_update &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  Menu Update </b>- Update applications in the menu')\"</label></text>
    </hbox>"

SCREENLOCK="
    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" puplock \">
      <input file>$CPANEL_ICONS_DIR/lock20.png</input>
      <action>puplock &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  Screen Lock </b>- Simple Wayland compatible screenlock')\"</label></text>
    </hbox>"

if [ -f /usr/local/dcontrol/dcontrol ]; then
    SCREENSAVER="
    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" dcontrol \">
      <input file>/usr/local/dcontrol/icons/monitor.svg</input><height>20</height><width>20</width>
      <action>/usr/local/dcontrol/dcontrol &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  Display Control </b>- Set screen tint and brightness')\"</label></text>
    </hbox>"
elif [ -f /usr/local/sscontrol/sscontrol ]; then
    SCREENSAVER="
    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" sscontrol \">
      <input file>$CPANEL_ICONS_DIR/screen20.png</input>
      <action>/usr/local/sscontrol/sscontrol &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  ScreenSaver Control </b>- Enable/Disable screensaver')\"</label></text>
    </hbox>"
else
    SCREENSAVER=""
fi

SYSMONITOR="
    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" conky-gtk \">
      <input file>$CPANEL_ICONS_DIR/activity20.png</input>
      <action>conky-gtk &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  System Monitor </b>- Conky system information manager')\"</label></text>
    </hbox>"

TASKBAR="
    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" $CURRWM $(gettext 'settings') \">
      <input file>$CPANEL_ICONS_DIR/tray20.png</input>
      <action>sfwbar-config.sh &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  TaskBar Settings </b>- TaskBar and LaunchBar settings ')\"</label></text>
    </hbox>"

WMSETTINGS="
    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" $CURRWM $(gettext 'settings') \">
      <input file>$CPANEL_ICONS_DIR/wm20.png</input>
      <action>labwc-tweaks-gtk-wrapper &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  Window Manager Settings </b>- Configuration options ')\"</label></text>
    </hbox>"

if [ "`grep -a BACKUP= $WORKDIR/pupcontrol.rc | cut -d "=" -f 2 | sed 's/\"//g'`" ]; then
    BACKUp="
    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" $BACKUP \">
      <input file>$CPANEL_ICONS_DIR/download20.png</input>
      <action>$APPS_DIR/backup &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  Backup Files </b>- Backup files to drive/partition/server')\"</label></text>
    </hbox>"
else
    BACKUp=""
fi

if [ "`grep -a BURNER= $WORKDIR/pupcontrol.rc | cut -d "=" -f 2 | sed 's/\"//g'`" ]; then
    BURN="
    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" $BURNER \">
      <input file>$CPANEL_ICONS_DIR/burn20.png</input>
      <action>$APPS_DIR/burner &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  Burn CD/DVD </b>- Multi-function optical media burner')\"</label></text>
    </hbox>"
else
    BURN=""
fi

if [ "`which peasydisc`" ]; then
    CDTOOL="
    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" peasydisc \">
      <input file>$CPANEL_ICONS_DIR/cd20.png</input>
      <action>peasydisc &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  CD/DVD Utilities </b>- Blank/Burn/Write/Rip/Convert')\"</label></text>
    </hbox>"
elif [ "`which burniso2cd`" ]; then
    CDTOOL="
    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" burniso2cd \">
      <input file>$CPANEL_ICONS_DIR/cd20.png</input>
      <action>burniso2cd &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  Burniso2cd </b>- Basic optical media (ISO) burner')\"</label></text>
    </hbox>"
else
    CDTOOL=""
fi

if [ "`which cdburner-wizard`"  ]; then
    CDBURNWIZARD="
    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" cdburner-wizard \">
      <input file>$CPANEL_ICONS_DIR/wizard20.png</input>
      <action>cdburner-wizard &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  CD/DVD Wizard </b>- Select/Set default optical drives')\"</label></text>
    </hbox>"
else
    CDBURNWIZARD=""
fi

if [ "`which partview`"  ]; then
    PARTVIEW="
    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" partview \">
      <input file>$CPANEL_ICONS_DIR/graph20.png</input>
      <action>partview &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  Drive Space </b>- Show available drive/partition space')\"</label></text>
    </hbox>"
else
    PARTVIEW=""
fi

if [ "`grep -a GRUB= $WORKDIR/pupcontrol.rc | cut -d "=" -f 2 | sed 's/\"//g'`" ]; then
    GRUb="
    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" $GRUB \">
      <input file>$CPANEL_ICONS_DIR/grub20.png</input>
      <action>$APPS_DIR/grub &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  GRUB </b>- Install or configure the generic boot loader')\"</label></text>
    </hbox>"
else
    GRUb=""
fi

if [ "`which gsmartcontrol`" ]; then
    GSMARTCONTROL="
    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" gsmartcontrol \">
      <input file>$CPANEL_ICONS_DIR/activity20.png</input>
      <action>gsmartcontrol &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  GSmartControl </b>- Monitor hard disk SMART data')\"</label></text>
    </hbox>"
else
    GSMARTCONTROL=""
fi

if [ "`which android-file-transfer`" ]; then
    MTP="
    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" android-file-transfer \">
      <input file>$CPANEL_ICONS_DIR/mtp20.png</input>
      <action>android-file-transfer &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  MTP Mount </b>- Mount android and MTP devices')\"</label></text>
    </hbox>"
else
    MTP=""
fi

if [ "`which isomaster`" ]; then
    ISOEDITOR="
    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" isomaster \">
      <input file>$CPANEL_ICONS_DIR/isoedit20.png</input>
      <action>isomaster &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  ISO Master </b>- Create and Edit CD/DVD ISO images')\"</label></text>
    </hbox>"
else
    ISOEDITOR=""
fi

if [ "`which partimage`" ]; then
    PART_IMAGE="
    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" partimage \">
      <input file>$CPANEL_ICONS_DIR/hdisk20.png</input>
      <action>rxvt -e partimage &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  Partition Image </b>- Disk/Partition backup tool')\"</label></text>
    </hbox>"
else
    PART_IMAGE=""
fi

if [ "`which Pdisk`" ]; then
    PDISK="
    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" Pdisk \">
      <input file>$CPANEL_ICONS_DIR/hdisk20.png</input>
      <action>Pdisk &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  Pdisk </b>- Create, delete or modify drive partitions')\"</label></text>
    </hbox>"
else
    PDISK=""
fi

if [ "`which Pudd`" ]; then
    PUDD="
    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" Puppy Universal dd \">
      <input file>$CPANEL_ICONS_DIR/harddisk20.png</input>
      <action>Pudd &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  Pudd </b>- Copy system drive, partition or image-file')\"</label></text>
    </hbox>"
else
    PUDD=""
fi

[ -f /usr/sbin/pupsave-backup ] && [ ! "`which pupsave-hot-backup 2>/dev/null`" ] && ln -sf /usr/sbin/pupsave-backup /usr/bin/pupsave-hot-backup
if [ "`which pupsave-hot-backup 2>/dev/null`" ]; then
    PUPSAVEBACKUP="
    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" pupsave-hot-backup \">
      <input file>$CPANEL_ICONS_DIR/disk20.png</input>
      <action>pupsave-hot-backup &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  PupSave File Backup </b>- Backup storage file')\"</label></text>
    </hbox>"
else
    PUPSAVEBACKUP=""
fi

if [ "`which SaveFolderBackup`" ]; then
    PUPSAVEFOLDERBACKUP="
    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" SaveFolderBackup \">
      <input file>$CPANEL_ICONS_DIR/disk20.png</input>
      <action>SaveFolderBackup &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  PupSave Folder Backup </b>- Backup storage folder')\"</label></text>
    </hbox>"
else
    PUPSAVEFOLDERBACKUP=""
fi

if [ "`which pupsaveconfig`" ]; then
    PUPSAVECONFIG="
    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" pupsaveconfig \">
      <input file>$CPANEL_ICONS_DIR/pupsaveconfig20.png</input>
      <action>pupsaveconfig &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  PupSave Config </b>- Configure personal storage file')\"</label></text>
    </hbox>"
else
    PUPSAVECONFIG=""
fi

if [ "`which resizepfile.sh`" ]; then
    PUPSAVE_RESIZE="
    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" resizepfile.sh \">
      <input file>$CPANEL_ICONS_DIR/reboot20.png</input>
      <action>resizepfile.sh &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  PupSave Resize </b>- Increase personal storage file')\"</label></text>
    </hbox>"
else
    PUPSAVE_RESIZE=""
fi

if [ "`which bluepup`" ]; then
    BLUETOOTH="
    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" bluepup \">
      <input file>$CPANEL_ICONS_DIR/bluetooth.svg</input><height>20</height><width>20</width>
      <action>bluepup &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  Bluetooth </b>- Short-range wireless interconnection')\"</label></text>
    </hbox>"
else
    BLUETOOTH=""
fi

if [ "`which blueman-manager`" ]; then
    BLUEMAN="
    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" blueman-manager \">
      <input file>$CPANEL_ICONS_DIR/bluetooth.svg</input><height>20</height><width>20</width>
      <action>blueman-manager &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  Bluetooth </b>- Short-range wireless interconnection')\"</label></text>
    </hbox>"
else
    BLUEMAN=""
fi

if [ "`which pupcamera`" ]; then
    CAMERA="
    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" pupcamera \">
      <input file>$CPANEL_ICONS_DIR/camera20.png</input>
      <action>pupcamera &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  Camera </b>- Download/Save images of digital camera')\"</label></text>
    </hbox>"
elif [ "`which gtkam`" ]; then
    CAMERA="
    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" gtkam \">
      <input file>$CPANEL_ICONS_DIR/camera20.png</input>
      <action>gtkam &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  Camera </b>- Download/Save images from digital camera')\"</label></text>
    </hbox>"
else
    CAMERA=""
fi

if [ "`which wcpufreq`" -o "`which acpi-control`" -o -f /usr/local/cpu-freq/cpu_freq ]; then
    CPU_SCALING="
     <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" On-demand CPU frequency scaling \">
      <input file>$CPANEL_ICONS_DIR/cpu20.png</input>
      <action>$WORKDIR/func -cpufrequency &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  CPU Frequency Scaling </b>- Set dynamic CPU cooling')\"</label></text>
    </hbox>"
else
    CPU_SCALING=""
fi

if [ "`grep -a SCANNER= $WORKDIR/pupcontrol.rc | cut -d "=" -f 2 | sed 's/\"//g'`" ]; then
    SCAN="
    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" $SCANNER \">
      <input file>$CPANEL_ICONS_DIR/scanner20.png</input>
      <action>$APPS_DIR/scanner &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  Scanner </b>- Capture the graphic image of print media')\"</label></text>
    </hbox>"
else
    SCAN=""
fi

if [ "`which guvcview`" -o "`which luvcview`" -o "`which ucview`" ]; then
    WEBCAM="
    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" guvcview, luvcview, ucview \">
      <input file>$CPANEL_ICONS_DIR/webcam20.png</input>
      <action>$WORKDIR/func -webcam &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  Webcam </b>- Capture video images with Web camera')\"</label></text>
    </hbox>"
else
    WEBCAM=""
fi

    XORGWIZARD="
    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" xorgwizard \">
      <input file>/usr/share/pixmaps/puppy/graphics.svg</input><height>20</height><width>20</width>
      <action>$WORKDIR/func -xorgwizard &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  Wayland Video Wizard </b>- Modify screen configuration')\"</label></text>
    </hbox>"

if [ "`cat /usr/sbin/petget | grep -a "package manager for Puppy Linux"`" ]; then
    ADD_REMOVE="petget"
elif [ -f /usr/local/petget/pkg_chooser.sh ]; then
    ADD_REMOVE="/usr/local/petget/pkg_chooser.sh"
fi

if [ "`which synaptic-pkexec`" ]; then
    APT="
    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" synaptic-pkexec \">
      <input file>$CPANEL_ICONS_DIR/pet20.png</input>
      <action>synaptic-pkexec &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  Package Manager (Synaptic) </b>- Frontend for Apt')\"</label></text>
    </hbox>"
else
    APT=""
fi

if [ "`which frugalpup-installers`" ]; then
    FRUGAL_PUP="
    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" frugalpup \">
      <input file>/usr/share/pixmaps/gnibbles.png</input><height>20</height><width>20</width>
      <action>frugalpup-installers &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  FrugalPup </b>- Flexible frugal installer of Puppy Linux')\"</label></text>
    </hbox>"
else
    FRUGAL_PUP=""
fi

if [ "`which get_libreoffice`" ]; then
    GET_LIBRE="
    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" get_libreoffice \">
      <input file>$CPANEL_ICONS_DIR/filemanager20.png</input>
      <action>get_libreoffice &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  Get LibreOffice </b>- Download/Install LibreOffice SFS')\"</label></text>
    </hbox>"
else
    GET_LIBRE=""
fi

if [ "`which gnewpet`" ]; then
    GNEWPET="
    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" gnewpet \">
      <input file>$CPANEL_ICONS_DIR/pet20.png</input>
      <action>gnewpet &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  Gnewpet </b>- Create new PETS from installed packages')\"</label></text>
    </hbox>"
else
    GNEWPET=""
fi

if [ "`which quickpet`" ]; then
    QUICKPET="
    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" QuickPet Package Manager \">
      <input file>$CPANEL_ICONS_DIR/quickpet20.png</input>
      <action>quickpet &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  QuickPet </b>- Install common Puppy PETS quickly')\"</label></text>
    </hbox>"
else
    QUICKPET=""
fi

REMASTER=""
for i in easy-remaster remasterpup2 woofy pupremaster; do [ "`which $i 2>/dev/null`" ] && { remasterapp="$i"; break; } done
    REMASTER="
    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" $remasterapp \">
      <input file>$CPANEL_ICONS_DIR/remaster20.png</input>
      <action>$remasterapp &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  Remaster </b>- Build a snapshot of the current Puppy')\"</label></text>
    </hbox>"

if [ "`which remove_builtin`" ]; then
    REM_BUILTIN="
    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" remove_builtin \">
      <input file>$CPANEL_ICONS_DIR/trash20.png</input>
      <action>remove_builtin &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  Remove Builtin </b>- Remove original Puppy programs')\"</label></text>
    </hbox>"
else
    REM_BUILTIN=""
fi

if [ "`which sfs_load`" ]; then
    SFSLOAD="
    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" sfs_load \">
      <input file>$CPANEL_ICONS_DIR/sfs20.png</input>
      <action>sfs_load &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  SFS Load </b>- Load Squash File System on-the-fly')\"</label></text>
    </hbox>"
else
    SFSLOAD=""
fi

if [ "`grep -a DOWNLOAD= $WORKDIR/pupcontrol.rc | cut -d "=" -f 2 | sed 's/\"//g'`" ]; then
    DN_LOAD="
    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" $DOWNLOAD \">
      <input file>$CPANEL_ICONS_DIR/download20.png</input>
      <action>$APPS_DIR/download &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  File Download </b>- Manage internet file downloads')\"</label></text>
    </hbox>"
else
    DN_LOAD=""
fi

if [ "`grep -a P2P= $WORKDIR/pupcontrol.rc | cut -d "=" -f 2 | sed 's/\"//g'`" ]; then
    P_2_P="
    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" $P2P \">
      <input file>$CPANEL_ICONS_DIR/add-remove20.png</input>
      <action>$APPS_DIR/p2p &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  File Sharing </b>- Peer-to-Peer (P2P) networking client')\"</label></text>
    </hbox>"
else
    P_2_P=""
fi

if [ "`grep -a FTP= $WORKDIR/pupcontrol.rc | cut -d "=" -f 2 | sed 's/\"//g'`" ]; then
    FTProtocol="
    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" $FTP \">
      <input file>$CPANEL_ICONS_DIR/ftp20.png</input>
      <action>$APPS_DIR/ftp &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  File Transfer </b>- File transfer protocol (FTP) utility')\"</label></text>
    </hbox>"
else
    FTProtocol=""
fi

if [ "`grep -a WIRELESS= $WORKDIR/pupcontrol.rc | cut -d "=" -f 2 | sed 's/\"//g'`" ]; then
    WiRELESS="
    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" $WIRELESS \">
      <input file>$CPANEL_ICONS_DIR/wireless20.png</input>
      <action>$APPS_DIR/wireless &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  Internet Wireless Connect </b>- Wireless setup utility')\"</label></text>
    </hbox>"
else
    WiRELESS=""
fi

if [ "`which peasyport`" ]; then
    PORTSCAN="
    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" peasyport \">
      <input file>/usr/share/pixmaps/peasyport.svg</input><height>20</height><width>20</width>
      <action>peasyport &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  Network Scanner </b>- Probe network for open ports')\"</label></text>
    </hbox>"
else
    PORTSCAN=""
fi

if [ "`which netsecurity`" ]; then
    NETSECURITY="
    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" netsecurity \">
      <input file>$CPANEL_ICONS_DIR/stop20.png</input>
      <action>netsecurity &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  Network Security </b>- Internet security and privacy')\"</label></text>
    </hbox>"
elif [ "`which pup-advert-blocker`" ]; then
    NETSECURITY="
    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" pup-advert-blocker \">
      <input file>$CPANEL_ICONS_DIR/stop20.png</input>
      <action>pup-advert-blocker &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  Network Security </b>- Block online advertisements')\"</label></text>
    </hbox>"
else
    NETSECURITY=""
fi

if [ "`grep -a REMOTE_DESKTOP= $WORKDIR/pupcontrol.rc | cut -d "=" -f 2 | sed 's/\"//g'`" ]; then
    REMOTE_DT="
    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" $REMOTE_DESKTOP \">
      <input file>$CPANEL_ICONS_DIR/net20.png</input>
      <action>$APPS_DIR/remotedesktop &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  Remote Desktop </b>- Connect to remote PC desktop')\"</label></text>
    </hbox>"
else
    REMOTE_DT=""
fi

if [ "`grep -a SAMBA= $WORKDIR/pupcontrol.rc | cut -d "=" -f 2 | sed 's/\"//g'`" ]; then
    SMBA="
    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" $SAMBA \">
      <input file>$CPANEL_ICONS_DIR/samba20.png</input>
      <action>$APPS_DIR/samba &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  Samba </b>- Create network file shares on Puppy PC')\"</label></text>
    </hbox>"
else
    SMBA=""
fi


if [ "`which yassm`" ]; then
    YASSM="
    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" yassm \">
      <input file>$CPANEL_ICONS_DIR/samba20.png</input>
      <action>yassm &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  YASSM </b>- Connect to file shares on a local network')\"</label></text>
    </hbox>"
else
    YASSM=""
fi

if [ "`grep -a VPN_CLIENT= $WORKDIR/pupcontrol.rc | cut -d "=" -f 2 | sed 's/\"//g'`" ]; then
    VPN="
    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" $VPN_CLIENT \">
      <input file>$CPANEL_ICONS_DIR/net20.png</input>
      <action>$APPS_DIR/vpnclient &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  VPN </b>- Connect to virtual private network (PPTP)')\"</label></text>
    </hbox>"
else
    VPN=""
fi

if [ "`which truecrypt`" ]; then
    ENCRYPT="
    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" truecrypt \">
      <input file>$CPANEL_ICONS_DIR/lock20.png</input>
      <action>truecrypt &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  Encrypt Disk </b>- Virtual disk encryption on-the-fly')\"</label></text>
    </hbox>"
elif [ "`which bcrypt_gui`" ]; then
    ENCRYPT="
    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" bcrypt_gui \">
      <input file>$CPANEL_ICONS_DIR/lock20.png</input>
      <action>bcrypt_gui &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  Encrypt Files </b>- Manage security of personal files')\"</label></text>
    </hbox>"
else
    ENCRYPT=""
fi

if [ "`grep -a NOTEBOOK= $WORKDIR/pupcontrol.rc | cut -d "=" -f 2 | sed 's/\"//g'`" ]; then
    NBOOK="
    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" $NOTEBOOK \">
      <input file>$CPANEL_ICONS_DIR/notes20.png</input>
      <action>$APPS_DIR/notebook &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  Notebook </b>- Manage personal notes and reminders')\"</label></text>
    </hbox>"
else
    NBOOK=""
fi

if [ "`which fpm2`" ]; then
    PASSWORD="
    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" fpm2 \">
      <input file>$CPANEL_ICONS_DIR/firewall20.png</input>
      <action>fpm2 &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  Password Manager </b>- Manage encrypted passwords')\"</label></text>
    </hbox>"
else
    PASSWORD=""
fi

if [ "`which pplog_gui`" ]; then
    PPLOG="
    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" pplog_gui \">
      <input file>$CPANEL_ICONS_DIR/textedit20.png</input>
      <action>pplog_gui &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  PPLOG </b>- Puppy-Powered Blog (personal web journal)')\"</label></text>
    </hbox>"
else
    PPLOG=""
fi

if [ "`grep -a ORGANIZER= $WORKDIR/pupcontrol.rc | cut -d "=" -f 2 | sed 's/\"//g'`" ]; then
    SCHEDULE_MGR="
    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" $ORGANIZER \">
      <input file>$CPANEL_ICONS_DIR/schedule20.png</input>
      <action>$APPS_DIR/organizer &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  Schedule Manager </b>- Schedule appointments/tasks')\"</label></text>
    </hbox>"
else
    SCHEDULE_MGR=""
fi

if [ "`grep -a TIME_MANAGER= $WORKDIR/pupcontrol.rc | cut -d "=" -f 2 | sed 's/\"//g'`" ]; then
    TIME_MGR="
    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" $TIME_MANAGER \">
      <input file>$CPANEL_ICONS_DIR/notification20.png</input>
      <action>$APPS_DIR/timemanager &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  Time Manager </b>- Manage time events/notifications')\"</label></text>
    </hbox>"
else
    TIME_MGR=""
fi

if [ -f /usr/local/Pup-SysInfo/Pup-SysInfo ]; then
    BASIC_SETTINGS="
    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" PSI Summary Report \">
      <input file>$CPANEL_ICONS_DIR/quickview20.png</input>
      <action>echo ""Marker for PSI summary report."" > /tmp/PSI-summary</action>
      <action>/usr/local/bin/Pup-SysInfo 2>/dev/null &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  Basic Settings </b>- View summary of system settings')\"</label></text>
    </hbox>"
    QUICK_SYSINFO="
    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" Pup-SysInfo \">
      <input file>$CPANEL_ICONS_DIR/quickview20.png</input>
      <action>/usr/local/bin/Pup-SysInfo 2>/dev/null &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  System Quick View </b>- Hardware &amp; system resources')\"</label></text>
    </hbox>"
else
    BASIC_SETTINGS=""
    QUICK_SYSINFO=""
fi

CLOCKSET=""
if [ -f /usr/sbin/sfwbar-clockset ]; then
    CLOCKSET="
    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" sfwbar-clockset \">
      <input file>$CPANEL_ICONS_DIR/clockformat20.png</input>
      <action>sfwbar-clockset &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  Time Format </b>- Set format of the digital-tray clock')\"</label></text>
    </hbox>"
fi

if [ "`which bootmanager`" ]; then
    BOOT_MGR="
    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" bootmanager \">
      <input file>$CPANEL_ICONS_DIR/boot20bw.png</input>
      <action>bootmanager 2>/dev/null &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  Boot Manager </b>- Manage startup apps/drivers/services')\"</label></text>
    </hbox>"
else
    BOOT_MGR=""
fi

if [ "`which eventmanager`" ] && [ ! "`pidof enlightenment`" -a ! "$CURRWM" = "startkde" ]; then
    EVENT_MGR="
    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" eventmanager \">
      <input file>$CPANEL_ICONS_DIR/event20.png</input>
      <action>[ "`which eventmanager`" ] && eventmanager &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  Event Manager </b>- Hot-plugging/save-session/power-off')\"</label></text>
    </hbox>"
else
    EVENT_MGR=""
fi

if [ "`which loginmanager`" ]; then
    LOGIN_MGR="
    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" loginmanager \">
      <input file>$CPANEL_ICONS_DIR/lock20.png</input>
      <action>loginmanager &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  Login Manager </b>- Log in to the current Puppy session')\"</label></text>
    </hbox>"
else
    LOGIN_MGR=""
fi

if [ "`which diffuse`" ]; then
    DIFFUSE="
    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" diffuse \">
      <input file>$CPANEL_ICONS_DIR/xfdiff20.png</input>
      <action>diffuse &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  Diffuse </b>- Merge and compare text files')\"</label></text>
    </hbox>"
else
    DIFFUSE=""
fi

if [ "`which gcolor3`" ]; then
    GCOLOR3="
    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" gcolor3 \">
      <input file>$CPANEL_ICONS_DIR/color20.png</input>
      <action>gcolor3 &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  Color selector </b>- Generate hexadecimal color values')\"</label></text>
    </hbox>"
else
    GCOLOR3=""
fi

DEFAULTS=""
if [ "`which defaults-chooser2 2>/dev/null`" ]; then
 DEFAULTAPPS="defaults-chooser2"
elif [ "`which puppyapps 2>/dev/null`" ]; then
 DEFAULTAPPS="puppyapps"
elif [ "`which defaults-chooser 2>/dev/null`" ]; then
 DEFAULTAPPS="defaults-chooser"
fi
[ "$DEFAULTAPPS" ] && DEFAULTS="
    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" defaults-chooser \">
      <input file>$CPANEL_ICONS_DIR/defaults20.png</input>
      <action>$DEFAULTAPPS &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  Default Apps Manager </b>- Select default applications')\"</label></text>
    </hbox>"

if [ "`which gdmap`" ]; then
    GDMAP="
    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" gdmap \">
      <input file>$CPANEL_ICONS_DIR/hdisk20.png</input>
      <action>gdmap -f / &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  Disk Map </b>- View graphical map of current disk files')\"</label></text>
    </hbox>"
else
    GDMAP=""
fi

if [ "`which ghasher`" -o "`which gtkhash`" -o "`which pupchecksum.sh`" -o "`which pupmd5sum.sh`" ]; then
    HASH="
    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" ghasher, gtkhash, pupchecksum, pupmd5sum \">
      <input file>$CPANEL_ICONS_DIR/gtkhash20.png</input>
      <action>$WORKDIR/func -gtkhash &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  Checksum </b>- Calculate hash checksum (e.g. - MD5)')\"</label></text>
    </hbox>"
else
    HASH=""
fi

GTKICONS="
    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" gtk.icons \">
      <input file>$CPANEL_ICONS_DIR/gtkicons20.png</input>
      <action>$WORKDIR/gtk.icons &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  GTK Icons </b>- Browse GTK stock icons and stock IDs')\"</label></text>
    </hbox>"

if [ -f $HOME/.config/gtk-3.0/settings.ini ]; then
    [ ! "`cat $HOME/.config/gtk-3.0/settings.ini | grep 'gtk-menu-images' | grep '1'`" ] && GTKICONS=""
fi

if [ "`which listdd.sh`" ]; then
    LISTDD="
    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" listdd.sh \">
      <input file>$CPANEL_ICONS_DIR/quickview20.png</input>
      <action>listdd_wrapper &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  ListDD </b>- List dynamic (shared) library dependencies')\"</label></text>
    </hbox>"
else
    LISTDD=""
fi

if [ "`which momanager`" ]; then
    MoMANAGER="
    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" momanager \">
      <input file>$CPANEL_ICONS_DIR/fontsize20.png</input>
      <action>momanager &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  MoManager </b>- Translate Puppy to non-English format')\"</label></text>
    </hbox>"
else
    MoMANAGER=""
fi

if [ "`which peasydiff`" ]; then
    PDIFF="
    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" peasydiff \">
      <input file>$CPANEL_ICONS_DIR/xfdiff20.png</input>
      <action>peasydiff &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  PeasyDiff </b>- Comparison utility for files and folders')\"</label></text>
    </hbox>"
else
    PDIFF=""
fi

if [ "`which psnip`" ]; then
    SCREENSHOT="
    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" pSnip \">
      <input file>$CPANEL_ICONS_DIR/screen20.png</input>
      <action>psnip &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  ScreenShot </b>- Capture ROI area or full screen')\"</label></text>
    </hbox>"
else
    SCREENSHOT=""
fi

if [ "`which wmstartups`" -o "`which startmount`" ]; then
    [ ! -f /usr/bin/startmount ] && [ -f /usr/local/Startmount/Startmount ] && ln -s /usr/local/Startmount/Startmount /usr/bin/startmount
    START_APPS="
    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" autostart apps \">
      <input file>$CPANEL_ICONS_DIR/startup20.png</input>
      <action>[ "`which wmstartups`" ] && wmstartups &</action>
      <action>[ "`which startmount`" ] && startmount &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  Startup Apps </b>- Select apps to autostart at bootup')\"</label></text>
    </hbox>"
else
    START_APPS=""
fi

if [ "`which UrxvtControl`" ]; then
    URXVTCONTROL="
    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" UrxvtControl \">
      <input file>$CPANEL_ICONS_DIR/console20.png</input>
      <action>exec UrxvtControl &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  Urxvt Control </b>- Set appearance of the Urxvt terminal')\"</label></text>
    </hbox>"
else
    URXVTCONTROL=""
fi

if [ "`which xdelta_gui`" ]; then
    XDELTA="
    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" xdelta_gui \">
      <input file>$CPANEL_ICONS_DIR/xdelta20.png</input>
      <action>xdelta_gui &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  Xdelta </b>- Binary-file difference utility (delta generator)')\"</label></text>
    </hbox>"
else
    XDELTA=""
fi

PUPCONTROL_PREF="
     <button relief=\"2\" height-request=\"30\" width-request=\"30\" tooltip-text=\" $(gettext 'Preferences') \">
      <input file>$CPANEL_ICONS_DIR/preferences18.png</input>
      <action>cd /usr; . $WORKDIR/PC-pref &</action>
      <action type=\"exit\">quit_now</action>
     </button>"

PUPCONTROL_EXIT="
     <button relief=\"2\" height-request=\"30\" width-request=\"30\" tooltip-text=\" $(gettext 'Quit') \">
      <input file>$CPANEL_ICONS_DIR/exit20.png</input>
      <action type=\"exit\">quit_now</action>
     </button>"

#Printer dlg...
echo '#!/bin/sh
export PRINTER_DIALOG="<window title=\"PCP\" icon-name=\"gtk-print\" resizable=\"false\" window-position=\"2\">
 <vbox>
  <text use-markup=\"true\"><label>\"<b><span size='"'large'"'>$(gettext 'Printer')</span></b>\"</label></text>
  <pixmap><input file>/usr/local/PupControl/icons/printer20.png</input></pixmap>
  <frame $(gettext "Options")>
   <hbox homogeneous=\"true\">
     <button width-request=\"155\" tooltip-text=\" $(gettext "Install printer with CUPS") \">
     <label>\"$(gettext "Install")\"</label>
      <action>/usr/local/PupControl/func -printsetup &</action>
      <action type=\"exit\">quit_now</action>
     </button>
   </hbox>
   <hbox homogeneous=\"true\">
     <button width-request=\"155\" tooltip-text=\" $(gettext "Manage printer status/output") \">
     <label>\"$(gettext "Manage")\"</label>
      <action>/usr/local/PupControl/func -printmanager &</action>
      <action type=\"exit\">quit_now</action>
     </button>
   </hbox>
   <hbox homogeneous=\"true\">
     <button width-request=\"155\">
     <label>\"$(gettext "Exit")\"</label>
      <action type=\"exit\">quit_now</action>
     </button>
   </hbox>
  </frame>
 </vbox>
</window>"
$GTKDIALOG --program=PRINTER_DIALOG' > $TMPDIR/pupcontrol-printer
chmod 777 $TMPDIR/pupcontrol-printer

#PupControl help dlg...
func_pcp_help()
{
export PUPCONTROL_HELP="
<window title=\"PupControl\" icon-name=\"control-panel_48\" window-position=\"3\" resizable=\"false\">
    <vbox margin=\"10\" width-request=\"425\">
        <pixmap><input file>$CPANEL_ICONS_DIR/control-panel_48.png</input><height>56</height><width>56</width></pixmap>
        <text use-markup=\"true\"><label>\"<b><span size='"'x-large'"'>Pup</span><span size='"'x-large'"' color='"$COLOR"'>Control</span> $VERSION</b>\"</label></text>
        <text use-markup=\"true\"><label>\"<b>$(gettext 'Wayland Control Panel')</b>\"</label></text>
        <text><label>\"Roger D. Grider (C) 2010-2026 GPL3\"</label></text>
        <pixmap><input file>/usr/local/PupControl/icons/blank1.png</input></pixmap>
        <pixmap><input file>/usr/local/PupControl/icons/blank1.png</input></pixmap>
    </vbox>
</window>"
$GTKDIALOG -p PUPCONTROL_HELP
unset PUPCONTROL_HELP
}
export -f func_pcp_help

#Tray...
TRAY=""
SHOW_TRAY=$(cat $APPS_DIR/showtray 2>/dev/null)
if [ "$SHOW_TRAY" = "true" ]; then
 [ ! "`which xarchive 2>/dev/null`" ] && [ -f /usr/local/bin/defaultarchiver ] && ln -sf /usr/local/bin/defaultarchiver /usr/bin/xarchive
 [ -f /usr/share/icons/hicolor/48x48/apps/xarchiver.png ] && ARCHIVER_ICON="/usr/share/icons/hicolor/48x48/apps/xarchiver.png" || ARCHIVER_ICON="$CPANEL_ICONS_DIR/archive.svg"

 TRAY="<text space-expand=\"false\" space-fill=\"true\"><label>\" \"</label></text>
    <hbox space-expand=\"false\" space-fill=\"true\" homogeneous=\"true\">   

     <button tooltip-text=\" $(gettext 'File Archiver') - $FILE_ARCHIVER \" use-underline=\"true\">
      <input file>$ARCHIVER_ICON</input><height>24</height><width>24</width>
      <action>$APPS_DIR/archiver &</action>
     </button>

     <button tooltip-text=\" $(gettext 'File Manager') - $FILE_MANAGER \" use-underline=\"true\">
      <input file>$CPANEL_ICONS_DIR/file.svg</input><height>24</height><width>24</width>
      <action>$APPS_DIR/filemanager &</action>
     </button>

     <button tooltip-text=\" $(gettext 'File Finder') - $FILE_FINDER \" use-underline=\"true\">
      <input file>$CPANEL_ICONS_DIR/find.svg</input><height>24</height><width>24</width>
      <action>$APPS_DIR/filefinder &</action>
     </button>

     <button tooltip-text=\" $(gettext 'System Information') - $SYSINFO \" use-underline=\"true\">
      <input file>$CPANEL_ICONS_DIR/sysinfo.svg</input><height>24</height><width>24</width>
      <action>$APPS_DIR/sysinfo &</action>
     </button>

     <button tooltip-text=\" $(gettext 'Mount/Unmount drives') \" use-underline=\"true\">
      <input file>$CPANEL_ICONS_DIR/mount.png</input><height>24</height><width>24</width>
      <action>$WORKDIR/func -mount &</action>
     </button>

    <button tooltip-text=\" $(gettext 'Run Dialog') - $RUNDIALOG \" use-underline=\"true\">
      <input file>$CPANEL_ICONS_DIR/run.svg</input><height>24</height><width>24</width>
      <action>$APPS_DIR/rundialog &</action>
     </button>

    <button tooltip-text=\" $(gettext 'Task Manager') - $TASK_MANAGER \" use-underline=\"true\">
      <input file>$CPANEL_ICONS_DIR/tasks.svg</input><height>24</height><width>24</width>
      <action>$APPS_DIR/taskmanager &</action>
     </button>

     <button tooltip-text=\" $(gettext 'Terminal') - $CONSOLE \" use-underline=\"true\">
      <input file>$CPANEL_ICONS_DIR/terminal.svg</input><height>24</height><width>24</width>
      <action>$APPS_DIR/console &</action>
     </button>

     <button tooltip-text=\" $(gettext 'Shutdown Manager') \" use-underline=\"true\">
      <input file>$CPANEL_ICONS_DIR/shutdown.svg</input><height>24</height><width>24</width>
      <action>$WORKDIR/Shutdown &</action>
      <action type=\"exit\">quit_now</action>
     </button>
    </hbox>"
fi

#PupControl dlg...
export PUPCONTROL="
<window title=\"PCP\" icon-name=\"control-panel_48\" resizable=\"$GUI_RESIZABLE\" window-position=\"1\">
<vbox width-request=\"$GUI_WIDTH\" space-expand=\"true\" space-fill=\"true\">
 <hbox space-expand=\"false\" space-fill=\"true\" homogeneous=\"true\">
  <hbox width-request=\"109\">
    <button space-expand=\"true\" space-fill=\"true\" visible=\"false\"><label>\" \"</label></button>
  </hbox>
  <vbox>
    <text use-markup=\"true\"><label>\"<b><span size='"'x-large'"'>Pup</span><span size='"'x-large'"' color='"$COLOR"'>Control</span></b>\"</label></text>
  </vbox>
  <hbox width-request=\"109\">
    $PUPCONTROL_PREF
    <button relief=\"2\" height-request=\"30\" width-request=\"33\" tooltip-text=\" $(gettext 'Help') \"><input file>$CPANEL_ICONS_DIR/help20.png</input><action>func_pcp_help &</action></button>
    $PUPCONTROL_EXIT
  </hbox>
 </hbox>

 <hbox space-expand=\"true\" space-fill=\"true\">
  <vbox margin=\"1\" space-fill=\"true\" space-expand=\"false\">
     <text height-request=\"1\"><label>\"\"</label></text>
     <radiobutton draw-indicator=\"false\">
       <label>\"$(gettext 'Desktop')\"</label>
       <variable>RADIO_DESKTOP</variable>
       <action>if true echo 0 > /tmp/PC-page</action>
       <action>if true refresh:GUI_OPTIONS</action>
     </radiobutton>
     <radiobutton draw-indicator=\"false\">
       <label>\"$(gettext 'Drive')\"</label>
       <variable>RADIO_DRIVE</variable>
       <action>if true echo 1 > /tmp/PC-page</action>
       <action>if true refresh:GUI_OPTIONS</action>
     </radiobutton>
     <radiobutton draw-indicator=\"false\">
       <label>\"$(gettext 'Hardware')\"</label>
       <variable>RADIO_HARDWARE</variable>
       <action>if true echo 2 > /tmp/PC-page</action>
       <action>if true refresh:GUI_OPTIONS</action>
     </radiobutton>
     <radiobutton draw-indicator=\"false\">
       <label>\"$(gettext 'Software')\"</label>
       <variable>RADIO_SOFTWARE</variable>
       <action>if true echo 3 > /tmp/PC-page</action>
       <action>if true refresh:GUI_OPTIONS</action>
     </radiobutton>
     <radiobutton draw-indicator=\"false\">
       <label>\"$(gettext 'Network')\"</label>
       <variable>RADIO_NETWORK</variable>
       <action>if true echo 4 > /tmp/PC-page</action>
       <action>if true refresh:GUI_OPTIONS</action>
     </radiobutton>
     <radiobutton draw-indicator=\"false\">
       <label>\"$(gettext 'Personal')\"</label>
       <variable>RADIO_PERSONAL</variable>
       <action>if true echo 5 > /tmp/PC-page</action>
       <action>if true refresh:GUI_OPTIONS</action>
     </radiobutton>
     <radiobutton has-focus=\"$HAS_FOCUS1\" draw-indicator=\"false\">
       <label>\"$(gettext 'Settings')\"</label>
       <variable>RADIO_SETTINGS</variable>
       <default>$RADIO_SETTINGS</default>
       <action>if true echo 6 > /tmp/PC-page</action>
       <action>if true refresh:GUI_OPTIONS</action>
     </radiobutton>
     <radiobutton draw-indicator=\"false\">
       <label>\"$(gettext 'System')\"</label>
       <variable>RADIO_SYSTEM</variable>
       <action>if true echo 7 > /tmp/PC-page</action>
       <action>if true refresh:GUI_OPTIONS</action>
     </radiobutton>
     <radiobutton draw-indicator=\"false\">
       <label>\"$(gettext 'Utility')\"</label>
       <variable>RADIO_UTILITY</variable>
       <action>if true echo 8 > /tmp/PC-page</action>
       <action>if true refresh:GUI_OPTIONS</action>
     </radiobutton>
     <radiobutton has-focus=\"$HAS_FOCUS2\" draw-indicator=\"false\">
       <label>\"$(gettext 'My Panel')\"</label>
       <variable>RADIO_MYPANEL</variable>
       <default>$RADIO_MYPANEL</default>
       <action>if true echo 9 > /tmp/PC-page</action>
       <action>if true refresh:GUI_OPTIONS</action>
     </radiobutton>
  </vbox>

  <vbox space-expand=\"true\" space-fill=\"true\">
  <notebook height-request=\"385\" space-expand=\"true\" space-fill=\"true\" show-tabs=\"false\" show-border=\"false\" page=\"$PAGE\" labels=\"0|1|2|3|4|5|6|7|8|9|10\">
   <vbox scrollable=\"true\" space-expand=\"true\" space-fill=\"true\">
   <text xalign=\"1\" height-request=\"20\" use-markup=\"true\"><label>\"$(gettext '<b><span size='"'small'"'>Desktop</span></b>')      \"</label></text>
    $CURSOR
    $ICONS
    $DESKICONS
    $DESKSETTINGS

    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" $CURRWM $(gettext 'compatible option') \">
      <input file>$CPANEL_ICONS_DIR/themes20.png</input><height>20</height><width>20</width>
      <action>labwc-tweaks-gtk-wrapper &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"<b>  Desktop Themes </b>- GTK, Openbox and Icon themes \"</label></text>
    </hbox>

    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" $CURRWM $(gettext 'compatible option') \">
      <input file>$CPANEL_ICONS_DIR/thememaker20.png</input><height>20</height><width>20</width>
      <action>ptheme_gtk_globalthemes &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"<b>  Desktop Themes (Global) </b>- Desktop system themes \"</label></text>
    </hbox>

    $WALLPAPER
    $SCREENSAVER
    $SCREENLAYOUT
    $GLIPPER
    $GFONTSEL
    $GLOBAL_FONTSIZE
    $HOTKEY
    $MENUMANAGER
    $MENU_UPDATE
    $SCREENLOCK
    $SYSMONITOR
    $TASKBAR
    $WMSETTINGS
      <text height-request=\"350\"><label>\"\"</label></text>
   </vbox>


   <vbox scrollable=\"true\" space-expand=\"true\" space-fill=\"true\">
   <text xalign=\"1\" height-request=\"20\" use-markup=\"true\"><label>\"$(gettext '<b><span size='"'small'"'>Drive</span></b>')      \"</label></text>
    $BACKUp
    $BURN
    $CDTOOL
    $CDBURNWIZARD
    $PARTVIEW
    $FRUGAL_PUP

    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" gparted \">
      <input file>$CPANEL_ICONS_DIR/partition20.png</input>
      <action>$WORKDIR/func -gparted &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  Gparted </b>- Add, delete or resize drive partitions')\"</label></text>
    </hbox>

    $GRUb
    $GSMARTCONTROL

    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" dotpup \">
      <input file>$CPANEL_ICONS_DIR/download20.png</input>
      <action>dotpup &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  Installation Manager </b>- Puppy Linux install options')\"</label></text>
    </hbox>

    $ISOEDITOR
    $MTP
    $PART_IMAGE
    $PDISK
    $PUDD
    $PUPSAVEBACKUP
    $PUPSAVEFOLDERBACKUP
    $PUPSAVECONFIG
    $PUPSAVE_LOCATION
    $PUPSAVE_RESIZE
    $REMASTER
      <text height-request=\"350\"><label>\"\"</label></text>
   </vbox>


   <vbox scrollable=\"true\" space-expand=\"true\" space-fill=\"true\">
   <text xalign=\"1\" height-request=\"20\" use-markup=\"true\"><label>\"$(gettext '<b><span size='"'small'"'>Hardware</span></b>')      \"</label></text>
    $BLUEMAN
    $BLUETOOTH
    $CAMERA

    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" $CURRWM $(gettext 'compatible option') \">
      <input file>$CPANEL_ICONS_DIR/mouse20.png</input>
      <action>input-wizard &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  Input Devices </b>- Set keyboard, mouse and touchpad')\"</label></text>
    </hbox>

    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" $CURRWM $(gettext 'compatible option') \">
      <input file>$CPANEL_ICONS_DIR/printer20.png</input>
      <action>. $TMPDIR/pupcontrol-printer &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  Printer </b>- Install printer or manage the printer output')\"</label></text>
    </hbox>

    $SCAN
    $WEBCAM
    $XORGWIZARD
      <text height-request=\"350\"><label>\"\"</label></text>
   </vbox>


   <vbox scrollable=\"true\" space-expand=\"true\" space-fill=\"true\">
   <text xalign=\"1\" height-request=\"20\" use-markup=\"true\"><label>\"$(gettext '<b><span size='"'small'"'>Software</span></b>')      \"</label></text>
    $DEFAULTS
    $GET_LIBRE
    $GNEWPET
    $QUICKPET
    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" $ADD_REMOVE \">
      <input file>$CPANEL_ICONS_DIR/pet20.png</input>
      <action>$ADD_REMOVE &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  Package Manager (PPM) </b>- Puppy package manager')\"</label></text>
    </hbox>
    $APT
    $REM_BUILTIN
    $SFSLOAD
    $START_APPS
      <text height-request=\"350\"><label>\"\"</label></text>
   </vbox>


   <vbox scrollable=\"true\" space-expand=\"true\" space-fill=\"true\">
   <text xalign=\"1\" height-request=\"20\" use-markup=\"true\"><label>\"$(gettext '<b><span size='"'small'"'>Network</span></b>')      \"</label></text>
    $DN_LOAD
    $P_2_P
    $FTProtocol

    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" set firewall \">
      <input file>$CPANEL_ICONS_DIR/firewall20.png</input>
      <action>$WORKDIR/func -firewall &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  Firewall Setup </b>- Install/Configure protective firewall')\"</label></text>
    </hbox>

    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" firewall-status.sh \">
      <input file>$CPANEL_ICONS_DIR/lock20.png</input>
      <action>$WORKDIR/firewall-status.sh &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  Firewall Status </b>- Enable, disable or remove firewall')\"</label></text>
    </hbox>

    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" $NETWORK \">
      <input file>$CPANEL_ICONS_DIR/internetconnect20.png</input>
      <action>$APPS_DIR/network &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  Internet Connect </b>- Configure/Test network interface')\"</label></text>
    </hbox>

    $WiRELESS
    $PORTSCAN
    $NETSECURITY
    $REMOTE_DT
    $SMBA
    $YASSM
    $VPN
      <text height-request=\"350\"><label>\"\"</label></text>
   </vbox>


   <vbox scrollable=\"true\" space-expand=\"true\" space-fill=\"true\">
   <text xalign=\"1\" height-request=\"20\" use-markup=\"true\"><label>\"$(gettext '<b><span size='"'small'"'>Personal</span></b>')      \"</label></text>
    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" Xdialog calendar \">
      <input file>$CPANEL_ICONS_DIR/calendar20.png</input>
      <action>Xdialog --title Xcalendar --no-cancel --calendar '"`date +'%d %B %Y'`"' 0 0 0 0 0 &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  Calendar </b>- Browse dates for appointments/tasks')\"</label></text>
    </hbox>

    $ENCRYPT
    $NBOOK
    $PASSWORD
    $PPLOG
    $SCHEDULE_MGR
    $TIME_MGR
      <text height-request=\"350\"><label>\"\"</label></text>
   </vbox>


   <vbox scrollable=\"true\" space-expand=\"true\" space-fill=\"true\">
   <text xalign=\"1\" height-request=\"20\" use-markup=\"true\"><label>\"$(gettext '<b><span size='"'small'"'>Settings</span></b>')      \"</label></text>
    $BASIC_SETTINGS

    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" wizardwizard \">
      <input file>$CPANEL_ICONS_DIR/preferences18.png</input>
      <action>wizardwizard &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  Basic Puppy Setup </b>- Basic configuration guidelines')\"</label></text>
    </hbox>

    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" $BASIC_SETUP \">
      <input file>$CPANEL_ICONS_DIR/reboot20.png</input>
      <action>quicksetup &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  Basic Quicksetup </b>- Initial Firstrun setup options')\"</label></text>
    </hbox>

    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" $COUNTRY_APP \">
      <input file>$CPANEL_ICONS_DIR/country20.png</input>
      <action>$COUNTRY 2>/dev/null &</action>
     </button>
      <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  Country Setup </b>- Set language, timezone, keyboard')\"</label></text>
    </hbox>

     <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" $(gettext 'BIOS/CMOS clock') \">
      <input file>$CPANEL_ICONS_DIR/clock20.png</input>
      <action>$WORKDIR/func -hwclock &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  Hardware Clock </b>- Set HW clock to localtime or UTC')\"</label></text>
    </hbox>

    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" set-time-for-puppy \">
      <input file>$CPANEL_ICONS_DIR/timedate20.png</input>
      <action>set-time-for-puppy &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  Time | Date </b>- Set the current local time and date')\"</label></text>
    </hbox>

    $CLOCKSET

    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" sync \">
      <input file>$CPANEL_ICONS_DIR/timeupdate20.png</input>
      <action>$WORKDIR/func -updatetime &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  Time Update </b>- Sync/Update clock with time servers')\"</label></text>
    </hbox>

    $WMSETTINGS
      <text height-request=\"350\"><label>\"\"</label></text>
   </vbox>


   <vbox scrollable=\"true\" space-expand=\"true\" space-fill=\"true\">
   <text xalign=\"1\" height-request=\"20\" use-markup=\"true\"><label>\"$(gettext '<b><span size='"'small'"'>System</span></b>')      \"</label></text>
    $BOOT_MGR
    $CPU_SCALING
    $EVENT_MGR
    $LOGIN_MGR
    $SYSMONITOR
    $QUICK_SYSINFO

    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" $(gettext 'System Information') \">
      <input file>$CPANEL_ICONS_DIR/sysinfo20.png</input>
      <action>$WORKDIR/sysinfo &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  SysInfo Utilities </b>- Puppy system information utilities')\"</label></text>
    </hbox>

    $USER_MGR
      <text height-request=\"350\"><label>\"\"</label></text>
   </vbox>


   <vbox scrollable=\"true\" space-expand=\"true\" space-fill=\"true\">
   <text xalign=\"1\" height-request=\"20\" use-markup=\"true\"><label>\"$(gettext '<b><span size='"'small'"'>Utility</span></b>')      \"</label></text>

    <hbox>
     <text width-request=\"35\" space-expand=\"false\" space-fill=\"false\"><label>\"\"</label></text>
     <button space-expand=\"false\" space-fill=\"false\" tooltip-text=\" galculator, gcalctool, calcoo, cgtkcalc, xcalc \">
      <input file>$CPANEL_ICONS_DIR/calculator20.png</input>
      <action>$WORKDIR/func -calculator &</action>
     </button>
     <text xalign=\"0\" wrap=\"false\" space-expand=\"true\" space-fill=\"true\" use-markup=\"true\"><label>\"$(gettext '<b>  Calculator </b>- Perform basic or scientific calculations')\"</label></text>
    </hbox>

    $HASH
    $DIFFUSE
    $GCOLOR3
    $GDMAP
    $GNEWPET
    $GTKICONS
    $LISTDD
    $MoMANAGER
    $PDIFF
    $SCREENSHOT
    $URXVTCONTROL
    $XDELTA
      <text height-request=\"350\"><label>\"\"</label></text>
   </vbox>


   <vbox scrollable=\"true\" space-expand=\"true\" space-fill=\"true\">
      <text height-request=\"60\"><label>\"\"</label></text>
   <vbox margin=\"12\">
    <hbox space-expand=\"false\" space-fill=\"true\" homogeneous=\"true\">
     <button label=\" 1: $MYCONTROL1_NAME\" xalign=\"0\">
      <action>$MYCONTROL1 &</action>
     </button>
     <button label=\" 5: $MYCONTROL5_NAME\" xalign=\"0\">
      <action>$MYCONTROL5 &</action>
     </button>
    </hbox>

    <hbox space-expand=\"false\" space-fill=\"true\" homogeneous=\"true\">
     <button label=\" 2: $MYCONTROL2_NAME\" xalign=\"0\">
      <action>$MYCONTROL2 &</action>
     </button>
     <button label=\" 6: $MYCONTROL6_NAME\" xalign=\"0\">
      <action>$MYCONTROL6 &</action>
     </button>
    </hbox>

    <hbox space-expand=\"false\" space-fill=\"true\" homogeneous=\"true\">
     <button label=\" 3: $MYCONTROL3_NAME\" xalign=\"0\">
      <action>$MYCONTROL3 &</action>
     </button>
     <button label=\" 7: $MYCONTROL7_NAME\" xalign=\"0\">
      <action>$MYCONTROL7 &</action>
     </button>
    </hbox>

    <hbox space-expand=\"false\" space-fill=\"true\" homogeneous=\"true\">  
     <button label=\" 4: $MYCONTROL4_NAME\" xalign=\"0\">
      <action>$MYCONTROL4 &</action>
     </button>
     <button label=\" 8: $MYCONTROL8_NAME\" xalign=\"0\">
      <action>$MYCONTROL8 &</action>
     </button>
    </hbox>
   </vbox>

    <hbox margin=\"12\" homogeneous=\"true\">
     <button height-request=\"32\" width-request=\"120\" tooltip-text=\" $(gettext 'Select custom applications') \">
      <label>\"  $(gettext 'Manage Custom Applications')  \"</label>
      <action>cd /usr; $WORKDIR/PC-pref &</action>
      <action>echo "mypanel-flag" > /tmp/PCP-page</action>
      <action type=\"exit\">quit_now</action>
     </button>
    </hbox>
      <text height-request=\"350\"><label>\"\"</label></text>
   </vbox>

   <variable>GUI_OPTIONS</variable>
   <input file>/tmp/PC-page</input>
  </notebook>
  </vbox>
 </hbox>
 $TRAY
 </vbox>
 <action signal=\"show\">echo 100 > $TMPDIR/pupcontrol-splash</action>
 </window>"

$GTKDIALOG -p PUPCONTROL --geometry="$GEO" --styles=$TMPDIR/gtkrc.css
unset PUPCONTROL

exit 0
