How to use the electron.app.getName function in electron

To help you get started, we’ve selected a few electron examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github igdmapps / igdm / main / menutemplate.js View on Github external
label: 'Tweet about IGdm',
        click() {
          openExternal('https://twitter.com/intent/tweet?original_referer=https%3A%2F%2Figdm.me%2F&ref_src=twsrc%5Etfw&text=Continue%20Instagram%20DMs%20on%20your%20computer&tw_p=tweetbutton&url=https%3A%2F%2Figdm.me%2F')
        }
      },
      {
        label: 'Try IGdm Pro',
        click() { openExternal('https://pro.igdm.me') }
      }
    ]
  }
]

if (process.platform === 'darwin') {
  template.unshift({
    label: app.getName(),
    submenu: [
      {role: 'about'},
      {type: 'separator'},
      {role: 'services', submenu: []},
      {type: 'separator'},
      {role: 'hide'},
      {role: 'hideothers'},
      {role: 'unhide'},
      {type: 'separator'},
      {role: 'quit'}
    ]
  })

  // Edit menu
  template[1].submenu.push(
    {type: 'separator'},
github barbhackk / rekord / main.js View on Github external
},
  {
    label: 'Aide',
    role: 'help',
    submenu: [
      {
        label: 'Documentation',
        click () { require('electron').shell.openExternalSync('https://barbhackk.github.io/rekord') }
      }
    ]
  }
]

if(isMac){
  templateMenu.unshift({
    label: app.getName(),
    submenu: [
      {label: 'Γ€ propos de Rekord', role: 'about'},
      {type: 'separator'},
      {role: 'services'},
      {type: 'separator'},
      {label: 'Masquer Rekord', role: 'hide'},
      {label: 'Masquer les autres', role: 'hideothers'},
      {label: 'Afficher tout', role: 'unhide'},
      {type: 'separator'},
      {label: 'Quitter Rekord', role: 'quit'}
    ]
  });
}

