WaylandKeybinds: localized info panel with setup steps
- Info panel in the plugin modal: live status with the number of keybinds GNOME registered, the three setup steps and a button that opens Discord's Keybinds page (closes only the plugin modal, which otherwise blocks settings navigation). - Follows Discord's language: English, Portuguese (pt-BR) and Spanish (es-ES and es-419 use each region's action names); bold labels quote Discord's own strings. - Shared helpers moved to discord.ts; copy and locale choice in copy.ts, covered by basis-path tests (41 tests). - README: current settings path (User Settings > System > Keybinds).
This commit is contained in:
1 parent
a3a9149184
commit
34b61e2509
7 files changed
+351
-18
No files matched your search
+24
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* Vencord, a Discord client mod
|
||||
* Copyright (c) 2026 Evandro
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
import { IS_LINUX } from "@utils/constants";
|
||||
import { findStoreLazy } from "@webpack";
|
||||
|
||||
export type Shortcut = [number, number, ...unknown[]][];
|
||||
|
||||
export const KeybindsStore = findStoreLazy("KeybindsStore");
|
||||
|
||||
export function discordUtils() {
|
||||
return DiscordNative.nativeModules.requireModule("discord_utils");
|
||||
}
|
||||
|
||||
export function portalActive(): boolean {
|
||||
return IS_LINUX && discordUtils().isWaylandGlobalShortcutsAvailable?.() === true;
|
||||
}
|
||||
|
||||
export function portalTrigger(shortcut: Shortcut): string {
|
||||
return discordUtils().getWaylandPortalTrigger?.(shortcut.map(([type, code]) => [type, code])) ?? "";
|
||||
}
|
||||
Reference in new issue
Block a user