Compare commits

...

10 Commits

Author SHA1 Message Date
poslop
7d153f28e0 update 2024-04-30 15:32:45 -05:00
poslop
a21e33aeb6 plugins 2023-03-24 21:55:03 -05:00
poslop
adfa36a4fd done 2023-03-24 15:23:01 -05:00
poslop
a3e93cd5a2 plugins 2023-02-13 13:15:13 -06:00
poslop
d038ef3742 update 2023-02-03 18:50:35 -06:00
poslop
a81ed41ae7 update 2022-11-04 11:13:13 -05:00
poslop
623a84748b discordplugins 2022-08-17 13:27:47 -05:00
poslop
19deaaff3f kdeglobals 2022-08-17 13:10:45 -05:00
poslop
d1932e2ef1 proffile 2022-08-17 12:51:11 -05:00
poslop
43fc0608d9 correctlinktofirefoxcolor 2022-08-17 12:33:22 -05:00
28 changed files with 23243 additions and 49 deletions

View File

@@ -0,0 +1,26 @@
{
"all": {
"changeLogs": {
"BDFDB": "3.5.9",
"CreationDate": "1.4.6",
"EditRoles": "1.1.7",
"ImageUtilities": "5.4.0",
"NotificationSounds": "3.9.2",
"PinDMs": "2.0.3",
"PluginRepo": "2.5.5"
},
"choices": {
"toastPosition": "right"
},
"general": {
"shareData": true,
"showToasts": true,
"showSupportBadges": true,
"useChromium": false
},
"hashes": {
"0BDFDB.data.json": "4476361c3ca209217e9e539dfb2af7b406e061d8",
"0BDFDB.raw.css": "8c083e2a87a82aded5f3b2e27fb8b2f816b5f74a"
}
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,199 @@
/**
* @name FreeEmojis
* @version 1.7
* @description Link emojis if you don't have nitro! Type them out or use the emoji picker!
* @author An0
* @source https://github.com/An00nymushun/DiscordFreeEmojis
* @updateUrl https://raw.githubusercontent.com/An00nymushun/DiscordFreeEmojis/main/DiscordFreeEmojis.plugin.js
*/
/*@cc_on
@if (@_jscript)
var shell = WScript.CreateObject("WScript.Shell");
var fs = new ActiveXObject("Scripting.FileSystemObject");
var pathPlugins = shell.ExpandEnvironmentStrings("%APPDATA%\\BetterDiscord\\plugins");
var pathSelf = WScript.ScriptFullName;
shell.Popup("It looks like you've mistakenly tried to run me directly. \\n(Don't do that!)", 0, "I'm a plugin for BetterDiscord", 0x30);
if (fs.GetParentFolderName(pathSelf) === fs.GetAbsolutePathName(pathPlugins)) {
shell.Popup("I'm in the correct folder already.", 0, "I'm already installed", 0x40);
} else if (!fs.FolderExists(pathPlugins)) {
shell.Popup("I can't find the BetterDiscord plugins folder.\\nAre you sure it's even installed?", 0, "Can't install myself", 0x10);
} else if (shell.Popup("Should I copy myself to BetterDiscord's plugins folder for you?", 0, "Do you need some help?", 0x34) === 6) {
fs.CopyFile(pathSelf, fs.BuildPath(pathPlugins, fs.GetFileName(pathSelf)), true);
// Show the user where to put plugins in the future
shell.Exec("explorer " + pathPlugins);
shell.Popup("I'm installed!", 0, "Successfully installed", 0x40);
}
WScript.Quit();
@else @*/
var FreeEmojis = (() => {
'use strict';
const BaseColor = "#0cf";
var Discord;
var Utils = {
Log: (message) => { console.log(`%c[FreeEmojis] %c${message}`, `color:${BaseColor};font-weight:bold`, "") },
Warn: (message) => { console.warn(`%c[FreeEmojis] %c${message}`, `color:${BaseColor};font-weight:bold`, "") },
Error: (message) => { console.error(`%c[FreeEmojis] %c${message}`, `color:${BaseColor};font-weight:bold`, "") },
Webpack: () => {
let webpackExports;
if(typeof BdApi !== "undefined" && BdApi?.findModuleByProps && BdApi?.findModule) {
return { findModule: BdApi.findModule, findModuleByUniqueProperties: (props) => BdApi.findModuleByProps.apply(null, props) };
}
else if(Discord.window.webpackChunkdiscord_app != null) {
Discord.window.webpackChunkdiscord_app.push([
['__extra_id__'],
{},
req => webpackExports = req
]);
}
else if(Discord.window.webpackJsonp != null) {
webpackExports = typeof(Discord.window.webpackJsonp) === 'function' ?
Discord.window.webpackJsonp(
[],
{ '__extra_id__': (module, _export_, req) => { _export_.default = req } },
[ '__extra_id__' ]
).default :
Discord.window.webpackJsonp.push([
[],
{ '__extra_id__': (_module_, exports, req) => { _module_.exports = req } },
[ [ '__extra_id__' ] ]
]);
}
else return null;
delete webpackExports.m['__extra_id__'];
delete webpackExports.c['__extra_id__'];
const findModule = (filter) => {
for(let i in webpackExports.c) {
if(webpackExports.c.hasOwnProperty(i)) {
let m = webpackExports.c[i].exports;
if(!m) continue;
if(m.__esModule && m.default) m = m.default;
if(filter(m)) return m;
}
}
return null;
};
const findModuleByUniqueProperties = (propNames) => findModule(module => propNames.every(prop => module[prop] !== undefined));
return { findModule, findModuleByUniqueProperties };
}
};
var Initialized = false;
var searchHook;
var parseHook;
var getEmojiUnavailableReasonHook;
function Init()
{
Discord = { window: (typeof(unsafeWindow) !== 'undefined') ? unsafeWindow : window };
const webpackUtil = Utils.Webpack();
if(webpackUtil == null) { Utils.Error("Webpack not found."); return 0; }
const { findModule, findModuleByUniqueProperties } = webpackUtil;
let emojisModule = findModuleByUniqueProperties([ 'getDisambiguatedEmojiContext', 'searchWithoutFetchingLatest' ]);
if(emojisModule == null) { Utils.Error("emojisModule not found."); return 0; }
let messageEmojiParserModule = findModuleByUniqueProperties([ 'parse', 'parsePreprocessor', 'unparse' ]);
if(messageEmojiParserModule == null) { Utils.Error("messageEmojiParserModule not found."); return 0; }
let emojiPermissionsModule = findModuleByUniqueProperties([ 'getEmojiUnavailableReason' ]);
if(emojiPermissionsModule == null) { Utils.Error("emojiPermissionsModule not found."); return 0; }
searchHook = Discord.original_searchWithoutFetchingLatest = emojisModule.searchWithoutFetchingLatest;
emojisModule.searchWithoutFetchingLatest = function() { return searchHook.apply(this, arguments); };
parseHook = Discord.original_parse = messageEmojiParserModule.parse;
messageEmojiParserModule.parse = function() { return parseHook.apply(this, arguments); };
getEmojiUnavailableReasonHook = Discord.original_getEmojiUnavailableReason = emojiPermissionsModule.getEmojiUnavailableReason;
emojiPermissionsModule.getEmojiUnavailableReason = function() { return getEmojiUnavailableReasonHook.apply(this, arguments); };
Utils.Log("initialized");
Initialized = true;
return 1;
}
function Start() {
if(!Initialized && Init() !== 1) return;
const { original_parse, original_getEmojiUnavailableReason } = Discord;
searchHook = function() {
let result = Discord.original_searchWithoutFetchingLatest.apply(this, arguments);
console.log({result, arguments})
result.unlocked.push(...result.locked);
result.locked = [];
return result;
}
function replaceEmoji(parseResult, emoji) {
parseResult.content = parseResult.content.replace(`<${emoji.animated ? "a" : ""}:${emoji.originalName || emoji.name}:${emoji.id}>`, emoji.url.split("?")[0] + "?size=48");
}
parseHook = function() {
let result = original_parse.apply(this, arguments);
if(result.invalidEmojis.length !== 0) {
for(let emoji of result.invalidEmojis) {
replaceEmoji(result, emoji);
}
result.invalidEmojis = [];
}
let validNonShortcutEmojis = result.validNonShortcutEmojis;
for (let i = 0; i < validNonShortcutEmojis.length; i++) {
const emoji = validNonShortcutEmojis[i];
if(!emoji.available) {
replaceEmoji(result, emoji);
validNonShortcutEmojis.splice(i, 1);
i--;
}
}
return result;
};
getEmojiUnavailableReasonHook = function() {
return null;
}
}
function Stop() {
if(!Initialized) return;
searchHook = Discord.original_searchWithoutFetchingLatest;
parseHook = Discord.original_parse;
getEmojiUnavailableReasonHook = Discord.original_getEmojiUnavailableReason;
}
return function() { return {
getName: () => "DiscordFreeEmojis",
getShortName: () => "FreeEmojis",
getDescription: () => "Link emojis if you don't have nitro! Type them out or use the emoji picker!",
getVersion: () => "1.7",
getAuthor: () => "An0",
start: Start,
stop: Stop
}};
})();
module.exports = FreeEmojis;
/*@end @*/

View File

@@ -0,0 +1,699 @@
/**
* @name EditRoles
* @author DevilBro
* @authorId 278543574059057154
* @version 1.1.7
* @description Allows you to locally edit Roles
* @invite Jx3TjNS
* @donate https://www.paypal.me/MircoWittrien
* @patreon https://www.patreon.com/MircoWittrien
* @website https://mwittrien.github.io/
* @source https://github.com/mwittrien/BetterDiscordAddons/tree/master/Plugins/EditRoles/
* @updateUrl https://mwittrien.github.io/BetterDiscordAddons/Plugins/EditRoles/EditRoles.plugin.js
*/
module.exports = (_ => {
const changeLog = {
};
return !window.BDFDB_Global || (!window.BDFDB_Global.loaded && !window.BDFDB_Global.started) ? class {
constructor (meta) {for (let key in meta) this[key] = meta[key];}
getName () {return this.name;}
getAuthor () {return this.author;}
getVersion () {return this.version;}
getDescription () {return `The Library Plugin needed for ${this.name} is missing. Open the Plugin Settings to download it. \n\n${this.description}`;}
downloadLibrary () {
require("request").get("https://mwittrien.github.io/BetterDiscordAddons/Library/0BDFDB.plugin.js", (e, r, b) => {
if (!e && b && r.statusCode == 200) require("fs").writeFile(require("path").join(BdApi.Plugins.folder, "0BDFDB.plugin.js"), b, _ => BdApi.showToast("Finished downloading BDFDB Library", {type: "success"}));
else BdApi.alert("Error", "Could not download BDFDB Library Plugin. Try again later or download it manually from GitHub: https://mwittrien.github.io/downloader/?library");
});
}
load () {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
BdApi.showConfirmationModal("Library Missing", `The Library Plugin needed for ${this.name} is missing. Please click "Download Now" to install it.`, {
confirmText: "Download Now",
cancelText: "Cancel",
onCancel: _ => {delete window.BDFDB_Global.downloadModal;},
onConfirm: _ => {
delete window.BDFDB_Global.downloadModal;
this.downloadLibrary();
}
});
}
if (!window.BDFDB_Global.pluginQueue.includes(this.name)) window.BDFDB_Global.pluginQueue.push(this.name);
}
start () {this.load();}
stop () {}
getSettingsPanel () {
let template = document.createElement("template");
template.innerHTML = `<div style="color: var(--header-primary); font-size: 16px; font-weight: 300; white-space: pre; line-height: 22px;">The Library Plugin needed for ${this.name} is missing.\nPlease click <a style="font-weight: 500;">Download Now</a> to install it.</div>`;
template.content.firstElementChild.querySelector("a").addEventListener("click", this.downloadLibrary);
return template.content.firstElementChild;
}
} : (([Plugin, BDFDB]) => {
var changedRoles = {}, cachedRoles = {};
return class EditRoles extends Plugin {
onLoad () {
this.modulePatches = {
before: [
"AutocompleteRoleResult",
"ChannelMembers",
"MemberListItem",
"MessageContent",
"UserPopoutBody"
],
after: [
"RichRoleMention"
]
};
}
onStart () {
BDFDB.PatchUtils.patch(this, BDFDB.LibraryModules.PermissionRoleUtils, "getHighestRole", {after: e => {
if (e.returnValue && changedRoles[e.returnValue.id]) {
let data = changedRoles[e.returnValue.id];
e.returnValue = Object.assign({}, e.returnValue, {
name: data.name || e.returnValue.name,
color: data.color ? BDFDB.ColorUtils.convert(data.color, "INT") : e.returnValue.color,
colorString: data.color ? BDFDB.ColorUtils.convert(data.color, "HEX") : e.returnValue.colorString
});
}
}});
BDFDB.PatchUtils.patch(this, BDFDB.LibraryStores.GuildMemberStore, "getMember", {after: e => {
if (e.returnValue) {
let guild = BDFDB.LibraryStores.GuildStore.getGuild(e.methodArguments[0]);
if (guild) {
let colorRole, iconRole;
for (let id of e.returnValue.roles) {
if (guild.roles[id] && (guild.roles[id].colorString || changedRoles[id] && changedRoles[id].color) && (!colorRole || colorRole.position < guild.roles[id].position)) colorRole = guild.roles[id];
if (guild.roles[id] && (guild.roles[id].icon || changedRoles[id] && changedRoles[id].icon) && (!iconRole || iconRole.position < guild.roles[id].position)) iconRole = guild.roles[id];
}
let color = colorRole && changedRoles[colorRole.id] && changedRoles[colorRole.id].color;
if (color) e.returnValue = Object.assign({}, e.returnValue, {colorString: BDFDB.ColorUtils.convert(color, "HEX")});
if (iconRole && changedRoles[iconRole.id] && changedRoles[iconRole.id].icon) e.returnValue = Object.assign({}, e.returnValue, {iconRoleId: iconRole.id});
}
}
}});
BDFDB.PatchUtils.patch(this, BDFDB.LibraryModules.RoleIconUtils, "getRoleIconData", {after: e => {
if (e.returnValue && e.methodArguments[0].id && changedRoles[e.methodArguments[0].id]) {
if (changedRoles[e.methodArguments[0].id].icon) return {customIconSrc: changedRoles[e.methodArguments[0].id].icon};
else if (changedRoles[e.methodArguments[0].id].removeIcon) return {customIconSrc: null};
}
}});
BDFDB.PatchUtils.patch(this, BDFDB.LibraryModules.RoleIconUtils, "canGuildUseRoleIcons", {after: e => {
if (e.returnValue === false && Object.keys(e.methodArguments[0].roles).some(roleId => changedRoles[roleId] && changedRoles[roleId].icon)) return true;
}});
this.forceUpdateAll();
}
onStop () {
this.forceUpdateAll();
}
getSettingsPanel (collapseStates = {}) {
let settingsPanel;
return settingsPanel = BDFDB.PluginUtils.createSettingsPanel(this, {
collapseStates: collapseStates,
children: _ => {
let settingsItems = [];
settingsItems.push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SettingsItem, {
type: "Button",
color: BDFDB.LibraryComponents.Button.Colors.RED,
label: "Reset all Roles",
onClick: _ => {
BDFDB.ModalUtils.confirm(this, this.labels.confirm_resetall, _ => {
this.resetRoles();
this.forceUpdateAll();
});
},
children: BDFDB.LanguageUtils.LanguageStrings.RESET
}));
return settingsItems.flat(10);
}
});
}
onSettingsClosed () {
if (this.SettingsUpdated) {
delete this.SettingsUpdated;
this.forceUpdateAll();
}
}
forceUpdateAll () {
changedRoles = BDFDB.DataUtils.load(this, "roles");
BDFDB.PatchUtils.forceAllUpdates(this);
BDFDB.MessageUtils.rerenderAll();
}
onUserContextMenu (e) {
let [children, index] = BDFDB.ContextMenuUtils.findItem(e.returnvalue, {id: "roles"});
if (index > -1 && children[index].props && BDFDB.ArrayUtils.is(children[index].props.children)) for (let child of children[index].props.children) {
if (child && child.props && typeof child.props.label == "function" && changedRoles[child.props.id]) {
let data = changedRoles[child.props.id];
let renderLabel = child.props.label;
child.props.label = BDFDB.TimeUtils.suppress((...args) => {
let label = renderLabel(...args);
if (data.color && label.props.children[0] && label.props.children[0].props) label.props.children[0].props.color = BDFDB.ColorUtils.convert(data.color, "hex");
if (data.name && label.props.children[1] && label.props.children[1].props && label.props.children[1].props.children) label.props.children[1].props.children = data.name;
return label;
}, "Error in renderLabel of UserRolesItems", this);
}
}
}
onGuildContextMenu (e) {
if (e.instance.props.guild) e.instance.props.guild = this.changeRolesInGuild(e.instance.props.guild);
}
onDeveloperContextMenu (e) {
if (e.instance.props.label != BDFDB.LanguageUtils.LanguageStrings.COPY_ID_ROLE) return;
let guild = this.getGuildFromRoleId(e.instance.props.id);
if (guild) e.returnvalue.props.children = [
BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuGroup, {
children: BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuItem, {
label: this.labels.context_localrolesettings,
id: BDFDB.ContextMenuUtils.createItemId(this.name, "settings-submenu"),
children: BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuGroup, {
children: [
BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuItem, {
label: this.labels.submenu_rolesettings,
id: BDFDB.ContextMenuUtils.createItemId(this.name, "settings-change"),
action: _ => {
this.openRoleSettingsModal(guild.roles[e.instance.props.id]);
}
}),
BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuItem, {
label: this.labels.submenu_resetsettings,
id: BDFDB.ContextMenuUtils.createItemId(this.name, "settings-reset"),
color: BDFDB.DiscordConstants.MenuItemColors.DANGER,
disabled: !changedRoles[e.instance.props.id],
action: event => {
let remove = _ => {
this.resetRoles(e.instance.props.id);
this.forceUpdateAll(true);
};
if (event.shiftKey) remove();
else BDFDB.ModalUtils.confirm(this, this.labels.confirm_reset, remove);
}
})
]
})
})
}),
e.returnvalue.props.children
].flat(10).filter(n => n);
}
processMessageContent (e) {
if (!BDFDB.ArrayUtils.is(e.instance.props.content)) return;
for (let ele of e.instance.props.content) if (BDFDB.ReactUtils.isValidElement(ele) && ele.props && ele.props.type == "mention" && ele.props.roleId && changedRoles[ele.props.roleId]) {
ele.props.roleColor = changedRoles[ele.props.roleId].color ? BDFDB.ColorUtils.convert(changedRoles[ele.props.roleId].color, "int") : ele.props.roleColor;
if (changedRoles[ele.props.roleId].name) ele.props.children = ["@" + changedRoles[ele.props.roleId].name];
}
}
processRichRoleMention (e) {
if (!e.instance.props.id || !changedRoles[e.instance.props.id]) return;
e.returnvalue.props.color = changedRoles[e.instance.props.id].color ? BDFDB.ColorUtils.convert(changedRoles[e.instance.props.id].color, "int") : e.returnvalue.props.color;
e.returnvalue.props.children[2] = changedRoles[e.instance.props.id].name || e.returnvalue.props.children[1];
}
processAutocompleteRoleResult (e) {
if (!e.instance.props.role || !changedRoles[e.instance.props.role.id]) return;
e.instance.props.role = Object.assign({}, e.instance.props.role);
e.instance.props.role.color = changedRoles[e.instance.props.role.id].color ? BDFDB.ColorUtils.convert(changedRoles[e.instance.props.role.id].color, "int") : e.instance.props.role.color;
e.instance.props.role.colorString = changedRoles[e.instance.props.role.id].color ? BDFDB.ColorUtils.convert(changedRoles[e.instance.props.role.id].color, "hex") : e.instance.props.role.colorString;
e.instance.props.role.name = changedRoles[e.instance.props.role.id].name || e.instance.props.role.name;
}
processChannelMembers (e) {
e.instance.props.groups = [].concat(e.instance.props.groups);
for (let i in e.instance.props.groups) if (e.instance.props.groups[i].type == "GROUP") {
let data = changedRoles[e.instance.props.groups[i].id];
if (data && data.name) e.instance.props.groups[i] = Object.assign({}, e.instance.props.groups[i], {title: data.name});
}
e.instance.props.rows = [].concat(e.instance.props.rows);
for (let i in e.instance.props.rows) if (e.instance.props.rows[i].type == "GROUP") {
let data = changedRoles[e.instance.props.rows[i].id];
if (data && data.name) e.instance.props.rows[i] = Object.assign({}, e.instance.props.rows[i], {title: data.name});
}
}
processMemberListItem (e) {
if (!e.instance.props.user) return;
let member = BDFDB.LibraryStores.GuildMemberStore.getMember(e.instance.props.guildId, e.instance.props.user.id);
if (member) e.instance.props.colorString = member.colorString;
}
processUserPopoutBody (e) {
if (e.instance.props.guild) e.instance.props.guild = this.changeRolesInGuild(e.instance.props.guild);
}
getGuildFromRoleId (roleId) {
return BDFDB.LibraryStores.SortedGuildStore.getFlattenedGuildIds().map(BDFDB.LibraryStores.GuildStore.getGuild).find(g => g.roles[roleId]);
}
changeRolesInGuild (guild, useNative) {
let changed = false, roles = Object.assign({}, guild.roles);
for (let id in guild.roles) {
let data = changedRoles[id];
if (data) {
changed = true;
roles[id] = Object.assign({}, roles[id], {
name: data.name || roles[id].name,
icon: data.icon || roles[id].icon,
color: data.color ? BDFDB.ColorUtils.convert(data.color, "INT") : roles[id].color,
colorString: data.color ? BDFDB.ColorUtils.convert(data.color, "HEX") : roles[id].colorString
});
}
}
if (useNative && changed && !cachedRoles[guild.id]) cachedRoles[guild.id] = guild.roles;
if (useNative) guild.roles = roles;
return !changed || useNative ? guild : (new BDFDB.DiscordObjects.Guild(Object.assign({}, guild, {roles})));
}
resetRoles (id) {
if (id) {
let guild = this.getGuildFromRoleId(id);
if (guild && cachedRoles[guild.id]) guild.roles = Object.assign({}, guild.roles, {[id]: cachedRoles[guild.id][id]});
BDFDB.DataUtils.remove(this, "roles", id);
}
else {
for (let guild of BDFDB.LibraryStores.SortedGuildStore.getFlattenedGuildIds().map(BDFDB.LibraryStores.GuildStore.getGuild)) if (cachedRoles[guild.id]) guild.roles = cachedRoles[guild.id];
cachedRoles = {};
BDFDB.DataUtils.remove(this, "roles");
}
}
openRoleSettingsModal (role) {
let data = changedRoles[role.id] || {};
let newData = Object.assign({}, data);
let iconInput;
BDFDB.ModalUtils.open(this, {
size: "MEDIUM",
header: this.labels.modal_header,
subHeader: role.name,
children: [
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.FormComponents.FormItem, {
title: BDFDB.LanguageUtils.LanguageStrings.FORM_LABEL_ROLE_NAME,
className: BDFDB.disCN.marginbottom20,
children: [
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.TextInput, {
value: data.name,
placeholder: role.name,
autoFocus: true,
onChange: value => newData.name = value
}),
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.FormComponents.FormDivider, {
className: BDFDB.disCN.dividerdefault
})
]
}),
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.FormComponents.FormItem, {
title: BDFDB.LanguageUtils.LanguageStrings.FORM_LABEL_ROLE_COLOR,
className: BDFDB.disCN.marginbottom20,
children: [
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ColorSwatches, {
color: data.color,
defaultCustomColor: role.colorString,
pickerConfig: {
alpha: false,
gradient: false
},
onColorChange: value => newData.color = value
})
]
}),
BDFDB.ReactUtils.createElement("div", {
className: BDFDB.disCN.marginbottom20,
children: [
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.FormComponents.FormDivider, {
className: BDFDB.disCNS.dividerdefault + BDFDB.disCN.marginbottom20
}),
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Flex, {
className: BDFDB.disCN.marginbottom8,
align: BDFDB.LibraryComponents.Flex.Align.CENTER,
direction: BDFDB.LibraryComponents.Flex.Direction.HORIZONTAL,
children: [
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.FormComponents.FormTitle, {
className: BDFDB.disCN.marginreset,
tag: BDFDB.LibraryComponents.FormComponents.FormTags.H5,
children: BDFDB.LanguageUtils.LanguageStrings.FORM_LABEL_ROLE_ICON
}),
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SettingsItem, {
type: "Switch",
margin: 0,
grow: 0,
label: BDFDB.LanguageUtils.LanguageStrings.REMOVE,
tag: BDFDB.LibraryComponents.FormComponents.FormTags.H5,
value: data.removeIcon,
onChange: value => {
newData.removeIcon = value;
if (value) {
delete iconInput.props.success;
delete iconInput.props.errorMessage;
iconInput.props.disabled = true;
BDFDB.ReactUtils.forceUpdate(iconInput);
}
else {
iconInput.props.disabled = false;
this.checkUrl(iconInput.props.value, iconInput).then(returnValue => newData.icon = returnValue);
}
}
})
]
}),
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.TextInput, {
success: !data.removeIcon && data.icon,
maxLength: 100000000000000000000,
value: data.icon,
placeholder: role.icon,
disabled: data.removeIcon,
ref: instance => {if (instance) iconInput = instance;},
onChange: (value, instance) => {
this.checkUrl(value, instance).then(returnValue => newData.icon = returnValue);
}
})
]
})
],
buttons: [{
contents: BDFDB.LanguageUtils.LanguageStrings.SAVE,
color: "BRAND",
close: true,
onClick: _ => {
let changed = false;
if (Object.keys(newData).every(key => newData[key] == null || newData[key] == false) && (changed = true)) {
this.resetRoles(role.id);
}
else if (!BDFDB.equals(newData, data) && (changed = true)) {
BDFDB.DataUtils.save(newData, this, "roles", role.id);
}
if (changed) this.forceUpdateAll();
}
}]
});
}
checkUrl (url, instance) {
return new Promise(callback => {
BDFDB.TimeUtils.clear(instance.checkTimeout);
url = url && url.trim();
if (!url || instance.props.disabled) {
delete instance.props.success;
delete instance.props.errorMessage;
callback("");
BDFDB.ReactUtils.forceUpdate(instance);
}
else if (url.indexOf("data:") == 0) {
instance.props.success = true;
delete instance.props.errorMessage;
callback(url);
}
else instance.checkTimeout = BDFDB.TimeUtils.timeout(_ => {
BDFDB.LibraryRequires.request(url, {agentOptions: {rejectUnauthorized: false}}, (error, response, result) => {
delete instance.checkTimeout;
if (instance.props.disabled) {
delete instance.props.success;
delete instance.props.errorMessage;
callback("");
}
else if (response && response.headers["content-type"] && response.headers["content-type"].indexOf("image") != -1) {
instance.props.success = true;
delete instance.props.errorMessage;
callback(url);
}
else {
delete instance.props.success;
instance.props.errorMessage = this.labels.modal_invalidurl;
callback("");
}
BDFDB.ReactUtils.forceUpdate(instance);
});
}, 1000);
});
}
setLabelsByLanguage () {
switch (BDFDB.LanguageUtils.getLanguage().id) {
case "bg": // Bulgarian
return {
confirm_reset: "Наистина ли искате да нулирате тази роля?",
confirm_resetall: "Наистина ли искате да нулирате всички роли?",
context_localrolesettings: "Настройки на местната роля",
modal_header: "Настройки на местната роля",
submenu_resetsettings: "Нулиране на ролята",
submenu_rolesettings: "Промяна на настройките"
};
case "da": // Danish
return {
confirm_reset: "Er du sikker på, at du vil nulstille denne rolle?",
confirm_resetall: "Er du sikker på, at du vil nulstille alle roller?",
context_localrolesettings: "Lokale rolleindstillinger",
modal_header: "Lokale rolleindstillinger",
submenu_resetsettings: "Nulstil rolle",
submenu_rolesettings: "Ændre indstillinger"
};
case "de": // German
return {
confirm_reset: "Möchtest du diese Rolle wirklich zurücksetzen?",
confirm_resetall: "Möchtest du wirklich alle Rollen zurücksetzen?",
context_localrolesettings: "Lokale Rolleneinstellungen",
modal_header: "Lokale Rolleneinstellungen",
submenu_resetsettings: "Rolle zurücksetzen",
submenu_rolesettings: "Einstellungen ändern"
};
case "el": // Greek
return {
confirm_reset: "Είστε βέβαιοι ότι θέλετε να επαναφέρετε αυτόν τον ρόλο;",
confirm_resetall: "Είστε βέβαιοι ότι θέλετε να επαναφέρετε όλους τους ρόλους;",
context_localrolesettings: "Ρυθμίσεις ρόλου {τοπικά)",
modal_header: "Ρυθμίσεις ρόλου (τοπικά)",
submenu_resetsettings: "Επαναφορά ρόλου",
submenu_rolesettings: "Αλλαγή ρυθμίσεων"
};
case "es": // Spanish
return {
confirm_reset: "¿Está seguro de que desea restablecer este rol?",
confirm_resetall: "¿Está seguro de que desea restablecer todos los roles?",
context_localrolesettings: "Configuración de roles locales",
modal_header: "Configuración de roles locales",
submenu_resetsettings: "Restablecer rol",
submenu_rolesettings: "Cambiar ajustes"
};
case "fi": // Finnish
return {
confirm_reset: "Haluatko varmasti nollata tämän roolin?",
confirm_resetall: "Haluatko varmasti nollata kaikki roolit?",
context_localrolesettings: "Paikalliset rooliasetukset",
modal_header: "Paikalliset rooliasetukset",
submenu_resetsettings: "Nollaa rooli",
submenu_rolesettings: "Vaihda asetuksia"
};
case "fr": // French
return {
confirm_reset: "Voulez-vous vraiment réinitialiser ce rôle?",
confirm_resetall: "Voulez-vous vraiment réinitialiser tous les rôles?",
context_localrolesettings: "Paramètres de rôle locaux",
modal_header: "Paramètres de rôle locaux",
submenu_resetsettings: "Réinitialiser le rôle",
submenu_rolesettings: "Modifier les paramètres"
};
case "hr": // Croatian
return {
confirm_reset: "Jeste li sigurni da želite resetirati ovu ulogu?",
confirm_resetall: "Jeste li sigurni da želite resetirati sve uloge?",
context_localrolesettings: "Postavke lokalne uloge",
modal_header: "Postavke lokalne uloge",
submenu_resetsettings: "Resetiraj ulogu",
submenu_rolesettings: "Promijeniti postavke"
};
case "hu": // Hungarian
return {
confirm_reset: "Biztosan vissza akarja állítani ezt a szerepet?",
confirm_resetall: "Biztosan vissza akarja állítani az összes szerepet?",
context_localrolesettings: "Helyi szerepbeállítások",
modal_header: "Helyi szerepbeállítások",
submenu_resetsettings: "A szerepkör visszaállítása",
submenu_rolesettings: "Beállítások megváltoztatása"
};
case "it": // Italian
return {
confirm_reset: "Sei sicuro di voler reimpostare questo ruolo?",
confirm_resetall: "Sei sicuro di voler reimpostare tutti i ruoli?",
context_localrolesettings: "Impostazioni ruolo locale",
modal_header: "Impostazioni ruolo locale",
submenu_resetsettings: "Reimposta ruolo",
submenu_rolesettings: "Cambia impostazioni"
};
case "ja": // Japanese
return {
confirm_reset: "この役割をリセットしてもよろしいですか?",
confirm_resetall: "すべての役割をリセットしてもよろしいですか?",
context_localrolesettings: "ローカルロール設定",
modal_header: "ローカルロール設定",
submenu_resetsettings: "役割をリセット",
submenu_rolesettings: "設定を変更する"
};
case "ko": // Korean
return {
confirm_reset: "이 역할을 재설정 하시겠습니까?",
confirm_resetall: "모든 역할을 재설정 하시겠습니까?",
context_localrolesettings: "로컬 역할 설정",
modal_header: "로컬 역할 설정",
submenu_resetsettings: "역할 재설정",
submenu_rolesettings: "설정 변경"
};
case "lt": // Lithuanian
return {
confirm_reset: "Ar tikrai norite iš naujo nustatyti šį vaidmenį?",
confirm_resetall: "Ar tikrai norite iš naujo nustatyti visus vaidmenis?",
context_localrolesettings: "Vietos vaidmens nustatymai",
modal_header: "Vietos vaidmens nustatymai",
submenu_resetsettings: "Iš naujo nustatyti vaidmenį",
submenu_rolesettings: "Pakeisti nustatymus"
};
case "nl": // Dutch
return {
confirm_reset: "Weet u zeker dat u deze rol wilt resetten?",
confirm_resetall: "Weet u zeker dat u alle rollen opnieuw wilt instellen?",
context_localrolesettings: "Lokale rolinstellingen",
modal_header: "Lokale rolinstellingen",
submenu_resetsettings: "Rol opnieuw instellen",
submenu_rolesettings: "Instellingen veranderen"
};
case "no": // Norwegian
return {
confirm_reset: "Er du sikker på at du vil tilbakestille denne rollen?",
confirm_resetall: "Er du sikker på at du vil tilbakestille alle rollene?",
context_localrolesettings: "Lokale rolleinnstillinger",
modal_header: "Lokale rolleinnstillinger",
submenu_resetsettings: "Tilbakestill rolle",
submenu_rolesettings: "Endre innstillinger"
};
case "pl": // Polish
return {
confirm_reset: "Czy na pewno chcesz zresetować tę rolę?",
confirm_resetall: "Czy na pewno chcesz zresetować wszystkie role?",
context_localrolesettings: "Ustawienia roli lokalnej",
modal_header: "Ustawienia roli lokalnej",
submenu_resetsettings: "Zresetuj rolę",
submenu_rolesettings: "Zmień ustawienia"
};
case "pt-BR": // Portuguese (Brazil)
return {
confirm_reset: "Tem certeza de que deseja redefinir esta função?",
confirm_resetall: "Tem certeza de que deseja redefinir todas as funções?",
context_localrolesettings: "Configurações de função local",
modal_header: "Configurações de função local",
submenu_resetsettings: "Redefinir função",
submenu_rolesettings: "Mudar configurações"
};
case "ro": // Romanian
return {
confirm_reset: "Sigur doriți să resetați acest rol?",
confirm_resetall: "Sigur doriți să resetați toate rolurile?",
context_localrolesettings: "Setări rol local",
modal_header: "Setări rol local",
submenu_resetsettings: "Resetați rolul",
submenu_rolesettings: "Schimbă setările"
};
case "ru": // Russian
return {
confirm_reset: "Вы уверены, что хотите сбросить эту роль?",
confirm_resetall: "Вы уверены, что хотите сбросить все роли?",
context_localrolesettings: "Настройки локальной роли",
modal_header: "Настройки локальной роли",
submenu_resetsettings: "Сбросить роль",
submenu_rolesettings: "Изменить настройки"
};
case "sv": // Swedish
return {
confirm_reset: "Är du säker på att du vill återställa denna roll?",
confirm_resetall: "Är du säker på att du vill återställa alla roller?",
context_localrolesettings: "Lokala rollinställningar",
modal_header: "Lokala rollinställningar",
submenu_resetsettings: "Återställ roll",
submenu_rolesettings: "Ändra inställningar"
};
case "th": // Thai
return {
confirm_reset: "แน่ใจไหมว่าต้องการรีเซ็ตบทบาทนี้",
confirm_resetall: "แน่ใจไหมว่าต้องการรีเซ็ตบทบาททั้งหมด",
context_localrolesettings: "การตั้งค่าบทบาทท้องถิ่น",
modal_header: "การตั้งค่าบทบาทท้องถิ่น",
submenu_resetsettings: "รีเซ็ตบทบาท",
submenu_rolesettings: "เปลี่ยนการตั้งค่า"
};
case "tr": // Turkish
return {
confirm_reset: "Bu Rolü sıfırlamak istediğinizden emin misiniz?",
confirm_resetall: "Tüm Rolleri sıfırlamak istediğinizden emin misiniz?",
context_localrolesettings: "Yerel Rol Ayarları",
modal_header: "Yerel Rol Ayarları",
submenu_resetsettings: "Rolü Sıfırla",
submenu_rolesettings: "Ayarları değiştir"
};
case "uk": // Ukrainian
return {
confirm_reset: "Ви впевнені, що хочете скинути цю роль?",
confirm_resetall: "Ви впевнені, що хочете скинути всі ролі?",
context_localrolesettings: "Налаштування локальної ролі",
modal_header: "Налаштування локальної ролі",
submenu_resetsettings: "Скинути роль",
submenu_rolesettings: "Змінити налаштування"
};
case "vi": // Vietnamese
return {
confirm_reset: "Bạn có chắc chắn muốn đặt lại Vai trò này không?",
confirm_resetall: "Bạn có chắc chắn muốn đặt lại tất cả các Vai trò không?",
context_localrolesettings: "Cài đặt vai trò cục bộ",
modal_header: "Cài đặt vai trò cục bộ",
submenu_resetsettings: "Đặt lại vai trò",
submenu_rolesettings: "Thay đổi cài đặt"
};
case "zh-CN": // Chinese (China)
return {
confirm_reset: "您确定要重置此角色吗?",
confirm_resetall: "您确定要重置所有角色吗?",
context_localrolesettings: "本地角色设置",
modal_header: "本地角色设置",
submenu_resetsettings: "重置角色",
submenu_rolesettings: "更改设置"
};
case "zh-TW": // Chinese (Taiwan)
return {
confirm_reset: "您確定要重置此角色嗎?",
confirm_resetall: "您確定要重置所有角色嗎?",
context_localrolesettings: "本地角色設置",
modal_header: "本地角色設置",
submenu_resetsettings: "重置角色",
submenu_rolesettings: "更改設置"
};
default: // English
return {
confirm_reset: "Are you sure you want to reset this Role?",
confirm_resetall: "Are you sure you want to reset all Roles?",
context_localrolesettings: "Local Role Settings",
modal_header: "Local Role Settings",
submenu_resetsettings: "Reset Role",
submenu_rolesettings: "Change Settings"
};
}
}
};
})(window.BDFDB_Global.PluginUtils.buildPlugin(changeLog));
})();