function createWindow () {
  // Create the browser window.
github muffinista / before-dawn / src / main / index.js View on Github external
// load a few global variables
require("./bootstrap.js");

log.transports.file.level = "debug";
log.transports.file.maxSize = 1 * 1024 * 1024;

log.info(`Hello from version: ${global.APP_VERSION_BASE} running in ${global.IS_DEV ? "development" : "production"}`);

if ( global.IS_DEV ) {
  app.setName(global.APP_NAME);
  app.name = global.APP_NAME;
  log.info(`set app name to ${app.getName()}`);

  if ( testMode !== true ) {
    let userDataPath = path.join(app.getPath("appData"), app.getName());
    log.info(`set userData path to ${userDataPath}`);
    app.setPath("userData", userDataPath);
  }
}

// store our root path as a global variable so we can access it from screens
if ( process.env.BEFORE_DAWN_DIR !== undefined ) {
  global.basePath = process.env.BEFORE_DAWN_DIR;
}
else {
  global.basePath = app.getPath("userData");
  // global.basePath = path.join(app.getPath("appData"), global.APP_DIR);
}
log.info("use base path", global.basePath);

/**
github matthewgonzalez / what-the-port / src / checkupdates.js View on Github external
function showUpdateMessageBox (update) {
  let message = 'Check it. ' + update.tag_name + ' is hot off the press. You are currently rocking v' + version + '. You might want to go an grab it.'

  // Ask user to update the app
  dialog.showMessageBox({
    type: 'question',
    icon: path.join(__dirname, 'assets/system-icons/png/64x64.png'),
    buttons: [
      'Let\'s do this now.', 'Remind me.', 'No, thanks. I don\'t want this update.'
    ],
    defaultId: 0,
    cancelId: 1,
    message: 'Huzzah! The new "' + app.getName() + '" is available :D',
    detail: message
  }, response => {
    if (response === 0) {
      shell.openExternal('https://matthewgonzalez.github.io/what-the-port/')
    } else if (response === 1) {
      storage.remove('ignoreVersion')
    } else if (response === 2) {
      storage.set('ignoreVersion', update.tag_name)
    }
  })
}
github Lewdninja / liveme-pro-tools / datamanager.js View on Github external
unviewProfiles (oldestDate, dryRun) {
        if (dryRun == null) dryRun = false

        console.log('Old Viewed Profiles Count: ' + profiles.length)

        let ret = 0
        let temp = []
        for (let i = 0; i < profiles.length; i++) {
            if (profiles[i].dt > oldestDate) {
                temp.push(profiles[i])
                ret++
            }
        }
        if (!dryRun) {
            profiles = temp
            fs.writeFile(path.join(app.getPath('appData'), app.getName(), 'profiles.json'), JSON.stringify(profiles), () => { })
        }
        console.log('New Viewed Profiles Count: ' + temp.length)
        return ret
    }
github ZeusWPI / MOZAIC / planetwars / client / app / main / menu.ts View on Github external
})()),
    },
    {
      label: 'Help',
      role: 'help',
      submenu: [
        {
          label: 'Learn More',
          click: () => { shell.openExternal('http://electron.atom.io'); },
        },
      ],
    },
  ];

  if (process.platform === 'darwin') {
    const name = app.getName();
    template.unshift({
      label: name,
      submenu: [
        {
          label: 'About ' + name,
          role: 'about',
        },
        {
          type: 'separator',
        },
        {
          label: 'Services',
          role: 'services',
          submenu: [],
        },
        {
github xx10t4 / iotalk / app / js / menu.js View on Github external
}
            ]
        },
        {
            role: 'help', label: i18n.t('Help'),
            submenu: [
            {
                label: "Learn More", //i18n.t('Learn more'),
                click () { electron.shell.openExternal('https://github.com/xx10t4/iota1k') }
            }
            ]
        }
    ]

    if (process.platform === 'darwin') {
        const name = app.getName()
        template.unshift({
            label: name,
            submenu: [
            {
                role: 'hide', label: i18n.t('Hide') + " " + name
            },
            {
                role: 'hideothers', label: i18n.t('Hide others')
            },
            {
                role: 'unhide', label: i18n.t('Unhide')
            },
            {
                type: 'separator'
            },
            {
github wulkano / kap / app / src / main / menus.js View on Github external
{
    type: 'separator'
  },
  checkForUpdatesItem,
  {
    type: 'separator'
  },
  {
    role: 'quit',
    accelerator: 'Cmd+Q'
  }
]);

export const applicationMenu = Menu.buildFromTemplate([
  {
    label: app.getName(),
    submenu: [
      {
        role: 'about'
      },
      {
        type: 'separator'
      },
      {
        label: 'Preferences…',
        accelerator: 'Cmd+,',
        click() {
          app.kap.openPrefsWindow();
        }
      },
      checkForUpdatesItem,
      {
github ubergrape / grape-electron / src / app / initApp.js View on Github external
)
        },
      )

      state.tray = new Tray(
        systemPreferences.isDarkMode() ? trayWhiteIcon : trayIcon,
      )
      state.tray.setPressedImage(
        systemPreferences.isDarkMode() ? trayWhiteIcon : trayIcon,
      )
      break
    default:
      state.tray = new Tray(trayWhiteIcon)
  }

  state.tray.setToolTip(app.getName())
  state.tray.setContextMenu(Menu.buildFromTemplate(getTrayTemplate()))
  state.tray.on('click', () => showMainWindow())
}
github Azure / BatchExplorer / src / client / proxy / manual-proxy-configuration-window / manual-proxy-configuration-window.ts View on Github external
protected createWindow() {
        const window = new BrowserWindow({
            title: app.getName(),
            height: 400,
            width: 500,
            icon: Constants.urls.icon,
            resizable: false,
            titleBarStyle: "hidden",
            show: false,
            center: true,
        });
        if (this.currentSettings) {
            const setting = this.currentSettings.https || this.currentSettings.http;
            if (setting) {
                (window as any).currentSettings = {
                    url: `${setting.protocol}://${setting.host}`,
                    port: setting.port,
                    username: setting.credentials && setting.credentials.username,
                    password: setting.credentials && setting.credentials.password,