summarylogtreecommitdiffstats
path: root/replugged-themes.patch
blob: 35367d7867f04bfbfded8e9ef6b8eb207295c34d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
diff --git a/src/Powercord/managers/styles.js b/src/Powercord/managers/styles.js
index e9475199..33119333 100644
--- a/src/Powercord/managers/styles.js
+++ b/src/Powercord/managers/styles.js
@@ -14,10 +14,12 @@ const ErrorTypes = Object.freeze({
   INVALID_MANIFEST: 'INVALID_MANIFEST'
 });
 
+const XDG_DATA_HOME = process.env.XDG_DATA_HOME || join(process.env.HOME, '.local', 'share');
+
 module.exports = class StyleManager {
   constructor () {
     this._coreStyles = [];
-    this.themesDir = join(__dirname, '../themes');
+    this.themesDir = join(XDG_DATA_HOME, 'replugged', 'themes');
     this.themes = new Map();
 
     if (!window.__SPLASH__) {
diff --git a/src/Powercord/plugins/pc-moduleManager/components/manage/Base.jsx b/src/Powercord/plugins/pc-moduleManager/components/manage/Base.jsx
index f5750344..3e69cf77 100644
--- a/src/Powercord/plugins/pc-moduleManager/components/manage/Base.jsx
+++ b/src/Powercord/plugins/pc-moduleManager/components/manage/Base.jsx
@@ -3,6 +3,7 @@ const { shell } = require('electron');
 const { React, getModule, contextMenu, i18n: { Messages } } = require('powercord/webpack');
 const { Button, Tooltip, ContextMenu, Divider, Icons: { Overflow } } = require('powercord/components');
 const { TextInput } = require('powercord/components/settings');
+const XDG_DATA_HOME = process.env.XDG_DATA_HOME || join(process.env.HOME, '.local', 'share');
 
 class Base extends React.Component {
   constructor () {
@@ -91,7 +92,7 @@ class Base extends React.Component {
           {
             type: 'button',
             name: Messages[`REPLUGGED_${this.state.key}_OPEN_FOLDER`],
-            onClick: () => shell.openPath(join(__dirname, '..', '..', '..', '..', this.constructor.name.toLowerCase()))
+            onClick: () => shell.openPath(join(XDG_DATA_HOME, 'replugged', this.constructor.name.toLowerCase()))
           },
           {
             type: 'button',
diff --git a/src/Powercord/plugins/pc-moduleManager/index.js b/src/Powercord/plugins/pc-moduleManager/index.js
index 1d0b483e..90c9790a 100644
--- a/src/Powercord/plugins/pc-moduleManager/index.js
+++ b/src/Powercord/plugins/pc-moduleManager/index.js
@@ -5,7 +5,7 @@ const { PopoutWindow } = require('powercord/components');
 const { inject, uninject } = require('powercord/injector');
 const { findInReactTree, forceUpdateElement } = require('powercord/util');
 const { Plugin } = require('powercord/entities');
-const { SpecialChannels: { CSS_SNIPPETS, STORE_PLUGINS, STORE_THEMES }, WEBSITE } = require('powercord/constants');
+const { SpecialChannels: { CSS_SNIPPETS, STORE_PLUGINS, STORE_THEMES }, WEBSITE, SETTINGS_FOLDER } = require('powercord/constants');
 const { join } = require('path');
 const commands = require('./commands');
 const deeplinks = require('./deeplinks');
@@ -65,7 +65,7 @@ module.exports = class ModuleManager extends Plugin {
     });
 
     this._quickCSS = '';
-    this._quickCSSFile = join(__dirname, 'quickcss.css');
+    this._quickCSSFile = join(SETTINGS_FOLDER, 'themes', 'quickcss.css');
     this._loadQuickCSS();
     this._injectSnippets();
     await this._installerInjectPopover();