Compare commits
4 Commits
337a8af68f
...
a358ff08fa
Author | SHA1 | Date | |
---|---|---|---|
a358ff08fa | |||
5db981228e | |||
3247a3fcdf | |||
7b9a6d77ab |
10
app.js
10
app.js
@ -8,6 +8,7 @@ const fs = require('fs');
|
|||||||
const rpc = require('./discordPresence');
|
const rpc = require('./discordPresence');
|
||||||
const windowName = require('get-window-by-name');
|
const windowName = require('get-window-by-name');
|
||||||
const terminalUtil = require('./terminalUtil');
|
const terminalUtil = require('./terminalUtil');
|
||||||
|
const osUtil = require('./osUtil');
|
||||||
|
|
||||||
let tempOsuPath;
|
let tempOsuPath;
|
||||||
let osuWindowInfo;
|
let osuWindowInfo;
|
||||||
@ -126,6 +127,15 @@ const run = () => {
|
|||||||
await tryLogin(mainWindow);
|
await tryLogin(mainWindow);
|
||||||
await doUpdateCheck(mainWindow);
|
await doUpdateCheck(mainWindow);
|
||||||
if (platform === "linux") {
|
if (platform === "linux") {
|
||||||
|
const linuxDistroInfo = await osUtil.getLinuxDistroInfo();
|
||||||
|
if (linuxDistroInfo?.id != "arch") {
|
||||||
|
if (linuxDistroInfo?.id_like != "arch") {
|
||||||
|
mainWindow.webContents.send('status_update', {
|
||||||
|
type: "info",
|
||||||
|
message: "We detected that you are running the Launcher under Linux. It's currently just compatible with Arch like distributions!"
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
await terminalUtil.execCommand(`osu-stable -h`);
|
await terminalUtil.execCommand(`osu-stable -h`);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
@ -8,6 +8,10 @@
|
|||||||
font-family: 'Exo 2', 'Roboto' !important;
|
font-family: 'Exo 2', 'Roboto' !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
background-color: #24283B;
|
||||||
|
}
|
||||||
|
|
||||||
.sections {
|
.sections {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-flow: column;
|
flex-flow: column;
|
||||||
|
17
osUtil.js
Normal file
17
osUtil.js
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
const fs = require("fs");
|
||||||
|
|
||||||
|
const getLinuxDistroInfo = async() => {
|
||||||
|
let os = await fs.promises.readFile('/etc/os-release', 'utf8')
|
||||||
|
let opj = {}
|
||||||
|
|
||||||
|
os?.split('\n')?.forEach((line, index) => {
|
||||||
|
let words = line?.split('=')
|
||||||
|
let key = words[0]?.toLowerCase()
|
||||||
|
if (key === '') return
|
||||||
|
let value = words[1]?.replace(/"/g, '')
|
||||||
|
opj[key] = value
|
||||||
|
})
|
||||||
|
return opj;
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = { getLinuxDistroInfo };
|
@ -7,7 +7,7 @@ let loggedIn = false;
|
|||||||
|
|
||||||
window.addEventListener('DOMContentLoaded', () => {
|
window.addEventListener('DOMContentLoaded', () => {
|
||||||
titlebar = new Titlebar({
|
titlebar = new Titlebar({
|
||||||
backgroundColor: Color.fromHex("#303030"),
|
backgroundColor: Color.fromHex("#24283B"),
|
||||||
itemBackgroundColor: Color.fromHex("#121212"),
|
itemBackgroundColor: Color.fromHex("#121212"),
|
||||||
menu: null,
|
menu: null,
|
||||||
maximizable: false
|
maximizable: false
|
||||||
|
@ -12,7 +12,7 @@ module.exports = {
|
|||||||
minWidth: windowWidth / 1.25,
|
minWidth: windowWidth / 1.25,
|
||||||
frame: false,
|
frame: false,
|
||||||
titleBarStyle: 'hidden',
|
titleBarStyle: 'hidden',
|
||||||
backgroundColor: "#121212",
|
backgroundColor: "#24283B",
|
||||||
resizable: false,
|
resizable: false,
|
||||||
maximizable: false,
|
maximizable: false,
|
||||||
minimizable: true,
|
minimizable: true,
|
||||||
@ -34,9 +34,6 @@ module.exports = {
|
|||||||
|
|
||||||
window.webContents.setUserAgent(`${appInfo.appName} ${appInfo.appVersion}`);
|
window.webContents.setUserAgent(`${appInfo.appName} ${appInfo.appVersion}`);
|
||||||
attachTitlebarToWindow(window);
|
attachTitlebarToWindow(window);
|
||||||
// window.webContents.openDevTools({
|
|
||||||
// mode: "detach"
|
|
||||||
// });
|
|
||||||
|
|
||||||
return window;
|
return window;
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user