Compare commits

...

4 Commits

5 changed files with 33 additions and 5 deletions

10
app.js
View File

@ -8,6 +8,7 @@ const fs = require('fs');
const rpc = require('./discordPresence');
const windowName = require('get-window-by-name');
const terminalUtil = require('./terminalUtil');
const osUtil = require('./osUtil');
let tempOsuPath;
let osuWindowInfo;
@ -126,6 +127,15 @@ const run = () => {
await tryLogin(mainWindow);
await doUpdateCheck(mainWindow);
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 {
await terminalUtil.execCommand(`osu-stable -h`);
} catch (err) {

View File

@ -8,6 +8,10 @@
font-family: 'Exo 2', 'Roboto' !important;
}
body {
background-color: #24283B;
}
.sections {
display: flex;
flex-flow: column;

17
osUtil.js Normal file
View 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 };

View File

@ -7,7 +7,7 @@ let loggedIn = false;
window.addEventListener('DOMContentLoaded', () => {
titlebar = new Titlebar({
backgroundColor: Color.fromHex("#303030"),
backgroundColor: Color.fromHex("#24283B"),
itemBackgroundColor: Color.fromHex("#121212"),
menu: null,
maximizable: false

View File

@ -12,7 +12,7 @@ module.exports = {
minWidth: windowWidth / 1.25,
frame: false,
titleBarStyle: 'hidden',
backgroundColor: "#121212",
backgroundColor: "#24283B",
resizable: false,
maximizable: false,
minimizable: true,
@ -34,9 +34,6 @@ module.exports = {
window.webContents.setUserAgent(`${appInfo.appName} ${appInfo.appVersion}`);
attachTitlebarToWindow(window);
// window.webContents.openDevTools({
// mode: "detach"
// });
return window;
},