Skip to content

Commit 80bc961

Browse files
committed
cool
1 parent 2667771 commit 80bc961

File tree

4 files changed

+27
-7
lines changed

4 files changed

+27
-7
lines changed

build.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,17 @@ if [ -z "$ARGS" ]; then
88
fi
99

1010
mkdir -p build
11-
curl -fsSL "https://webmc.xyz/assets/img/webmc.png" -o "./build/icon.png"
11+
cp inject.css build/inject.css
12+
curl -fsSL "https://app.webmc.xyz/assets/img/webmc.png" -o "./build/icon.png"
1213
if [[ $? -ne 0 ]]; then
1314
echo "Failed to download icon."
1415
exit 1
1516
fi
1617

18+
if command -v convert &> /dev/null; then
19+
convert build/icon.png -define icon:auto-resize=256,128,64,48,32,16 build/icon.ico
20+
fi
21+
1722
if [[ "$OSTYPE" == "darwin"* ]]; then
1823
mkdir -p build/icon.iconset
1924
sips -z 16 16 build/icon.png --out build/icon.iconset/icon_16x16.png

index.js

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
const path = require('path');
2+
const fs = require('fs');
23
const { app, BrowserWindow, screen, Menu } = require('electron')
34

45
Menu.setApplicationMenu(null)
56
if (process.argv.includes('--portable')) app.setPath('userData', path.join(__dirname, 'data'));
7+
if (!process.argv.includes('--vsync')) {
8+
app.commandLine.appendSwitch('disable-frame-rate-limit');
9+
app.commandLine.appendSwitch('disable-gpu-vsync');
10+
}
611

712
const createWindow = () => {
8-
const primaryDisplay = screen.getPrimaryDisplay()
9-
const { width, height } = primaryDisplay.workAreaSize
13+
const primaryDisplay = screen.getPrimaryDisplay();
14+
const { width, height } = primaryDisplay.workAreaSize;
1015

1116
const win = new BrowserWindow({
1217
width: Math.floor(width * 0.85),
@@ -17,12 +22,18 @@ const createWindow = () => {
1722
nodeIntegration: false,
1823
experimentalFeatures: true
1924
}
20-
})
25+
});
2126

2227
win.setMenuBarVisibility(false);
2328
win.setAutoHideMenuBar(true);
2429

25-
win.loadURL('https://webmc.xyz/?plaf=desktop');
30+
win.loadURL('https://app.webmc.xyz/?plaf=desktop');
31+
32+
win.webContents.on('did-finish-load', () => {
33+
const cssPath = path.join(__dirname, 'inject.css');
34+
const css = fs.readFileSync(cssPath, 'utf8');
35+
win.webContents.insertCSS(css).catch(err => console.error('CSS injection failed:', err));
36+
});
2637
}
2738

2839
app.whenReady().then(() => {

inject.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.settings .setting:nth-child(5),
2+
.settings .setting.popupTab {
3+
display: none !important;
4+
}

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "webmc",
3-
"version": "1.0.0",
3+
"version": "1.0.1",
44
"description": "",
55
"main": "index.js",
66
"scripts": {
@@ -9,7 +9,7 @@
99
"mac": "./build.sh --mac --arm64"
1010
},
1111
"build": {
12-
"appId": "dev.colbster937.webmcdesktop",
12+
"appId": "xyz.webmc.desktop",
1313
"productName": "WebMC",
1414
"artifactName": "${productName}-${version}-${arch}.${ext}",
1515
"icon": "build/icon",

0 commit comments

Comments
 (0)