parent
71ce357d63
commit
a3ca244c15
3 changed files with 31 additions and 1 deletions
|
|
@ -22,6 +22,7 @@ JsonObject {
|
||||||
|
|
||||||
component Status: JsonObject {
|
component Status: JsonObject {
|
||||||
property bool showAudio: false
|
property bool showAudio: false
|
||||||
|
property bool showKbLayout: false
|
||||||
property bool showNetwork: true
|
property bool showNetwork: true
|
||||||
property bool showBluetooth: true
|
property bool showBluetooth: true
|
||||||
property bool showBattery: true
|
property bool showBattery: true
|
||||||
|
|
|
||||||
|
|
@ -63,6 +63,23 @@ Item {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Keyboard layout icon
|
||||||
|
Loader {
|
||||||
|
id: kbLayout
|
||||||
|
|
||||||
|
Layout.alignment: Qt.AlignHCenter
|
||||||
|
asynchronous: true
|
||||||
|
active: Config.bar.status.showKbLayout
|
||||||
|
visible: active
|
||||||
|
|
||||||
|
sourceComponent: StyledText {
|
||||||
|
animate: true
|
||||||
|
text: Hyprland.kbLayout
|
||||||
|
color: root.colour
|
||||||
|
font.family: Appearance.font.family.mono
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Network icon
|
// Network icon
|
||||||
Loader {
|
Loader {
|
||||||
id: networkIcon
|
id: networkIcon
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ pragma Singleton
|
||||||
|
|
||||||
import Quickshell
|
import Quickshell
|
||||||
import Quickshell.Hyprland
|
import Quickshell.Hyprland
|
||||||
|
import Quickshell.Io
|
||||||
import QtQuick
|
import QtQuick
|
||||||
|
|
||||||
Singleton {
|
Singleton {
|
||||||
|
|
@ -14,6 +15,7 @@ Singleton {
|
||||||
readonly property HyprlandWorkspace focusedWorkspace: Hyprland.focusedWorkspace
|
readonly property HyprlandWorkspace focusedWorkspace: Hyprland.focusedWorkspace
|
||||||
readonly property HyprlandMonitor focusedMonitor: Hyprland.focusedMonitor
|
readonly property HyprlandMonitor focusedMonitor: Hyprland.focusedMonitor
|
||||||
readonly property int activeWsId: focusedWorkspace?.id ?? 1
|
readonly property int activeWsId: focusedWorkspace?.id ?? 1
|
||||||
|
property string kbLayout: "?"
|
||||||
|
|
||||||
function dispatch(request: string): void {
|
function dispatch(request: string): void {
|
||||||
Hyprland.dispatch(request);
|
Hyprland.dispatch(request);
|
||||||
|
|
@ -27,7 +29,9 @@ Singleton {
|
||||||
if (n.endsWith("v2"))
|
if (n.endsWith("v2"))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (["workspace", "moveworkspace", "activespecial", "focusedmon"].includes(n)) {
|
if (n === "activelayout") {
|
||||||
|
root.kbLayout = event.parse(2)[1];
|
||||||
|
} else if (["workspace", "moveworkspace", "activespecial", "focusedmon"].includes(n)) {
|
||||||
Hyprland.refreshWorkspaces();
|
Hyprland.refreshWorkspaces();
|
||||||
Hyprland.refreshMonitors();
|
Hyprland.refreshMonitors();
|
||||||
} else if (["openwindow", "closewindow", "movewindow"].includes(n)) {
|
} else if (["openwindow", "closewindow", "movewindow"].includes(n)) {
|
||||||
|
|
@ -42,4 +46,12 @@ Singleton {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Process {
|
||||||
|
running: true
|
||||||
|
command: ["hyprctl", "-j", "devices"]
|
||||||
|
stdout: StdioCollector {
|
||||||
|
onStreamFinished: root.kbLayout = JSON.parse(text).keyboards.find(k => k.main).layout
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue