add acrylic-ness via library

acrylic
CanadaHonk 2 years ago
parent 78204759a3
commit 5cbe89cc22

@ -1,6 +1,8 @@
# OpenAsar
![Nightly Status](https://github.com/GooseMod/OpenAsar/actions/workflows/nightly.yml/badge.svg) [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://choosealicense.com/licenses/mit/l) ![GitHub Sponsors](https://img.shields.io/github/sponsors/CanadaHonk?label=Sponsors&logo=github)
### Acrylic fork (Windows only) - uses [`@pyke/vibe`](https://github.com/pykeio/vibe) under [Apache 2.0](https://github.com/pykeio/vibe/blob/main/LICENSE)
**An open-source alternative of Discord desktop's `app.asar`**
## Features

1
src/bootstrap.js vendored

@ -99,6 +99,7 @@ const startUpdate = () => {
splash.events.once('APP_SHOULD_LAUNCH', () => {
if (!process.env.OPENASAR_NOSTART) startCore();
// require('./config').open();
});
let done;

@ -4,6 +4,9 @@ global.log = (area, ...args) => console.log(`[\x1b[38;2;88;101;242mOpenAsar\x1b[
global.oaVersion = 'nightly';
global.vibe = require('./vibe.node');
vibe.setup(require('electron').app);
log('Init', 'OpenAsar', oaVersion);
if (process.resourcesPath.startsWith('/usr/lib/electron')) global.systemElectron = true; // Using system electron, flag for other places

@ -1,9 +1,11 @@
module.exports = (o, n) => {
const w = new (require('electron').BrowserWindow)({
// frame: false,
frame: false,
backgroundColor: '#00000000',
show: n === 'config',
menubar: false,
resizable: false,
center: true,
backgroundColor: '#2f3136',
webPreferences: {
preload: require('path').join(__dirname, '..', n, 'preload.js')
},
@ -19,5 +21,15 @@ module.exports = (o, n) => {
w.loadURL('https://cdn.openasar.dev/' + n + '?v=' + oaVersion);
w.webContents.insertCSS(`html, body { background: transparent !important; }`);
// w.loadURL('http://localhost:1337/' + n + '?v=' + oaVersion);
// require('electron').nativeTheme.themeSource = 'dark';
// vibe.applyEffect(w, 'acrylic');
// vibe.clearEffects(w);
vibe.applyEffect(w, 'acrylic');
// setTimeout(() => vibe.applyEffect(w, 'acrylic'), 3000);
return w;
};

Binary file not shown.
Loading…
Cancel
Save