View File

@@ -0,0 +1,82 @@
{
"all": {
"amounts": {
"hoverDelay": 0
},
"detailsSettings": {
"footnote": true,
"tooltip": false,
"tooltipDelay": 0
},
"engines": {
"_all": true,
"Baidu": true,
"Bing": true,
"Google": true,
"GoogleLens": true,
"ImgOps": true,
"IQDB": true,
"Reddit": true,
"SauceNAO": true,
"Sogou": true,
"TinEye": true,
"WhatAnime": true,
"Yandex": true
},
"galleryFilter": {
"3gp": true,
"avi": true,
"flv": true,
"jpeg": true,
"jpg": true,
"gif": true,
"mov": true,
"mp4": true,
"mpeg-1": true,
"mpeg-2": true,
"ogg": true,
"png": true,
"svg": true,
"webm": true,
"webp": true,
"wmv": true
},
"general": {
"nsfwMode": true
},
"places": {
"userAvatars": true,
"groupIcons": true,
"guildIcons": true,
"streamPreviews": true,
"emojis": true
},
"rescaleSettings": {
"messages": "NONE",
"imageViewer": "NONE"
},
"resizeSettings": {
"messages": false,
"imageViewer": false
},
"scaleSettings": {
"messages": "NONE",
"imageViewer": "NONE"
},
"viewerSettings": {
"zoomMode": true,
"galleryMode": true,
"details": true,
"copyImage": true,
"saveImage": true,
"jumpTo": true
},
"zoomSettings": {
"clickMode": false,
"lensSize": 1459,
"pixelMode": false,
"zoomLevel": 1.6000000000000014,
"zoomSpeed": 0.1
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,8 @@
{
"settings": {
"latestUsedVersion": "1.3.3",
"exclude": [
"709081938622939166"
]
}
}

View File

@@ -0,0 +1,534 @@
/**
* @name InvisibleTyping
* @version 1.3.3
* @description Makes your typing invisible to other people.
* @author Strencher
* @invite gvA2ree
* @changelog [fixed] Fixed cleanup of observer.
* @changelogDate 2022-10-22T22:00:00.000Z
* @changelogImage https://cdn.discordapp.com/attachments/939319506428391495/1032360180303790163/Untitled-1.jpg
*/
var meta;
const {React, DOM, Patcher, UI, Data, Utils, ReactUtils, ContextMenu, Webpack: _Webpack} = new BdApi("InvisibleTyping");
const Webpack = {
..._Webpack,
getByProps(...props) {return this.getModule(this.Filters.byProps(...props));},
getStore(name) {return this.getModule(m => m?._dispatchToken && m?.getName() === name);},
getBulk(...queries) {return _Webpack.getBulk(...queries.map(q => typeof q === "function" ? {filter: q} : q));}
};
Utilities: {
var removeItem = function (array, item) {
while (array.includes(item)) {
array.splice(array.indexOf(item), 1);
}
return array;
};
var onceAdded = (selector, callback, signal) => {
let directMatch;
if (directMatch = document.querySelector(selector)) {
callback(directMatch);
return () => null;
}
const cancel = () => observer.disconnect();
const observer = new MutationObserver(changes => {
for (const change of changes) {
if (!change.addedNodes.length) continue;
for (const node of change.addedNodes) {
const match = (node.matches(selector) && node) || node.querySelector(selector);
if (!match) continue;
cancel();
signal.removeEventListener("abort", cancel);
callback(match);
}
}
});
observer.observe(document.body, {childList: true, subtree: true});
signal.addEventListener("abort", cancel);
};
var Fluxify = (component, stores, getter) => {
Object.assign(component.prototype, {
componentDidMount() {
this._handleStoreChange = this._handleStoreChange.bind(this);
this._handleStoreChange();
for (const store of stores) store.addChangeListener(this._handleStoreChange);
},
_handleStoreChange() {
if (this._gone) return;
this.setState(getter(this.props));
},
componentWillUnmount() {
this._gone = true;
for (const store of stores) store.removeChangeListener(this._handleStoreChange);
}
});
};
var Settings = {
_listeners: new Set,
settings: Data.load("settings") ?? {},
getSetting(id, defValue) {return this.settings[id] ?? defValue;},
updateSetting(id, value) {return this.settings[id] = value, this.saveSettings();},
saveSettings() {Data.save("settings", this.settings), this.emitChange();},
emitChange() {this._listeners.forEach(callback => callback());},
addChangeListener(listener) {this._listeners.add(listener);},
removeChangeListener(listener) {this._listeners.delete(listener);}
};
};
Components: {
var InvisibleTypingButton = class InvisibleTypingButton extends React.Component {
state = {enabled: false};
static DMChannels = new Set([1, 3]);
static canViewChannel(channel) {
if (!channel) return false;
if (this.DMChannels.has(channel.type)) return true;
try {
return this.defaultProps.PermissionUtils.can({
context: channel,
user: this.defaultProps.UserStore.getCurrentUser(),
permission: /*SEND_MESSAGES*/ 2048n
});
} catch (error) {
console.error("Failed to request permissions:", error);
return true;
}
}
static shouldShow(children, props) {
if (!Array.isArray(children)) return false;
if (props.type?.analyticsName === "profile_bio_input") return false;
if (children.some(child => child && child.type === InvisibleTypingButton)) return false;
if (!this.canViewChannel(props.channel)) return false;
return true;
}
static getState(channelId) {
const isGlobal = Settings.getSetting("autoEnable", true);
const isExcluded = Settings.getSetting("exclude", []).includes(channelId);
if (isExcluded) return isGlobal;
return !isGlobal;
}
handleClick = () => {
const {channel, isEmpty, TypingModule} = this.props;
const excludeList = Settings.getSetting("exclude", []).concat();
if (excludeList.includes(channel.id)) {
removeItem(excludeList, channel.id);
TypingModule.stopTyping(channel.id);
} else {
excludeList.push(channel.id);
if (!isEmpty) TypingModule.startTyping(channel.id);
}
Settings.updateSetting("exclude", excludeList);
}
renderContextMenu() {
const globalState = Settings.getSetting("autoEnable", false);
return ContextMenu.buildMenu([
{
id: "globally-disable-or-enable-typing",
label: !globalState ? "Disable Globally" : "Enable Globally",
onClick: () => {Settings.updateSetting("autoEnable", !globalState);}
},
{
id: "reset-config",
color: "colorDanger",
disabled: !Settings.getSetting("exclude", []).length,
label: "Reset Config",
onClick() {
Settings.updateSetting("exclude", []);
UI.showToast("Successfully reset config for all channels.", {type: "success"});
}
}
]);
}
renderButton = props => {
return React.createElement("button", {
...props,
ref: e => e && (e.unmount = () => {
this.render = () => null;
this.forceUpdate();
}),
onClick: this.handleClick,
onContextMenu: e => ContextMenu.open(e, this.renderContextMenu()),
className: Utils.className("invisible-typing-button", {enabled: this.state.enabled, disabled: !this.state.disabled}),
children: React.createElement("svg", {
width: "25",
height: "25",
viewBox: "0 0 576 512"
}, React.createElement("path", {
fill: "currentColor",
d: "M528 448H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h480c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48zM128 180v-40c0-6.627-5.373-12-12-12H76c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm-336 96v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm-336 96v-40c0-6.627-5.373-12-12-12H76c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm288 0v-40c0-6.627-5.373-12-12-12H172c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h232c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12z"
}), !this.state.enabled ? React.createElement("rect", {
className: "disabled-stroke-through",
x: "10",
y: "10",
width: "600pt",
height: "70px",
fill: "#f04747"
}) : null)
});
}
render() {
const {Tooltip} = this.props;
return React.createElement(Tooltip, {
text: this.state.enabled ? "Disable Typing" : "Enable Typing",
children: this.renderButton
});
}
}
Fluxify(InvisibleTypingButton, [Settings], (props) => ({enabled: InvisibleTypingButton.getState(props.channel.id)}));
Settings: {
var SimpleSwitch = ({state = false, name = "", note = "", onChange}) => {
const [currState, toggle] = React.useReducer(n => !n, state);
const handleChange = () => (onChange(!currState), toggle());
return React.createElement("div", {className: "it-switch-wrapper"},
React.createElement("div", {className: "it-switch-header"},
React.createElement("h5", {className: "it-switch-name"}, name),
React.createElement("div", {
className: Utils.className("it-switch-item", currState && "it-switch-checked"),
onClick: handleChange,
}, React.createElement("div", {className: "it-switch-dot"}))
),
React.createElement("span", {className: "it-switch-note"}, note)
);
}
}
}
module.exports = class InvisibleTyping {
constructor(metaObject) {meta = this.meta = metaObject;}
cleanup = new Set([
() => Patcher.unpatchAll(),
() => DOM.removeStyle(),
() => new Set(document.getElementsByClassName("invisible-typing-button")).forEach(el => el.unmount?.())
]);
start() {
DOM.addStyle(`
.it-title-wrap {
font-size: 18px;
}
.it-title-wrap span {
font-size: 12px;
color: var(--text-muted);
font-family: var(--font-primary);
}
.invisible-typing-button svg {
color: var(--interactive-normal);
overflow: visible;
}
.invisible-typing-button .disabled-stroke-through {
position: absolute;
transform: translateX(-15px) translateY(530px) rotate(-45deg);
}
.invisible-typing-button {
margin-top: 3px;
background: transparent;
}
.invisible-typing-button:hover:not(.disabled) svg {
color: var(--interactive-hover);
}
.it-switch-wrapper {
color: #fff;
margin-bottom: 10px;
}
.it-switch-header {
margin-bottom: 15px;
display: flex;
justify-content: space-between;
align-items: center;
}
.it-switch-name {
font-size: 18px;
font-weight: 500;
}
.it-switch-note {
font-size: 14px;
color: var(--text-muted);
}
.it-switch-item.it-switch-checked {
background: var(--brand-experiment);
}
.it-switch-item {
width: 40px;
height: 24px;
background: rgb(114, 118, 125);
border-radius: 100px;
cursor: pointer;
}
.it-switch-dot {
width: 18px;
height: 18px;
background: #fff;
border-radius: 100px;
top: 3px;
left: 3px;
position: relative;
transition: transform .3s ease-in-out;
}
.it-switch-checked .it-switch-dot {
transform: translateX(16px);
}
.it-switch-wrapper {
color: #fff;
margin-bottom: 10px;
}
.it-switch-header {
margin-bottom: 15px;
display: flex;
justify-content: space-between;
align-items: center;
}
.it-switch-name {
font-size: 18px;
font-weight: 500;
}
.it-switch-note {
font-size: 14px;
color: var(--text-muted);
}
.it-switch-item.it-switch-checked {
background: var(--brand-experiment);
}
.it-switch-item {
width: 40px;
height: 24px;
background: rgb(114, 118, 125);
border-radius: 100px;
cursor: pointer;
}
.it-switch-dot {
width: 18px;
height: 18px;
background: #fff;
border-radius: 100px;
top: 3px;
left: 3px;
position: relative;
transition: transform .3s ease-in-out;
}
.it-switch-checked .it-switch-dot {
transform: translateX(16px);
}
.it-changelog-item {
color: #fff;
}
.it-changelog-header {
text-transform: uppercase;
font-weight: 700;
display: flex;
align-items: center;
margin-bottom: 10px;
}
.item-changelog-added .it-changelog-header {
color: #45BA6A;
}
.item-changelog-fixed .it-changelog-header {
color: #EC4245;
}
.item-changelog-improved .it-changelog-header {
color: #5865F2;
}
.it-changelog-header::after {
content: "";
flex-grow: 1;
height: 1px;
background: currentColor;
margin-left: 7px;
}
.it-changelog-item span {
display: list-item;
margin-left: 5px;
list-style: inside;
}
.it-changelog-item span::marker {
color: var(--background-accent);
}
.it-changelog-banner {
width: 405px;
border-radius: 8px;
margin-bottom: 20px;
}
`);
InvisibleTypingButton.defaultProps ??= {};
[
InvisibleTypingButton.defaultProps.PermissionUtils,
InvisibleTypingButton.defaultProps.UserStore,
InvisibleTypingButton.defaultProps.Tooltip
] = Webpack.getBulk(
{searchExports: true, filter: Webpack.Filters.byProps("can", "areChannelsLocked")},
m => m?._dispatchToken && m.getName() === "UserStore",
{searchExports: true, filter: Webpack.Filters.byPrototypeFields("renderTooltip")}
);
this.patchTextAreaButtons().catch(() => {});
this.patchStartTyping();
this.maybeShowChangelog();
}
maybeShowChangelog() {
if (this.meta.version === Settings.getSetting("latestUsedVersion")) return;
const items = Array.from(meta.changelog.matchAll(/\[(\w+)\]\s?([^\n]+)/g), ([, type, content]) => {
let className = "it-changelog-item";
switch (type) {
case "fixed":
case "improved":
case "added": {
className += " item-changelog-" + type;
break;
};
}
return React.createElement("div", {
className,
children: [
React.createElement("h4", {className: "it-changelog-header"}, type),
React.createElement("span", null, content)
]
});
});
"changelogImage" in meta && items.unshift(
React.createElement("img", {
className: "it-changelog-banner",
src: meta.changelogImage
})
);
Settings.updateSetting("latestUsedVersion", meta.version);
const formatter = new Intl.DateTimeFormat(document.documentElement.lang, {month: "long", day: "numeric", year: "numeric"});
UI.alert(React.createElement("div", {
className: "it-title-wrap",
children: [
React.createElement("h1", null, "What's New - InvisibleTyping"),
React.createElement("span", null, formatter.format(new Date(meta.changelogDate)))
]
}), items);
}
async patchTextAreaButtons() {
const buttonsClassName = Webpack.getByProps("profileBioInput", "buttons")?.buttons
if (!buttonsClassName) return UI.showToast(`[${this.meta.name}] Could not add button to textarea.`, {type: "error"});
const controller = new AbortController();
const instance = await new Promise((resolve, reject) => {
onceAdded("." + buttonsClassName, e => {
const vnode = ReactUtils.getInternalInstance(e);
if (!vnode) return;
for (let curr = vnode, max = 100; curr !== null && max--; curr = curr.return) {
const tree = curr?.pendingProps?.children;
let buttons;
if (Array.isArray(tree) && (buttons = tree.find(s => s?.props?.type && s.props.channel && s.type?.$$typeof))) {
resolve(buttons.type);
break;
}
}
}, controller.signal);
const abort = controller.abort.bind(controller);
controller.signal.addEventListener("abort", () => {
this.cleanup.delete(abort);
reject();
});
this.cleanup.add(abort);
});
Patcher.after(instance, "type", (_, [props], res) => {
if (!InvisibleTypingButton.shouldShow(res?.props?.children, props)) return;
res.props.children.unshift(React.createElement(InvisibleTypingButton, props));
});
}
patchStartTyping() {
const TypingModule = InvisibleTypingButton.defaultProps.TypingModule = Webpack.getByProps("startTyping");
Patcher.instead(TypingModule, "startTyping", (_, [channelId], originalMethod) => {
if (InvisibleTypingButton.getState(channelId)) originalMethod(channelId);
});
}
stop() {
this.cleanup.forEach(clean => clean());
}
getSettingsPanel() {
return React.createElement(SimpleSwitch, {
get state() {return Settings.getSetting("autoEnable", false);},
name: "Globally Toggle",
note: "Enable/Disable your typing information globally and use excluded channels as white-/blacklist.",
onChange: value => Settings.updateSetting("autoEnable", value)
});
}
};

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,736 @@
/**
* @name NotificationSounds
* @author DevilBro
* @authorId 278543574059057154
* @version 3.9.2
* @description Allows you to replace the native Sounds with custom Sounds
* @invite Jx3TjNS
* @donate https://www.paypal.me/MircoWittrien
* @patreon https://www.patreon.com/MircoWittrien
* @website https://mwittrien.github.io/
* @source https://github.com/mwittrien/BetterDiscordAddons/tree/master/Plugins/NotificationSounds/
* @updateUrl https://mwittrien.github.io/BetterDiscordAddons/Plugins/NotificationSounds/NotificationSounds.plugin.js
*/
module.exports = (_ => {
const changeLog = {
"added": {
"Current Channel": "Added Option to change the sound for the current channel notification, (note: Discord added an option in the THEIR notification settings to play a different sound when a message is sent in the current channel, you need to have this enabled in order to be able to change the sound in the plugin settings"
},
"fixed": {
"Current Channel": "No longer plays notification sounds for current channels, if the option is disabled"
}
};
return !window.BDFDB_Global || (!window.BDFDB_Global.loaded && !window.BDFDB_Global.started) ? class {
constructor (meta) {for (let key in meta) this[key] = meta[key];}
getName () {return this.name;}
getAuthor () {return this.author;}
getVersion () {return this.version;}
getDescription () {return `The Library Plugin needed for ${this.name} is missing. Open the Plugin Settings to download it. \n\n${this.description}`;}
downloadLibrary () {
BdApi.Net.fetch("https://mwittrien.github.io/BetterDiscordAddons/Library/0BDFDB.plugin.js").then(r => {
if (!r || r.status != 200) throw new Error();
else return r.text();
}).then(b => {
if (!b) throw new Error();
else return require("fs").writeFile(require("path").join(BdApi.Plugins.folder, "0BDFDB.plugin.js"), b, _ => BdApi.showToast("Finished downloading BDFDB Library", {type: "success"}));
}).catch(error => {
BdApi.alert("Error", "Could not download BDFDB Library Plugin. Try again later or download it manually from GitHub: https://mwittrien.github.io/downloader/?library");
});
}
load () {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
BdApi.showConfirmationModal("Library Missing", `The Library Plugin needed for ${this.name} is missing. Please click "Download Now" to install it.`, {
confirmText: "Download Now",
cancelText: "Cancel",
onCancel: _ => {delete window.BDFDB_Global.downloadModal;},
onConfirm: _ => {
delete window.BDFDB_Global.downloadModal;
this.downloadLibrary();
}
});
}
if (!window.BDFDB_Global.pluginQueue.includes(this.name)) window.BDFDB_Global.pluginQueue.push(this.name);
}
start () {this.load();}
stop () {}
getSettingsPanel () {
let template = document.createElement("template");
template.innerHTML = `<div style="color: var(--header-primary); font-size: 16px; font-weight: 300; white-space: pre; line-height: 22px;">The Library Plugin needed for ${this.name} is missing.\nPlease click <a style="font-weight: 500;">Download Now</a> to install it.</div>`;
template.content.firstElementChild.querySelector("a").addEventListener("click", this.downloadLibrary);
return template.content.firstElementChild;
}
} : (([Plugin, BDFDB]) => {
var audios, choices, firedEvents;
var volumes = {};
const removeAllKey = "REMOVE_ALL_BDFDB_DEVILBRO_DO_NOT_COPY";
const defaultDevice = "default";
var currentDevice = defaultDevice, createdAudios = {};
let types = {};
const message1Types = {
dm: {src: "./message3.mp3", name: "Message (Direct Message)"},
groupdm: {src: "./message3.mp3", name: "Message (Group Message)"},
mentioned: {src: "./message2.mp3", name: "Message Mentioned"},
reply: {src: "./message2.mp3", name: "Message Mentioned (reply)"},
role: {src: "./mention1.mp3", name: "Message Mentioned (role)"},
everyone: {src: "./mention2.mp3", name: "Message Mentioned (@everyone)"},
here: {src: "./mention3.mp3", name: "Message Mentioned (@here)"}
};
const namePrefixes = {
"user_join": "Voice Channel",
"user_leave": "Voice Channel",
"user_moved": "Voice Channel"
};
const nameSynonymes = {
"message3": "Message (Current Channel)",
"reconnect": "Invited To Speak"
};
const defaultAudios = {
"---": {
"---": null
},
"Discord": {}
};
const WebAudioSound = class WebAudioSound {
constructor (type) {
this.name = type;
this._src = choices[type] && audios[choices[type].category][choices[type].sound] || types[type] && types[type].src || BDFDB.LibraryModules.SoundParser(`./${type}.mp3`);
this._volume = (choices[type] ? choices[type].volume : 100) / 100;
}
loop () {
this._ensureAudio().then(audio => {
audio.loop = true;
audio.play();
});
}
play () {
this._ensureAudio().then(audio => {
audio.loop = false;
audio.play();
});
}
playWithListener (duration) {
return new Promise((callback, errorCallback) => {
this._ensureAudio().then(audio => {
if (!duration && duration !== 0) errorCallback(new Error("sound has no duration"));
audio.loop = false;
audio.play();
setTimeout(_ => callback(true), duration);
});
});
}
pause () {
this._audio.then(audio => {
audio.pause();
});
}
stop () {
this._destroyAudio();
}
setTime (time) {
this._audio.then(audio => {
audio.currentTime = time;
});
}
setLoop (loop) {
this._audio.then(audio => {
audio.loop = loop;
});
}
_destroyAudio () {
if (this._audio) {
this._audio.then(audio => {
audio.pause();
audio.src = "";
});
this._audio = null;
}
}
_ensureAudio () {
return this._audio = this._audio || new Promise((callback, errorCallback) => {
let audio = new Audio;
audio.src = this._src && this._src.startsWith("data") ? this._src.replace(/ /g, "") : this._src;
audio.onloadeddata = _ => {
audio.volume = Math.min((BDFDB.LibraryStores.MediaEngineStore.getOutputVolume() / 100) * this._volume * (volumes.globalVolume / 100), 1);
BDFDB.DiscordUtils.isPlaformEmbedded() && audio.setSinkId(currentDevice || defaultDevice);
callback(audio);
};
audio.onerror = _ => errorCallback(new Error("could not play audio"));
audio.onended = _ => this._destroyAudio();
audio.load();
}), this._audio;
}
};
return class NotificationSounds extends Plugin {
onLoad () {
audios = {};
choices = {};
firedEvents = {};
this.defaults = {
volumes: {
globalVolume: {value: 100, description: "Global Notification Sounds Volume"}
}
};
this.patchPriority = 9;
}
onStart () {
const soundKeys = BDFDB.LibraryModules.SoundParser.keys();
for (let key of soundKeys) {
const id = key.replace("./", "").replace(".mp3", "");
const name = [namePrefixes[id], (nameSynonymes[id] || id).replace("ddr-", "HotKeys_").replace("ptt_", "Push2Talk_").split(/[_-]/)].flat(10).filter(n => n).map(BDFDB.StringUtils.upperCaseFirstChar).join(" ").replace(/1$/g, "");
const src = BDFDB.LibraryModules.SoundParser(key);
let soundPackName = id.split("_")[0];
if (soundPackName != id && soundKeys.filter(n => n.indexOf(`./${soundPackName}`) > -1).length > 10) {
soundPackName = BDFDB.StringUtils.upperCaseFirstChar(soundPackName);
if (!defaultAudios[soundPackName]) defaultAudios[soundPackName] = {};
defaultAudios[soundPackName][name.replace(new RegExp(`${soundPackName} `, "i"), "").replace(/bootup/i, "Discodo")] = src;
}
else {
defaultAudios.Discord[name] = src;
if (this.isSoundUsedAnywhere(id)) types[id] = {
name: name,
src: src,
mute: id.startsWith("call_") ? null : false,
streamMute: false,
invisibleMute: false
};
if (id == "message1") {
types[id].mute = true;
types[id].streamMute = false;
types[id].invisibleMute = false;
for (let subType in message1Types) types[subType] = {
name: message1Types[subType].name,
src: BDFDB.LibraryModules.SoundParser(message1Types[subType].src),
mute: true,
streamMute: false,
invisibleMute: false
}
}
}
types = BDFDB.ObjectUtils.sort(types, "name");
}
for (let pack in defaultAudios) defaultAudios[pack] = BDFDB.ObjectUtils.sort(defaultAudios[pack]);
if (BDFDB.DiscordUtils.isPlaformEmbedded()) {
let change = _ => {
if (window.navigator.mediaDevices && window.navigator.mediaDevices.enumerateDevices) {
window.navigator.mediaDevices.enumerateDevices().then(enumeratedDevices => {
let id = BDFDB.LibraryStores.MediaEngineStore.getOutputDeviceId();
let allDevices = BDFDB.LibraryStores.MediaEngineStore.getOutputDevices();
let filteredDevices = enumeratedDevices.filter(d => d.kind == "audiooutput" && d.deviceId != "communications");
let deviceIndex = BDFDB.LibraryModules.ArrayUtils(allDevices).sortBy(d => d.index).findIndex(d => d.id == id);
let deviceViaId = allDevices[id];
let deviceViaIndex = filteredDevices[deviceIndex];
if (deviceViaId && deviceViaIndex && deviceViaIndex.label != deviceViaId.name) deviceViaIndex = filteredDevices.find(d => d.label == deviceViaId.name);
currentDevice = deviceViaIndex ? deviceViaIndex.deviceId : defaultDevice;
}).catch(_ => {
currentDevice = defaultDevice;
});
}
};
BDFDB.StoreChangeUtils.add(this, BDFDB.LibraryStores.MediaEngineStore, change);
change();
}
BDFDB.PatchUtils.patch(this, BDFDB.LibraryModules.DispatchApiUtils, "dispatch", {before: e => {
if (BDFDB.ObjectUtils.is(e.methodArguments[0]) && e.methodArguments[0].type == "MESSAGE_CREATE" && e.methodArguments[0].message) {
const message = e.methodArguments[0].message;
const guildId = message.guild_id || null;
if (message.author.id != BDFDB.UserUtils.me.id && !BDFDB.LibraryStores.RelationshipStore.isBlocked(message.author.id)) {
const isCurrent = BDFDB.LibraryStores.SelectedChannelStore.getChannelId() == message.channel_id;
const channel = BDFDB.LibraryStores.ChannelStore.getChannel(message.channel_id);
const isGroupDM = channel.isGroupDM();
const isThread = BDFDB.ChannelUtils.isThread(channel);
if (isThread && BDFDB.LibraryStores.JoinedThreadsStore.isMuted(channel.id) || !isThread && BDFDB.LibraryStores.UserGuildSettingsStore.isGuildOrCategoryOrChannelMuted(guildId, channel.id)) return;
if (!guildId) {
this.fireEvent(isGroupDM ? "groupdm" : "dm");
!BDFDB.LibraryStores.NotificationSettingsStore.getNotifyMessagesInSelectedChannel() && !document.hasFocus() && this.playAudio(isGroupDM ? "groupdm" : "dm");
return;
}
else if (guildId) {
if (BDFDB.LibraryModules.MentionUtils.isRawMessageMentioned({rawMessage: message, userId: BDFDB.UserUtils.me.id})) {
if (message.mentions.length && !this.isSuppressMentionsEnabled(guildId, channel.id)) for (const mention of message.mentions) if (mention.id == BDFDB.UserUtils.me.id) {
if (message.message_reference && !message.interaction) {
this.fireEvent("reply");
!isCurrent && this.playAudio("reply");
return;
}
if (!message.message_reference) {
this.fireEvent("mentioned");
!isCurrent && this.playAudio("mentioned");
return;
}
}
if (message.mention_roles.length && !BDFDB.LibraryStores.UserGuildSettingsStore.isSuppressRolesEnabled(guildId, channel.id)) {
const member = BDFDB.LibraryStores.GuildMemberStore.getMember(guildId, BDFDB.UserUtils.me.id);
if (member && member.roles.length) for (const roleId of message.mention_roles) if (member.roles.includes(roleId)) {
this.fireEvent("role");
!isCurrent && this.playAudio("role");
return;
}
}
if (message.mention_everyone && !BDFDB.LibraryStores.UserGuildSettingsStore.isSuppressEveryoneEnabled(guildId, channel.id)) {
if (message.content.indexOf("@everyone") > -1) {
this.fireEvent("everyone");
!isCurrent && this.playAudio("everyone");
return;
}
if (message.content.indexOf("@here") > -1) {
this.fireEvent("here");
!isCurrent && this.playAudio("here");
return;
}
}
}
if (BDFDB.LibraryStores.UserGuildSettingsStore.allowAllMessages(channel) && !(isThread && !BDFDB.LibraryStores.JoinedThreadsStore.hasJoined(channel.id))) {
this.fireEvent("message1");
!isCurrent && this.playAudio("message1");
return;
}
}
}
}
}});
BDFDB.PatchUtils.patch(this, BDFDB.LibraryModules.DesktopNotificationUtils, "showNotification", {before: e => {
let soundObjIndex = Array.from(e.methodArguments).findIndex(n => n && n.sound);
if (soundObjIndex && e.methodArguments[soundObjIndex].sound.includes("message")) e.methodArguments[soundObjIndex].sound = null;
}});
if (BDFDB.LibraryModules.SoundUtils && BDFDB.LibraryModules.SoundUtils.createSound) {
let cancel = BDFDB.PatchUtils.patch(this, BDFDB.LibraryModules.SoundUtils, "createSound", {after: e => {
if (e.returnValue && e.returnValue.constructor && e.returnValue.constructor.prototype && typeof e.returnValue.constructor.prototype.play == "function") {
cancel();
BDFDB.PatchUtils.patch(this, e.returnValue.constructor.prototype, ["play", "loop", "playWithListener"], {instead: e2 => {
let type = e2.instance && e2.instance.name;
if (type && choices[type]) {
e2.stopOriginalMethodCall();
if (type == "message1") BDFDB.TimeUtils.timeout(_ => {
let called = false;
for (let subType of [type].concat(Object.keys(message1Types))) if (firedEvents[subType]) {
delete firedEvents[subType];
called = true;
break;
}
if (!called) return this.playAudio(type, e2.originalMethodName, e2.instance.duration);
});
else return this.playAudio(type, e2.originalMethodName, e2.instance.duration);
}
else return this.playAudio(type, e2.originalMethodName, e2.instance.duration);
}});
BDFDB.PatchUtils.patch(this, e.returnValue.constructor.prototype, "stop", {after: e2 => {
let type = e2.instance && e2.instance.name;
if (type && createdAudios[type]) createdAudios[type].stop();
}});
}
}}, {noCache: true});
BDFDB.LibraryModules.SoundUtils.createSound("call_calling");
}
this.loadAudios();
this.loadChoices();
this.forceUpdateAll();
}
onStop () {
for (let type in createdAudios) if (createdAudios[type]) createdAudios[type].stop();
}
getSettingsPanel (collapseStates = {}) {
let successSavedAudio = data => {
BDFDB.NotificationUtils.toast(`Sound ${data.sound} was added to category ${data.category}.`, {type: "success"});
if (!audios[data.category]) audios[data.category] = {};
audios[data.category][data.sound] = data.source;
BDFDB.DataUtils.save(audios, this, "audios");
BDFDB.PluginUtils.refreshSettingsPanel(this, settingsPanel, collapseStates);
};
let settingsPanel;
return settingsPanel = BDFDB.PluginUtils.createSettingsPanel(this, {
collapseStates: collapseStates,
children: _ => {
let settingsItems = [];
settingsItems.push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.CollapseContainer, {
title: "Settings",
collapseStates: collapseStates,
children: Object.keys(volumes).map(key => BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SettingsSaveItem, {
type: "Slider",
plugin: this,
keys: ["volumes", key],
basis: "50%",
label: this.defaults.volumes[key].description,
value: volumes[key]
}))
}));
settingsItems.push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.CollapseContainer, {
title: "Add new Sound",
collapseStates: collapseStates,
children: [
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Flex, {
className: BDFDB.disCN.margintop4,
children: [
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Flex.Child, {
children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.FormComponents.FormItem, {
title: "Categoryname",
children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.TextInput, {
className: "input-newsound input-category",
value: "",
placeholder: "Categoryname"
})
})
}),
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Flex.Child, {
children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.FormComponents.FormItem, {
title: "Soundname",
children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.TextInput, {
className: "input-newsound input-sound",
value: "",
placeholder: "Soundname"
})
})
})
]
}),
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Flex, {
className: BDFDB.disCN.margintop4,
align: BDFDB.LibraryComponents.Flex.Align.END,
children: [
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Flex.Child, {
children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.FormComponents.FormItem, {
title: "Source",
children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.TextInput, {
className: "input-newsound input-source",
type: "file",
filter: ["audio", "video"],
useFilePath: true,
value: "",
placeholder: "Source"
})
})
}),
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Button, {
style: {marginBottom: 1},
onClick: _ => {
for (let input of settingsPanel.props._node.querySelectorAll(".input-newsound " + BDFDB.dotCN.input)) if (!input.value || input.value.length == 0 || input.value.trim().length == 0) return BDFDB.NotificationUtils.toast("Fill out all Fields to add a new Sound", {type: "danger"});
let category = settingsPanel.props._node.querySelector(".input-category " + BDFDB.dotCN.input).value.trim();
let sound = settingsPanel.props._node.querySelector(".input-sound " + BDFDB.dotCN.input).value.trim();
let source = settingsPanel.props._node.querySelector(".input-source " + BDFDB.dotCN.input).value.trim();
if (source.indexOf("http") == 0) BDFDB.LibraryRequires.request(source, (error, response, result) => {
if (response) {
let type = response.headers["content-type"];
if (type && (type.indexOf("octet-stream") > -1 || type.indexOf("audio") > -1 || type.indexOf("video") > -1)) return successSavedAudio({category, sound, source});
}
BDFDB.NotificationUtils.toast("Use a valid direct link to a video or audio source, they usually end on something like .mp3, .mp4 or .wav", {type: "danger"});
});
else BDFDB.LibraryRequires.fs.readFile(source, "base64", (error, body) => {
if (error) BDFDB.NotificationUtils.toast("Could not fetch file. Please make sure the file exists.", {type: "danger"});
else return successSavedAudio({category, sound, source: `data:audio/mpeg;base64,${body}`});
});
},
children: BDFDB.LanguageUtils.LanguageStrings.SAVE
})
]
})
]
}));
settingsItems.push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.CollapseContainer, {
title: "Sound Configuration",
collapseStates: collapseStates,
children: Object.keys(types).map(type => type == "message3" && !BDFDB.LibraryStores.NotificationSettingsStore.getNotifyMessagesInSelectedChannel() ? null : [
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Flex, {
className: BDFDB.disCN.marginbottom8,
align: BDFDB.LibraryComponents.Flex.Align.CENTER,
direction: BDFDB.LibraryComponents.Flex.Direction.HORIZONTAL,
children: [
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SettingsLabel, {
label: types[type].name
}),
["mute", "streamMute", "invisibleMute"].some(n => types[type][n] !== null) && BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Clickable, {
onClick: event => BDFDB.ContextMenuUtils.open(this, event, BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuGroup, {
children: [
{key: "mute", label: ["Mute in", BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.StatusComponents.Status, {style: {marginLeft: 6}, size: 12, status: BDFDB.LibraryComponents.StatusComponents.Types.DND})]},
{key: "invisibleMute", label: ["Mute in", BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.StatusComponents.Status, {style: {marginLeft: 6}, size: 12, status: BDFDB.LibraryComponents.StatusComponents.Types.INVISIBLE})]},
{key: "streamMute", label: ["Mute while", BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.StatusComponents.Status, {style: {marginLeft: 6}, size: 12, status: BDFDB.LibraryComponents.StatusComponents.Types.STREAMING})]}
].map(n => types[type][n.key] !== null && BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuCheckboxItem, {
label: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Flex, {
align: BDFDB.LibraryComponents.Flex.Align.CENTER,
children: n.label
}),
hint: n.hint,
id: BDFDB.ContextMenuUtils.createItemId(this.name, type, n.key),
checked: choices[type][n.key],
action: state => {
choices[type][n.key] = state;
this.saveChoice(type, false);
}
})).filter(n => n)
})),
children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SvgIcon, {
width: 20,
height: 20,
name: BDFDB.LibraryComponents.SvgIcon.Names.COG
})
})
].filter(n => n)
}),
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Flex, {
className: BDFDB.disCN.marginbottom8,
children: [
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Flex.Child, {
grow: 0,
shrink: 0,
basis: "31%",
children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.FormComponents.FormItem, {
title: "Category",
children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Select, {
value: choices[type].category,
options: Object.keys(audios).map(name => ({value: name, label: name})),
searchable: true,
onChange: value => {
const categorySounds = audios[value] || {};
choices[type].category = value;
choices[type].sound = categorySounds[types[type].name] ? types[type].name : Object.keys(categorySounds)[0];
this.saveChoice(type, true);
BDFDB.PluginUtils.refreshSettingsPanel(this, settingsPanel, collapseStates);
}
})
})
}),
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Flex.Child, {
grow: 0,
shrink: 0,
basis: "31%",
children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.FormComponents.FormItem, {
title: "Sound",
children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Select, {
value: choices[type].sound,
options: Object.keys(audios[choices[type].category] || {}).map(name => ({value: name, label: name})),
searchable: true,
onChange: value => {
choices[type].sound = value;
this.saveChoice(type, true);
BDFDB.PluginUtils.refreshSettingsPanel(this, settingsPanel, collapseStates);
}
})
})
}),
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Flex.Child, {
grow: 0,
shrink: 0,
basis: "31%",
children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.FormComponents.FormItem, {
title: "Volume",
children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Slider, {
defaultValue: choices[type].volume,
digits: 1,
onValueRender: value => {
return value + "%";
},
onValueChange: value => {
choices[type].volume = value;
this.saveChoice(type, true);
}
})
})
})
]
}),
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.FormComponents.FormDivider, {
className: BDFDB.disCN.marginbottom8
})
]).flat(10).filter(n => n)
}));
let removeableCategories = [{value: removeAllKey, label: BDFDB.LanguageUtils.LanguageStrings.FORM_LABEL_ALL}].concat(Object.keys(audios).filter(category => !(defaultAudios[category] && !Object.keys(audios[category] || {}).filter(sound => defaultAudios[category][sound] === undefined).length)).map(name => ({value: name, label: name})));
let removeableSounds = {};
for (let category of removeableCategories) removeableSounds[category.value] = [{value: removeAllKey, label: BDFDB.LanguageUtils.LanguageStrings.FORM_LABEL_ALL}].concat(Object.keys(audios[category.value] || {}).filter(sound => !(defaultAudios[category.value] && defaultAudios[category.value][sound] !== undefined)).map(name => ({value: name, label: name})));
settingsItems.push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.CollapseContainer, {
title: "Remove Sounds",
collapseStates: collapseStates,
children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Flex, {
className: BDFDB.disCN.margintop4,
align: BDFDB.LibraryComponents.Flex.Align.END,
children: [
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Flex.Child, {
grow: 0,
shrink: 0,
basis: "35%",
children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.FormComponents.FormItem, {
title: "Category",
children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Select, {
key: "REMOVE_CATEGORY",
value: removeAllKey,
options: removeableCategories,
searchable: true,
onChange: (category, instance) => {
let soundSelectIns = BDFDB.ReactUtils.findOwner(BDFDB.ReactUtils.findOwner(instance, {name: ["BDFDB_Modal", "BDFDB_SettingsPanel"], up: true}), {key: "REMOVE_SOUND"});
if (soundSelectIns && removeableSounds[category.value]) {
soundSelectIns.props.options = removeableSounds[category.value];
soundSelectIns.props.value = removeAllKey;
BDFDB.ReactUtils.forceUpdate(soundSelectIns);
}
}
})
})
}),
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Flex.Child, {
grow: 0,
shrink: 0,
basis: "35%",
children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.FormComponents.FormItem, {
title: "Sound",
children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Select, {
key: "REMOVE_SOUND",
value: removeAllKey,
options: removeableSounds[removeAllKey],
searchable: true
})
})
}),
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Flex.Child, {
grow: 0,
shrink: 1,
basis: "25%",
children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Button, {
style: {marginBottom: 1},
color: BDFDB.LibraryComponents.Button.Colors.RED,
onClick: (event, instance) => {
let wrapperIns = BDFDB.ReactUtils.findOwner(instance, {name: ["BDFDB_Modal", "BDFDB_SettingsPanel"], up: true});
let categorySelectIns = BDFDB.ReactUtils.findOwner(wrapperIns, {key: "REMOVE_CATEGORY"});
let soundSelectIns = BDFDB.ReactUtils.findOwner(wrapperIns, {key: "REMOVE_SOUND"});
if (categorySelectIns && soundSelectIns) {
let soundAmount = 0;
let catAll = categorySelectIns.props.value == removeAllKey;
let soundAll = soundSelectIns.props.value == removeAllKey;
if (catAll) soundAmount = BDFDB.ArrayUtils.sum(Object.keys(audios).map(category => Object.keys(audios[category] || {}).filter(sound => !(defaultAudios[category] && defaultAudios[category][sound] !== undefined)).length));
else if (soundAll) soundAmount = Object.keys(audios[categorySelectIns.props.value] || {}).filter(sound => !(defaultAudios[categorySelectIns.props.value] && defaultAudios[categorySelectIns.props.value][sound] !== undefined)).length;
else if (audios[categorySelectIns.props.value][soundSelectIns.props.value]) soundAmount = 1;
if (soundAmount) BDFDB.ModalUtils.confirm(this, `Are you sure you want to delete ${soundAmount} added Sound${soundAmount == 1 ? "" : "s"}?`, _ => {
if (catAll) BDFDB.DataUtils.remove(this, "audios");
else if (soundAll) BDFDB.DataUtils.remove(this, "audios", categorySelectIns.props.value);
else {
delete audios[categorySelectIns.props.value][soundSelectIns.props.value];
if (BDFDB.ObjectUtils.isEmpty(audios[categorySelectIns.props.value])) delete audios[categorySelectIns.props.value];
BDFDB.DataUtils.save(audios, this, "audios");
}
this.loadAudios();
this.loadChoices();
BDFDB.PluginUtils.refreshSettingsPanel(this, settingsPanel, collapseStates);
});
else BDFDB.NotificationUtils.toast("No Sounds to delete", {type: "danger"});
}
},
children: BDFDB.LanguageUtils.LanguageStrings.DELETE
})
})
]
})
}));
return settingsItems;
}
});
}
onSettingsClosed () {
if (this.SettingsUpdated) {
delete this.SettingsUpdated;
for (let type in createdAudios) if (createdAudios[type]) createdAudios[type].stop();
createdAudios = {};
this.forceUpdateAll();
}
}
forceUpdateAll () {
volumes = BDFDB.DataUtils.get(this, "volumes");
BDFDB.PatchUtils.forceAllUpdates(this);
BDFDB.DiscordUtils.rerenderAll();
}
loadAudios () {
audios = Object.assign({}, BDFDB.DataUtils.load(this, "audios"), defaultAudios);
BDFDB.DataUtils.save(BDFDB.ObjectUtils.exclude(audios, Object.keys(defaultAudios)), this, "audios");
}
loadChoices () {
let loadedChoices = BDFDB.DataUtils.load(this, "choices");
for (let type in types) {
let choice = loadedChoices[type] || {}, soundFound = false;
for (let category in audios) if (choice.category == category) for (let sound in audios[category]) if (choice.sound == sound) {
soundFound = true;
break;
}
if (!soundFound) choice = {
category: "---",
sound: "---",
volume: 100,
mute: types[type].mute,
streamMute: types[type].streamMute,
invisibleMute: types[type].invisibleMute
};
choices[type] = choice;
this.saveChoice(type, false);
}
}
saveChoice (type, play) {
if (!choices[type]) return;
BDFDB.DataUtils.save(choices[type], this, "choices", type);
if (play) {
this.SettingsUpdated = true;
this.playAudio(type);
}
}
playAudio (type, functionCall = "play", duration = 0) {
if (this.dontPlayAudio(type) || BDFDB.LibraryStores.StreamerModeStore.disableSounds) return;
if (createdAudios[type]) createdAudios[type].stop();
createdAudios[type] = new WebAudioSound(type);
return createdAudios[type][typeof createdAudios[type][functionCall] == "function" ? functionCall : "play"](duration);
}
isSuppressMentionsEnabled (guildId, channelId) {
let channelSettings = BDFDB.LibraryStores.UserGuildSettingsStore.getChannelMessageNotifications(guildId, channelId);
return channelSettings && (channelSettings == BDFDB.DiscordConstants.UserNotificationSettings.NO_MESSAGES || channelSettings == BDFDB.DiscordConstants.UserNotificationSettings.NULL && BDFDB.LibraryStores.UserGuildSettingsStore.getMessageNotifications(guildId) == BDFDB.DiscordConstants.UserNotificationSettings.NO_MESSAGES);
}
dontPlayAudio (type) {
let status = BDFDB.UserUtils.getStatus();
return choices[type] && (choices[type].mute && status == "dnd" || choices[type].streamMute && status == "streaming" || choices[type].invisibleMute && (status == "offline" || status == "invisible"));
}
fireEvent (type) {
firedEvents[type] = true;
BDFDB.TimeUtils.timeout(_ => delete firedEvents[type], 3000);
}
isSoundUsedAnywhere (type) {
return type && type.indexOf("poggermode_") != 0 && type != "human_man" && type != "robot_man" && type != "discodo" && type != "overlayunlock" && type != "call_ringing_beat" && !(type != "message1" && type != "message3" && /\d$/.test(type));
}
};
})(window.BDFDB_Global.PluginUtils.buildPlugin(changeLog));
})();

