update icon & change PLGL to PLWL

This commit is contained in:
olcxja 2026-09-25 20:04:00 +02:00
commit 1aa603aeac
18 changed files with 117 additions and 110 deletions

View file

@ -3,10 +3,10 @@
const path = require('path')
const fs = require('fs')
const APP_NAME = 'PLGL'
const APP_NAME = 'PLWL'
function findPng() {
const p = path.resolve(__dirname, '..', 'renderer', 'plgl.png')
const p = path.resolve(__dirname, '..', 'renderer', 'plwl.png')
try {
fs.accessSync(p)
return p
@ -24,7 +24,7 @@ function writeIconThemeDirs(png) {
for (const [dir, size] of Object.entries(sizes)) {
const themeDir = path.join(base, 'hicolor', dir, 'apps')
fs.mkdirSync(themeDir, { recursive: true })
fs.copyFileSync(png, path.join(themeDir, 'plgl.png'))
fs.copyFileSync(png, path.join(themeDir, 'plwl.png'))
}
const desktopDir = path.join(home, '.local', 'share', 'applications')
fs.mkdirSync(desktopDir, { recursive: true })
@ -33,12 +33,12 @@ function writeIconThemeDirs(png) {
'Type=Application',
`Name=${APP_NAME}`,
'Comment=Portable Linux Wine Launcher',
'Exec=plgl',
`Icon=plgl`,
'Exec=plwl',
`Icon=plwl`,
'Terminal=false',
'Categories=Game;'
].join('\n')
fs.writeFileSync(path.join(desktopDir, 'plgl.desktop'), desktop)
fs.writeFileSync(path.join(desktopDir, 'plwl.desktop'), desktop)
} catch {}
}

View file

@ -12,7 +12,7 @@ const importer = require('./importer')
const i18n = require('./i18n')
const { createMainWindow } = require('./window')
app.setName('PLGL')
app.setName('PLWL')
let win = null
@ -46,7 +46,7 @@ function scanGamesFolder(dir, depth, out) {
for (const e of entries) {
if (!e.isDirectory()) continue
const full = path.join(dir, e.name)
if (require('fs').existsSync(path.join(full, '.plgl-imported'))) {
if (require('fs').existsSync(path.join(full, '.plwl-imported'))) {
out.push(full)
} else {
scanGamesFolder(full, depth - 1, out)
@ -190,7 +190,7 @@ ipcMain.handle('games:import', async (e, srcDir, mode) => {
}
const game = await importer.importGame(srcDir, mode, onProgress)
library.addGame(game)
require('fs').writeFileSync(path.join(game.workdir, '.plgl-imported'), '')
require('fs').writeFileSync(path.join(game.workdir, '.plwl-imported'), '')
return game
})
@ -309,7 +309,7 @@ app.whenReady().then(async () => {
setAppIcon(app)
} catch {}
}
protocol.handle('plgl-icon', request => {
protocol.handle('plwl-icon', request => {
const id = decodeURIComponent(new URL(request.url).hostname)
const dir = path.join(DIRS.DATA, 'icons', id)
let file = null

View file

@ -5,7 +5,7 @@ const fs = require('fs')
const APP_ROOT = path.resolve(__dirname, '..')
const BUILD = process.env.PLGL_BUILD_DIR || path.join(APP_ROOT, 'build')
const BUILD = process.env.PLWL_BUILD_DIR || path.join(APP_ROOT, 'build')
const BUNDLED = path.join(APP_ROOT, 'files')
const FILES = path.join(BUILD, 'files')

View file

@ -3,7 +3,7 @@
const { contextBridge, ipcRenderer } = require('electron')
const { DIRS } = require('./paths')
contextBridge.exposeInMainWorld('plgl', {
contextBridge.exposeInMainWorld('plwl', {
FILES_DIR: DIRS.FILES,
i18nList: () => ipcRenderer.invoke('i18n:list'),
i18nGet: code => ipcRenderer.invoke('i18n:get', code),

View file

@ -7,8 +7,8 @@ const DIST = path.resolve(__dirname, '..', 'renderer')
function resolveIcon() {
const candidates = [
path.join(DIST, 'plgl.png'),
path.join(DIST, 'plgl.svg')
path.join(DIST, 'plwl.png'),
path.join(DIST, 'plwl.svg')
]
for (const c of candidates) {
try {