summarylogtreecommitdiffstats
path: root/powercord-themes.patch
blob: 1a83b0d7fe4bfa92d3b43c93b599387fa2f597f5 (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
62
diff --git a/src/Powercord/managers/styles.js b/src/Powercord/managers/styles.js
index 65b97b7f..ab4ac64c 100644
--- a/src/Powercord/managers/styles.js
+++ b/src/Powercord/managers/styles.js
@@ -13,10 +13,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, 'powercord', '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 fd5134cf..c08c3820 100644
--- a/src/Powercord/plugins/pc-moduleManager/components/manage/Base.jsx
+++ b/src/Powercord/plugins/pc-moduleManager/components/manage/Base.jsx
@@ -4,6 +4,8 @@ const { React, getModule, contextMenu, i18n: { Messages } } = require('powercord
 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 () {
     super();
@@ -91,7 +93,7 @@ class Base extends React.Component {
           {
             type: 'button',
             name: Messages[`POWERCORD_${this.state.key}_OPEN_FOLDER`],
-            onClick: () => shell.openPath(join(__dirname, '..', '..', '..', '..', this.constructor.name.toLowerCase()))
+            onClick: () => shell.openPath(join(XDG_DATA_HOME, 'powercord', 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 0cd00cdd..63c31899 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 } = require('powercord/util');
 const { Plugin } = require('powercord/entities');
-const { SpecialChannels: { CSS_SNIPPETS } } = require('powercord/constants');
+const { SpecialChannels: { CSS_SNIPPETS }, SETTINGS_FOLDER } = require('powercord/constants');
 const { join } = require('path');
 
 const commands = require('./commands');
@@ -48,7 +48,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();
     this.loadStylesheet('scss/style.scss');