View File

@@ -0,0 +1,49 @@
{
"all": {
"general": {
"pinIcon": true,
"unreadAmount": true,
"channelAmount": true
},
"pinned": {
"662731831908761636": {
"channelList": {
"1741875717362926": {
"id": "1741875717362926",
"name": "",
"dms": [
"815678838809296926",
"740325591684874305",
"709081938622939166"
],
"pos": 0,
"collapsed": false,
"color": null
}
}
}
},
"preCategories": {
"friends": {
"enabled": false,
"collapsed": false
},
"blocked": {
"enabled": false,
"collapsed": false
},
"bots": {
"enabled": false,
"collapsed": false
},
"groups": {
"enabled": false,
"collapsed": false
}
},
"recentOrder": {
"channelList": false,
"guildList": false
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,16 @@
{
"all": {
"cached": "2 7 8 9 11 14 15 17 28 29 30 59 60 61 62 63 64 65 66 67 70 71 73 74 75 76 77 80 81 82 83 85 86 87 88 89 91 92 93 94 95 96 97 98 99 100 101 102 104 105 106 108 109 110 111 120 126 127 131 132 134 137 138 139 146 157 158 159 160 162 171 173 176 179 181 182 183 184 185 186 188 189 190 193 195 196 197 200 201 228 237 238 240 245 262 274 278 287 291 292 293 295 306 312 314 317 318 323 331 344 350 351 352 353 354 356 366 368 377 379 381 382 383 390 395 401 404 420 421 429 438 442 476 479 489 509 518 520 523 525 535 539 547 554 577 579 589 592 593 598 599 606 608 611 614 620 621 627 638 644 645 670 671 679 686 692 693 694 699 708 760 762 772 798 802 805 806 807 819 827 843 845 850 856 859 867 878 881 882 883 930 936 938 953 954 970 971 979 989 990 996 1000 1005 1010 1016 1023",
"filters": {
"updated": true,
"outdated": true,
"downloadable": true
},
"general": {
"notifyOutdated": true,
"notifyNewEntries": false,
"startDownloaded": false,
"startUpdated": false
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -7,7 +7,7 @@
* @Source https://github.com/ClearVision/ClearVision-v6
* @website https://betterdiscord.app/theme/ClearVision
*/
@import url("https://clearvision.gitlab.io/v6/main.css");
@import url("https://clearvision.github.io/ClearVision-v6/main.css");
@import url('https://fonts.googleapis.com/css2?family=Consolas');
@import url('https://fonts.googleapis.com/css2?family=Whitney');
:root {

View File

@@ -14,14 +14,14 @@
# Any items in the `env` entry below will be added as
# environment variables. Some entries may override variables
# set by alacritty itself.
#env:
env:
# TERM variable
#
# This value is used to set the `$TERM` environment variable for
# each instance of Alacritty. If it is not present, alacritty will
# check the local terminfo database and use `alacritty` if it is
# available, otherwise `xterm-256color` is used.
#TERM: alacritty
TERM: xterm-256color
window:
# Window dimensions (changes require restart)

View File

@@ -15,23 +15,30 @@ set $mod Mod4
# is used in the bar {} block below.
font pango:Inconsolata Bold 11
exec_always --no-startup-id xset s off
exec_always --no-startup-id xset -dpms
# This font is widely installed, provides lots of unicode glyphs, right-to-left
# text rendering and scalability on retina/hidpi displays (thanks to pango).
#font pango:DejaVu Sans Mono 8
client.focused #89a1e2 #89a1e2 #25283f #fe9bce #fe9bce
#client.focused_inactive #fe9bce #fe9bce #fe9bce #fe9bce #fe9bce
client.unfocused #25283f #25283f #545d89 #25283f #25283f
client.focused #fe9bce #89a1e2 #25283f #fe9bce #fe9bce
client.focused_inactive #25283f #89a1e2 #25283f #fe9bce #25283f
client.focused_tab_title #25283f #89a1e2 #25283f #fe9bce #25283f
client.unfocused #25283f #25283f #545d89 #fe9bce #25283f
client.background #25283f
default_border pixel 1
default_floating_border pixel 1
for_window [all] border pixel 1
gaps inner 15
exec_always --no-startup-id feh --bg-fill /home/poslop/Pictures/bg/pcbg.jpg
exec_always --no-startup-id numlockx on
# exec_always --no-startup-id xinput set-prop pointer:'Logitech G305' 'libinput Accel Speed' -0.3
exec --no-startup-id picom &
exec_always --no-startup-id $HOME/.config/polybar/launch.sh
@@ -67,8 +74,8 @@ bindsym $mod+v exec --no-startup-id rofi -modi "clipboard:greenclip print" -show
# Brightness
bindsym XF86MonBrightnessDown exec --no-startup-id light -U 5
bindsym XF86MonBrightnessUp exec --no-startup-id light -A 5
bindsym XF86MonBrightnessDown exec --no-startup-id backlight_control -10
bindsym XF86MonBrightnessUp exec --no-startup-id backlight_control +10
# Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod
@@ -80,7 +87,7 @@ bindsym $mod+Return exec --no-startup-id alacritty
bindsym $mod+Shift+q kill
# start dmenu (a program launcher)
bindsym $mod+d exec --no-startup-id rofi -display-run ">" -show run
bindsym $mod+d exec --no-startup-id rofi -display-drun ">" -modi drun -show drun
# A more modern dmenu replacement is rofi:
# bindcode $mod+40 exec "rofi -modi drun,run -show drun"

28
.config/kdeglobals Normal file
View File

@@ -0,0 +1,28 @@
[$Version]
update_info=filepicker.upd:filepicker-remove-old-previews-entry
[Colors:View]
BackgroundNormal=#25283f
[General]
TerminalApplication=alacritty
[KFileDialog Settings]
Allow Expansion=false
Automatically select filename extension=true
Breadcrumb Navigation=true
Decoration position=2
LocationCombo Completionmode=5
PathCombo Completionmode=5
Show Bookmarks=false
Show Full Path=false
Show Inline Previews=true
Show Preview=false
Show Speedbar=true
Show hidden files=false
Sort by=Name
Sort directories first=true
Sort hidden files last=false
Sort reversed=false
Speedbar Width=219
View Style=DetailTree

View File

@@ -1 +1 @@
{"gtk2_hidpi": false, "OPTION_GTK3_CURRENT_VERSION_ONLY": false, "OPTION_EXPORT_CINNAMON_THEME": false, "default_path": "/home/poslop/.themes"}
{"gtk2_hidpi": true, "self.OPTIONS.GTK3_CURRENT_VERSION_ONLY": true, "self.OPTIONS.EXPORT_CINNAMON_THEME": false, "default_path": "/home/poslop/.themes", "OPTION_GTK3_CURRENT_VERSION_ONLY": false, "OPTION_EXPORT_CINNAMON_THEME": false}

View File

@@ -1 +1 @@
{"window_width": 1892, "window_height": 962, "preset_list_minimal_width": 150, "preset_list_width": 150, "preset_list_sections_expanded": {"presets": true, "plugins": true, "user": true}}
{"window_width": 936, "window_height": 958, "preset_list_minimal_width": 150, "preset_list_width": 150, "preset_list_sections_expanded": {"presets": true, "plugins": true, "user": true}}

View File

@@ -84,7 +84,7 @@ type = internal/battery
; format-low once this charge percentage is reached
; Default: 10
; New in version 3.6.0
low-at = 20
low-at = 25
; Use the following command to list batteries and adapters:
; $ ls -1 /sys/class/power_supply/
@@ -93,17 +93,24 @@ adapter = ACAD
format-charging = <label-charging>
format-discharging = <label-discharging>
format-low = <label-low>
label-charging = %percentage_raw%%
label-discharging = %percentage_raw%%
label-low = %percentage_raw%%
label-low = %percentage%%
format-charging-prefix = "BAT "
format-charging-prefix = "CHRG "
format-charging-prefix-foreground = ${colors.primary}
format-discharging-prefix = "BAT "
format-discharging-prefix-foreground = ${colors.primary}
format-full-prefix = "BAT "
format-full-prefix-foreground = ${colors.primary}
format-low-prefix = "LOW "
format-low-prefix-foreground = ff8585
poll-interval = 5
[module/xworkspaces]
@@ -209,7 +216,7 @@ format-prefix-foreground = ${colors.primary}
[module/backlight]
type = internal/backlight
; $ ls -1 /sys/class/backlight/
card = intel_backlight
card = amdgpu_bl1
use-actual-brightness = true

View File

@@ -1,9 +1,9 @@
[Appearance]
color_scheme_path=/usr/share/qt5ct/colors/airy.conf
custom_palette=false
color_scheme_path=/home/poslop/.config/qt5ct/colors/oomox-rice.conf
custom_palette=true
icon_theme=oomox-rice
standard_dialogs=default
style=gtk2
standard_dialogs=gtk3
style=Windows
[Fonts]
fixed=@Variant(\0\0\0@\0\0\0\x16\0I\0n\0\x63\0o\0n\0s\0o\0l\0\x61\0t\0\x61@(\0\0\0\0\0\0\xff\xff\xff\xff\x5\x1\0K\x10)
@@ -24,8 +24,11 @@ toolbutton_style=4
underline_shortcut=1
wheel_scroll_lines=3
[PaletteEditor]
geometry="@ByteArray(\x1\xd9\xd0\xcb\0\x3\0\0\0\0\x5\0\0\0\x1*\0\0\ax\0\0\x3<\0\0\x5\x1\0\0\x1+\0\0\aw\0\0\x3;\0\0\0\0\0\0\0\0\a\x80\0\0\x5\x1\0\0\x1+\0\0\aw\0\0\x3;)"
[SettingsWindow]
geometry="@ByteArray(\x1\xd9\xd0\xcb\0\x3\0\0\0\0\0\xe\0\0\0=\0\0\aq\0\0\x2+\0\0\0\xf\0\0\0>\0\0\ap\0\0\x2*\0\0\0\0\0\0\0\0\a\x80\0\0\0\xf\0\0\0>\0\0\ap\0\0\x2*)"
geometry=@ByteArray(\x1\xd9\xd0\xcb\0\x3\0\0\0\0\x3\xc7\0\0\0>\0\0\ap\0\0\x4(\0\0\x3\xc8\0\0\0?\0\0\ao\0\0\x4'\0\0\0\0\0\0\0\0\a\x80\0\0\x3\xc8\0\0\0?\0\0\ao\0\0\x4')
[Troubleshooting]
force_raster_widgets=1

View File

@@ -18,7 +18,7 @@ configuration {
/* drun-match-fields: "name,generic,exec,categories,keywords";*/
/* drun-categories: ;*/
/* drun-show-actions: false;*/
/* drun-display-format: "{name} [<span weight='light' size='small'><i>({generic})</i></span>]";*/
drun-display-format: "{name}";
/* drun-url-launcher: "xdg-open";*/
/* disable-history: false;*/
/* ignored-prefixes: "";*/

9
.profile Normal file
View File

@@ -0,0 +1,9 @@
export QT_QPA_PLATFORMTHEME=qt5ct
export GTK_THEME=oomox-rice
#export QT_STYLE_OVERRIDE=gtk2
export QSYS_ROOTDIR="/home/poslop/.cache/yay/quartus-free/pkg/quartus-free-quartus/opt/intelFPGA/21.1/quartus/sopc_builder/bin"
export DISCORD_TOKEN=ODAwNDQ2NDI4NTU1OTAzMDE3.Gp5hQe.lRy1jG5BBFwSjPmRJ36gs1dKciuR4L6xc4lgZg
. "$HOME/.cargo/env"

19
.zshrc
View File

@@ -99,7 +99,24 @@ source $ZSH/oh-my-zsh.sh
# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"
export PATH=$PATH:/home/poslop/.spicetify
alias bctl=bluetoothctl
alias dots='/usr/bin/git --git-dir=$HOME/.git --work-tree=$HOME'
alias bctl=bluetoothctl
export wf='94:DB:56:1A:FB:7F'
export wh='94:DB:56:F7:8A:40'
export sony='AC:BF:71:48:4D:D9'
export PATH="/home/poslop/.cargo/bin:$PATH"
alias ecan="ssh -p 60052 mindustry@goku.ecansol.com"
# Spoons!21
export X86_64_UNKNOWN_LINUX_MUSL_OPENSSL_LIB_DIR="/usr/bin/openssl"
export X86_64_UNKNOWN_LINUX_MUSL_OPENSSL_INCLUDE_DIR="/usr/include/openssl/"
alias rm='rmtrash'
alias rmdir='rmdirtrash'
alias sudo='sudo '

View File

@@ -1,27 +0,0 @@
# Dotfiles
Dotfiles for my Arch Linux rice
## Screenshots
![Ss](/.ricejpg/rice1.jpg?raw=true)
![Ss](/.ricejpg/rice2.jpg?raw=true)
![Ss](/.ricejpg/rice3.jpg?raw=true)
## Things I riced/use
- Alacritty
- Qt
- Gtk
- Oomox ([Theming engine for Gtk/Qt](https://github.com/themix-project/oomox))
- i3-gaps
- Rofi
- Polybar
- Firefox ([This Website/Extension](https://color.firefox.com))
- Youtube ([Enhancer for YouTube Extension](https://addons.mozilla.org/en-US/firefox/addon/enhancer-for-youtube/))
- Discord ([BetterDiscord](https://betterdiscord.app/))
- Spotify ([Spicetify](https://github.com/spicetify/))
- Picom
- [Background Source](https://www.artstation.com/artwork/LeVwnv)