const allDesktops = desktops()
const NumIconsMax = ((screenGeometry(allDesktops).width)*(.90))/(64)-7
   /*Tasks*/
    /*added icons apps*/
     /*filemanager*/
      if (applicationExists("org.kde.dolphin.desktop"))
          {
           var apps01 = "applications:org.kde.dolphin.desktop";
          }
      else{
           var apps01 = "";
          }
      /*web browser*/
function BrowserApp(){
 let ListBrowser = {
  1 : "firefox.desktop",
  2 : "firefox_firefox.desktop",
  3 : "org.mozilla.firefox.desktop",
  4 : "chrome.desktop",
  5 : "com.google.Chrome.desktop",
  6 : "applications:com.google.Chrome.desktop",
  7 : "falkon.desktop",
  8 : "org.kde.falkon.desktop",
  9 : "applications:librewolf.desktop",
  10 : "io.gitlab.librewolf-community.desktop",
  11 : userDataPath(),
      }
function BalLisBrowser(x){
if (applicationExists(ListBrowser[x]))
{    return 1
} else {  return 0
}
}
for (a = 1;  BalLisBrowser(a) < 1; a++) {
}
if (ListBrowser[a] === userDataPath()){
    return "0"
} else {
return "applications:"+ListBrowser[a]}
}

if (defaultApplication("browser")) {
var prevbrowser = defaultApplication("browser")
if (prevbrowser.includes("/")){
var browser = BrowserApp()
} else {
if (prevbrowser.includes(".desktop")){
  var browser = `applications:${defaultApplication("browser")}`
  } else {
var browser = BrowserApp()
  }
}
}
else
{
var browser = BrowserApp()
}
/*end web browser*/
function FindApps(y){
 let FullApps = {
  1 : "one-zoho.desktop",
  2 : "ZohoWorkDrive.desktop",
  3 : "cliq.desktop",
  4 : "zoho-mail-desktop.desktop",
  5 : "notebook.desktop",
  6 : "writer.desktop"
       }
       let Utilities = {
  1 : "org.kde.kate.desktop"
      }
      let SystemApps = {
  1 : "systemsettings.desktop"
      }
let result = '';
for (a = 1;  a < 3; a++) {
if (applicationExists(FullApps[a]))  {
    result += 'applications:'+FullApps[a] + ', ';  }
}
let resultUtilities = '';
for (a = 1;  a < 2; a++) {
if (applicationExists(Utilities[a]))  {
    resultUtilities += 'applications:'+Utilities[a] + ', ';  }
}
let resultSystemApps = '';
for (a = 1;  a < 2; a++) {
if (applicationExists(SystemApps[a]))  {
    resultSystemApps += 'applications:'+SystemApps[a] + ', ';  }
}
var AppsPrev = (result+resultUtilities.split(' ')[0]+' '+resultSystemApps.split(' ')[0]).replace(/ /g,'')
var AppsFinal = AppsPrev.substring(0, AppsPrev.length - 1)
return AppsFinal.split(',',y)
}

var apps = FindApps(8)
           /*icons dock /*/
  /*dock*/
applet.currentConfigGroup = [];
applet.writeConfig("launchers", "")
applet.currentConfigGroup = ["General"];
applet.writeConfig("indicateAudioStreams", "false")
applet.writeConfig("iconSpacing", "0")
if (`${browser}` === "0")
           {
applet.writeConfig("launchers", `${apps01},${apps}`)
           }
else {
applet.writeConfig("launchers", `${apps01},${browser},${apps}`)
          }
applet.writeConfig("maxStripes", "1")
