- 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).
25 lines
729 B
TypeScript
25 lines
729 B
TypeScript
/*
|
|
* 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])) ?? "";
|
|
}
|