-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 7f2c1c8
Showing
119 changed files
with
20,150 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
> 1% | ||
last 2 versions | ||
not dead |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
VUE_APP_API_ENDPOINT="http://localhost:2501/api/v1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
module.exports = { | ||
root: true, | ||
env: { | ||
node: true | ||
}, | ||
'extends': [ | ||
'plugin:vue/recommended', | ||
'eslint:recommended', | ||
], | ||
parserOptions: { | ||
ecmaVersion: 2020 | ||
}, | ||
rules: { | ||
// Environment | ||
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off', | ||
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off', | ||
// Variables | ||
'no-unused-vars': 'off', | ||
// Comments | ||
'spaced-comment': ['error', 'always'], | ||
'multiline-comment-style': ['error', 'starred-block'], | ||
'vue/html-comment-indent': ['error', 2], | ||
'vue/html-comment-content-spacing': ['error', 'always'], | ||
'vue/html-comment-content-newline': ['error', | ||
{ | ||
'singleline': 'never', | ||
'multiline': 'always', | ||
}, | ||
], | ||
// Indent | ||
'indent': ['error', 2], | ||
'vue/script-indent': ['error', 2, { | ||
baseIndent: 0 | ||
}], | ||
'vue/html-indent': ['error', 2, { | ||
attribute: 1, | ||
baseIndent: 1, | ||
closeBracket: 0, | ||
alignAttributesVertically: true, | ||
ignores: [] | ||
}], | ||
}, | ||
'overrides': [ | ||
// Disable JS indent on Vue files since it's handled by 'vue/script-indent' | ||
{ | ||
'files': ['*.vue'], | ||
'rules': { | ||
'indent': 'off' | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
.DS_Store | ||
node_modules | ||
/dist | ||
|
||
|
||
# Local env files | ||
.env.local | ||
.env.*.local | ||
|
||
# Log files | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
pnpm-debug.log* | ||
|
||
# Editor directories and files | ||
.idea | ||
.vscode | ||
*.suo | ||
*.ntvs* | ||
*.njsproj | ||
*.sln | ||
*.sw? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# Introduction | ||
**Discord Richer Presence** is an advanced tool built on top of Electron and Vue to customize the Discord Rich Presence status | ||
|
||
<br /> | ||
|
||
# Download | ||
You can download the Windows installer from the [official website](https://www.davg25.com/apps/discord-richer-presence/) or the [releases page](https://github.com/DavG25/discord-richer-presence/releases/) | ||
Support for Linux and Mac is not yet available | ||
|
||
If you want to build the application yourself from the source please check the [Source](#Source) section | ||
|
||
<br /> | ||
|
||
# Source | ||
Only follow this section if you want to debug and/or build the application from the source | ||
## Setup | ||
### Clone repo | ||
``` | ||
git clone https://github.com/DavG25/discord-richer-presence.git | ||
``` | ||
### Install dependencies | ||
``` | ||
npm install | ||
``` | ||
|
||
## Debug | ||
### Run all components | ||
``` | ||
npm run serve | ||
``` | ||
### or run individual components | ||
``` | ||
npm run vue | ||
``` | ||
``` | ||
npm run electron | ||
``` | ||
|
||
## Lint | ||
### Report errors | ||
``` | ||
npm run lint | ||
``` | ||
### Fix errors | ||
``` | ||
npm run fix | ||
``` | ||
|
||
## Build | ||
### Compile and minify | ||
``` | ||
npm run build | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
/** | ||
* Imports | ||
*/ | ||
const state = require(`${__dirname}/state`).index | ||
const window = require(`${__dirname}/window`) | ||
const settings = require(`${__dirname}/settings`) | ||
const userData = require(`${__dirname}/../userdata`) | ||
const { autoUpdater } = require('electron-updater') | ||
const log = require('electron-log') | ||
|
||
|
||
/** | ||
* Spawn electron | ||
*/ | ||
exports.spawn = function() { | ||
return new Promise((resolve, reject) => { | ||
/** | ||
* Instance lock | ||
*/ | ||
require('@electron/remote/main').initialize() | ||
state.app = require('electron').app | ||
state.instanceLock = state.app.requestSingleInstanceLock() | ||
|
||
if (!state.instanceLock) { | ||
state.app.quit() | ||
console.error("Electron instance is already running") | ||
process.exit(1) | ||
} else { | ||
state.app.on('second-instance', (event, commandLine, workingDirectory) => { | ||
// User tried to run a second instance, we should focus our window | ||
if (state.mainWindow) { | ||
state.mainWindow.show() | ||
} | ||
}) | ||
|
||
state.app.on('ready', async () => { | ||
// Check for updates every minute | ||
setInterval(() => { exports.update() }, 60000) | ||
exports.update() | ||
|
||
state.app.allowRendererProcessReuse = false | ||
await userData.checkFolder() | ||
await userData.checkFiles() | ||
settings.load().then(() => { | ||
window.createWindow() | ||
}) | ||
}) | ||
|
||
state.app.on('window-all-closed', () => { | ||
state.app.quit() | ||
}) | ||
|
||
state.app.on('activate', () => { | ||
if (state.mainWindow === null) { | ||
window.createWindow(state.mainWindow) | ||
} | ||
}) | ||
} | ||
|
||
resolve(true) | ||
}) | ||
} | ||
|
||
|
||
/** | ||
* Set the auto start status in Windows | ||
*/ | ||
exports.setAutoStart = function({enabled = false, hide = true} = {}) { | ||
if (process.env.NODE_ENV==='development') { | ||
// Autostart for development mode, run electron with project path | ||
const path = require('path') | ||
const devPath = path.resolve(`${__dirname}/../`) | ||
state.app.setLoginItemSettings({ | ||
openAtLogin: enabled, | ||
path: state.app.getPath("exe"), | ||
args: hide ? [`"${devPath}" --autorun --hidden`] : [`"${devPath}" --autorun`] | ||
}) | ||
} else { | ||
/* | ||
* Autostart for production mode, run bundled application directly | ||
* TODO: Run updater with --processStart parameter | ||
*/ | ||
state.app.setLoginItemSettings({ | ||
openAtLogin: enabled, | ||
path: state.app.getPath("exe"), | ||
args: hide ? [`--autorun --hidden`] : [`--autorun`] | ||
}) | ||
} | ||
|
||
} | ||
|
||
|
||
/** | ||
* Check for updates | ||
*/ | ||
exports.update = function() { | ||
if (process.env.NODE_ENV==='development') return | ||
autoUpdater.logger = log | ||
autoUpdater.logger.transports.file.level = 'info' | ||
autoUpdater.checkForUpdatesAndNotify() | ||
} | ||
|
||
exports.quitAndInstallUpdate = function({silent = true, runAfterInstall = true} = {}) { | ||
state.app.isQuiting = true | ||
autoUpdater.quitAndInstall(silent, runAfterInstall) | ||
} | ||
|
||
autoUpdater.on('update-downloaded', (ev, info) => { | ||
if (state.mainWindow && state.mainWindow.webContents) state.mainWindow.webContents.send('update-downloaded') | ||
}) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
<!DOCTYPE html> | ||
<!-- A simple HTML page that will be shown when the application is launched and loading --> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Loading</title> | ||
<style> | ||
html { | ||
height: 100%; | ||
width: 100%; | ||
margin: 0; | ||
user-select: none; | ||
-webkit-user-select: none; | ||
-webkit-app-region: drag; | ||
} | ||
body { | ||
font-family: Helvetica, sans-serif; | ||
background-color: black; | ||
color: white; | ||
} | ||
.center { | ||
width: 100%; | ||
height: 100%; | ||
top: 0; | ||
bottom: 0; | ||
left: 0; | ||
right: 0; | ||
margin: auto; | ||
margin-top: 15%; | ||
text-align: center; | ||
} | ||
.lds-hourglass { | ||
display: inline-block; | ||
width: 80px; | ||
height: 80px; | ||
} | ||
.lds-hourglass:after { | ||
content: " "; | ||
display: block; | ||
border-radius: 50%; | ||
width: 0; | ||
height: 0; | ||
margin: 8px; | ||
box-sizing: border-box; | ||
border: 32px solid #fff; | ||
border-color: #fff transparent #fff transparent; | ||
animation: lds-hourglass 1.2s infinite; | ||
} | ||
@keyframes lds-hourglass { | ||
0% { | ||
transform: rotate(0); | ||
animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19); | ||
} | ||
50% { | ||
transform: rotate(900deg); | ||
animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1); | ||
} | ||
100% { | ||
transform: rotate(1800deg); | ||
} | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div class="center"> | ||
<h1> Discord Richer Presence </h1> | ||
<div class="lds-hourglass"></div> | ||
<h2> Loading </h2> | ||
</div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/** | ||
* Preload imports | ||
*/ | ||
const remote = require('@electron/remote') // TODO: Remove remote and enable context isolation | ||
const { app, dialog } = remote | ||
const { ipcRenderer } = require('electron') | ||
const mainWindow = remote.require(`${__dirname}/state`).index.mainWindow | ||
const os = require('os') | ||
const fs = require('fs') | ||
const { extractIcon } = require('@bitdisaster/exe-icon-extractor') | ||
const settings = remote.require(`${__dirname}/settings`) | ||
const userDataPath = remote.require(`${__dirname}/../userdata`).getPath() | ||
const setAutoStart = remote.require(`${__dirname}/app`).setAutoStart | ||
const quitAndInstallUpdate = remote.require(`${__dirname}/app`).quitAndInstallUpdate | ||
|
||
/** | ||
* Add modules | ||
*/ | ||
window.electron = {} | ||
window.electron.app = app | ||
window.electron.dialog = dialog | ||
window.electron.ipcRenderer = ipcRenderer | ||
window.electron.mainWindow = mainWindow | ||
window.electron.os = os | ||
window.electron.fs = fs | ||
window.electron.extractIcon = extractIcon | ||
window.electron.settings = settings | ||
window.electron.userDataPath = userDataPath | ||
window.electron.setAutoStart = setAutoStart | ||
window.electron.quitAndInstallUpdate = quitAndInstallUpdate | ||
window.electron.__dirname = __dirname | ||
|
||
/** | ||
* Update status of all dymanic elements in the electron app | ||
*/ | ||
const setIcon = remote.require(`${__dirname}/window`).setIcon | ||
const setTray = remote.require(`${__dirname}/window`).setTray | ||
window.electron.setStatus = ({clientStatus = null, triggersStatus = null, profiles = null}) => { | ||
setIcon({clientStatus: clientStatus}) | ||
setTray({clientStatus: clientStatus, triggersStatus: triggersStatus, profiles: profiles, update: true}) | ||
} |
Oops, something went wrong.