summarylogtreecommitdiffstats
path: root/powercord-themes.patch
blob: 20a3326f9c26d59328b7dd051290a4e506a048bb (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 1179d315..c9e59f7d 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, '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 67af7601..61675cf3 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[`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 e184cc40..4cc643f4 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 { get } = require('powercord/http');
 const commands = require('./commands');
@@ -51,7 +51,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();