diff options
author | Łukasz Mariański | 2022-08-08 06:11:18 +0200 |
---|---|---|
committer | Łukasz Mariański | 2022-08-08 06:12:14 +0200 |
commit | e285006defdae43108cae721632f36adf7c8cdc8 (patch) | |
tree | a929baed33aa9b3d5bf94ae8b8f5f503bf975173 /replugged-themes.patch | |
download | aur-e285006defdae43108cae721632f36adf7c8cdc8.tar.gz |
Initial commit, (mostly) copied over from powercord-electron-git
Diffstat (limited to 'replugged-themes.patch')
-rw-r--r-- | replugged-themes.patch | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/replugged-themes.patch b/replugged-themes.patch new file mode 100644 index 000000000000..35367d7867f0 --- /dev/null +++ b/replugged-themes.patch @@ -0,0 +1,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(); |