toasts: add toast for kb layout change

Closes #688
This commit is contained in:
2 * r + 2 * t 2025-10-14 01:18:54 +11:00
parent 40f98fb059
commit 73aa3e32de
3 changed files with 11 additions and 0 deletions

View file

@ -588,6 +588,7 @@ default, you must create it manually.
"configLoaded": true,
"dndChanged": true,
"gameModeChanged": true,
"kbLayoutChanged": true,
"numLockChanged": true
}
}

View file

@ -21,5 +21,6 @@ JsonObject {
property bool audioInputChanged: true
property bool capsLockChanged: true
property bool numLockChanged: true
property bool kbLayoutChanged: true
}
}

View file

@ -33,6 +33,8 @@ Singleton {
readonly property alias options: extras.options
readonly property alias devices: extras.devices
property bool hadKeyboard
signal configReloaded
function dispatch(request: string): void {
@ -69,6 +71,13 @@ Singleton {
Toaster.toast(qsTr("Num lock disabled"), qsTr("Num lock is currently disabled"), "timer_1");
}
onKbLayoutFullChanged: {
if (hadKeyboard && Config.utilities.toasts.kbLayoutChanged)
Toaster.toast(qsTr("Keyboard layout changed"), qsTr("Layout changed to: %1").arg(kbLayoutFull), "keyboard");
hadKeyboard = !!keyboard;
}
Connections {
target: Hyprland