internal: rename Hyprland -> Hypr

Prevent shadowing
Fixes window info not changing on switching to an empty workspace
This commit is contained in:
2 * r + 2 * t 2025-08-24 14:14:30 +10:00
parent 3f160d7b1d
commit d1e5f48446
14 changed files with 39 additions and 40 deletions

View file

@ -37,8 +37,8 @@ MouseArea {
property real sh: Math.abs(sy - ey) property real sh: Math.abs(sy - ey)
property list<var> clients: { property list<var> clients: {
const ws = Hyprland.activeToplevel?.workspace?.id ?? Hyprland.activeWsId; const ws = Hypr.activeToplevel?.workspace?.id ?? Hypr.activeWsId;
return Hyprland.toplevels.values.filter(c => c.workspace?.id === ws).sort((a, b) => { return Hypr.toplevels.values.filter(c => c.workspace?.id === ws).sort((a, b) => {
// Pinned first, then fullscreen, then floating, then any other // Pinned first, then fullscreen, then floating, then any other
const ac = a.lastIpcObject; const ac = a.lastIpcObject;
const bc = b.lastIpcObject; const bc = b.lastIpcObject;
@ -164,7 +164,7 @@ MouseArea {
} }
Connections { Connections {
target: Hyprland target: Hypr
function onActiveWsIdChanged(): void { function onActiveWsIdChanged(): void {
root.checkClientRects(root.mouseX, root.mouseY); root.checkClientRects(root.mouseX, root.mouseY);

View file

@ -56,12 +56,12 @@ ColumnLayout {
const ch = childAt(width / 2, y) as WrappedLoader; const ch = childAt(width / 2, y) as WrappedLoader;
if (ch?.id === "workspaces") { if (ch?.id === "workspaces") {
// Workspace scroll // Workspace scroll
const mon = (Config.bar.workspaces.perMonitorWorkspaces ? Hyprland.monitorFor(screen) : Hyprland.focusedMonitor); const mon = (Config.bar.workspaces.perMonitorWorkspaces ? Hypr.monitorFor(screen) : Hypr.focusedMonitor);
const specialWs = mon?.lastIpcObject.specialWorkspace.name; const specialWs = mon?.lastIpcObject.specialWorkspace.name;
if (specialWs?.length > 0) if (specialWs?.length > 0)
Hyprland.dispatch(`togglespecialworkspace ${specialWs.slice(8)}`); Hypr.dispatch(`togglespecialworkspace ${specialWs.slice(8)}`);
else if (angleDelta.y < 0 || (Config.bar.workspaces.perMonitorWorkspaces ? mon.activeWorkspace?.id : Hyprland.activeWsId) > 1) else if (angleDelta.y < 0 || (Config.bar.workspaces.perMonitorWorkspaces ? mon.activeWorkspace?.id : Hypr.activeWsId) > 1)
Hyprland.dispatch(`workspace r${angleDelta.y > 0 ? "-" : "+"}1`); Hypr.dispatch(`workspace r${angleDelta.y > 0 ? "-" : "+"}1`);
} else if (y < screen.height / 2) { } else if (y < screen.height / 2) {
// Volume scroll on top half // Volume scroll on top half
if (angleDelta.y > 0) if (angleDelta.y > 0)

View file

@ -31,7 +31,7 @@ Item {
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
animate: true animate: true
text: Icons.getAppCategoryIcon(Hyprland.activeToplevel?.lastIpcObject.class, "desktop_windows") text: Icons.getAppCategoryIcon(Hypr.activeToplevel?.lastIpcObject.class, "desktop_windows")
color: root.colour color: root.colour
} }
@ -46,7 +46,7 @@ Item {
TextMetrics { TextMetrics {
id: metrics id: metrics
text: Hyprland.activeToplevel?.title ?? qsTr("Desktop") text: Hypr.activeToplevel?.title ?? qsTr("Desktop")
font.pointSize: Appearance.font.size.smaller font.pointSize: Appearance.font.size.smaller
font.family: Appearance.font.family.mono font.family: Appearance.font.family.mono
elide: Qt.ElideRight elide: Qt.ElideRight

View file

@ -48,7 +48,7 @@ StyledRect {
sourceComponent: StyledText { sourceComponent: StyledText {
animate: true animate: true
text: Hyprland.kbLayout text: Hypr.kbLayout
color: root.colour color: root.colour
font.family: Appearance.font.family.mono font.family: Appearance.font.family.mono
} }

View file

@ -14,8 +14,8 @@ Item {
id: root id: root
required property ShellScreen screen required property ShellScreen screen
readonly property HyprlandMonitor monitor: Hyprland.monitorFor(screen) readonly property HyprlandMonitor monitor: Hypr.monitorFor(screen)
readonly property string activeSpecial: (Config.bar.workspaces.perMonitorWorkspaces ? monitor : Hyprland.focusedMonitor)?.lastIpcObject.specialWorkspace.name ?? "" readonly property string activeSpecial: (Config.bar.workspaces.perMonitorWorkspaces ? monitor : Hypr.focusedMonitor)?.lastIpcObject.specialWorkspace.name ?? ""
layer.enabled: true layer.enabled: true
layer.effect: ShaderEffect { layer.effect: ShaderEffect {
@ -98,7 +98,7 @@ Item {
onCurrentIndexChanged: currentIndex = Qt.binding(() => model.values.findIndex(w => w.name === root.activeSpecial)) onCurrentIndexChanged: currentIndex = Qt.binding(() => model.values.findIndex(w => w.name === root.activeSpecial))
model: ScriptModel { model: ScriptModel {
values: Hyprland.workspaces.values.filter(w => w.name.startsWith("special:") && (!Config.bar.workspaces.perMonitorWorkspaces || w.monitor === root.monitor)) values: Hypr.workspaces.values.filter(w => w.name.startsWith("special:") && (!Config.bar.workspaces.perMonitorWorkspaces || w.monitor === root.monitor))
} }
preferredHighlightBegin: 0 preferredHighlightBegin: 0
@ -229,7 +229,7 @@ Item {
Repeater { Repeater {
model: ScriptModel { model: ScriptModel {
values: Hyprland.toplevels.values.filter(c => c.workspace?.id === ws.wsId) values: Hypr.toplevels.values.filter(c => c.workspace?.id === ws.wsId)
} }
MaterialIcon { MaterialIcon {
@ -357,9 +357,9 @@ Item {
const ws = view.itemAt(event.x, event.y); const ws = view.itemAt(event.x, event.y);
if (ws?.modelData) if (ws?.modelData)
Hyprland.dispatch(`togglespecialworkspace ${ws.modelData.name.slice(8)}`); Hypr.dispatch(`togglespecialworkspace ${ws.modelData.name.slice(8)}`);
else else
Hyprland.dispatch("togglespecialworkspace special"); Hypr.dispatch("togglespecialworkspace special");
} }
} }

View file

@ -80,7 +80,7 @@ ColumnLayout {
Repeater { Repeater {
model: ScriptModel { model: ScriptModel {
values: Hyprland.toplevels.values.filter(c => c.workspace?.id === root.ws) values: Hypr.toplevels.values.filter(c => c.workspace?.id === root.ws)
} }
MaterialIcon { MaterialIcon {

View file

@ -13,10 +13,10 @@ StyledClippingRect {
required property ShellScreen screen required property ShellScreen screen
readonly property bool onSpecial: (Config.bar.workspaces.perMonitorWorkspaces ? Hyprland.monitorFor(screen) : Hyprland.focusedMonitor)?.lastIpcObject.specialWorkspace.name !== "" readonly property bool onSpecial: (Config.bar.workspaces.perMonitorWorkspaces ? Hypr.monitorFor(screen) : Hypr.focusedMonitor)?.lastIpcObject.specialWorkspace.name !== ""
readonly property int activeWsId: Config.bar.workspaces.perMonitorWorkspaces ? (Hyprland.monitorFor(screen).activeWorkspace?.id ?? 1) : Hyprland.activeWsId readonly property int activeWsId: Config.bar.workspaces.perMonitorWorkspaces ? (Hypr.monitorFor(screen).activeWorkspace?.id ?? 1) : Hypr.activeWsId
readonly property var occupied: Hyprland.workspaces.values.reduce((acc, curr) => { readonly property var occupied: Hypr.workspaces.values.reduce((acc, curr) => {
acc[curr.id] = curr.lastIpcObject.windows > 0; acc[curr.id] = curr.lastIpcObject.windows > 0;
return acc; return acc;
}, {}) }, {})
@ -91,10 +91,10 @@ StyledClippingRect {
anchors.fill: layout anchors.fill: layout
onClicked: event => { onClicked: event => {
const ws = layout.childAt(event.x, event.y).index + root.groupOffset + 1; const ws = layout.childAt(event.x, event.y).index + root.groupOffset + 1;
if (Hyprland.activeWsId !== ws) if (Hypr.activeWsId !== ws)
Hyprland.dispatch(`workspace ${ws}`); Hypr.dispatch(`workspace ${ws}`);
else else
Hyprland.dispatch("togglespecialworkspace special"); Hypr.dispatch("togglespecialworkspace special");
} }
} }

View file

@ -12,7 +12,7 @@ Item {
required property Item wrapper required property Item wrapper
implicitWidth: Hyprland.activeToplevel ? child.implicitWidth : -Appearance.padding.large * 2 implicitWidth: Hypr.activeToplevel ? child.implicitWidth : -Appearance.padding.large * 2
implicitHeight: child.implicitHeight implicitHeight: child.implicitHeight
Column { Column {
@ -33,7 +33,7 @@ Item {
Layout.alignment: Qt.AlignVCenter Layout.alignment: Qt.AlignVCenter
implicitSize: details.implicitHeight implicitSize: details.implicitHeight
source: Icons.getAppIcon(Hyprland.activeToplevel?.lastIpcObject.class ?? "", "image-missing") source: Icons.getAppIcon(Hypr.activeToplevel?.lastIpcObject.class ?? "", "image-missing")
} }
ColumnLayout { ColumnLayout {
@ -44,14 +44,14 @@ Item {
StyledText { StyledText {
Layout.fillWidth: true Layout.fillWidth: true
text: Hyprland.activeToplevel?.title ?? "" text: Hypr.activeToplevel?.title ?? ""
font.pointSize: Appearance.font.size.normal font.pointSize: Appearance.font.size.normal
elide: Text.ElideRight elide: Text.ElideRight
} }
StyledText { StyledText {
Layout.fillWidth: true Layout.fillWidth: true
text: Hyprland.activeToplevel?.lastIpcObject.class ?? "" text: Hypr.activeToplevel?.lastIpcObject.class ?? ""
color: Colours.palette.m3onSurfaceVariant color: Colours.palette.m3onSurfaceVariant
elide: Text.ElideRight elide: Text.ElideRight
} }
@ -91,7 +91,7 @@ Item {
ScreencopyView { ScreencopyView {
id: preview id: preview
captureSource: Hyprland.activeToplevel?.wayland ?? null captureSource: Hypr.activeToplevel?.wayland ?? null
live: visible live: visible
constraintSize.width: Config.bar.sizes.windowPreviewSize constraintSize.width: Config.bar.sizes.windowPreviewSize

View file

@ -2,5 +2,5 @@ import qs.components
import qs.services import qs.services
StyledText { StyledText {
text: qsTr("Keyboard layout: %1").arg(Hyprland.kbLayoutFull) text: qsTr("Keyboard layout: %1").arg(Hypr.kbLayoutFull)
} }

View file

@ -89,7 +89,7 @@ Item {
sourceComponent: WindowInfo { sourceComponent: WindowInfo {
screen: root.screen screen: root.screen
client: Hyprland.activeToplevel client: Hypr.activeToplevel
} }
} }

View file

@ -78,7 +78,7 @@ ColumnLayout {
Button { Button {
required property int index required property int index
readonly property int wsId: Math.floor((Hyprland.activeWsId - 1) / 10) * 10 + index + 1 readonly property int wsId: Math.floor((Hypr.activeWsId - 1) / 10) * 10 + index + 1
readonly property bool isCurrent: root.client?.workspace.id === wsId readonly property bool isCurrent: root.client?.workspace.id === wsId
color: isCurrent ? Colours.tPalette.m3surfaceContainerHighest : Colours.palette.m3tertiaryContainer color: isCurrent ? Colours.tPalette.m3surfaceContainerHighest : Colours.palette.m3tertiaryContainer
@ -87,7 +87,7 @@ ColumnLayout {
disabled: isCurrent disabled: isCurrent
function onClicked(): void { function onClicked(): void {
Hyprland.dispatch(`movetoworkspace ${wsId},address:0x${root.client?.address}`); Hypr.dispatch(`movetoworkspace ${wsId},address:0x${root.client?.address}`);
} }
} }
} }
@ -116,7 +116,7 @@ ColumnLayout {
text: root.client?.lastIpcObject.floating ? qsTr("Tile") : qsTr("Float") text: root.client?.lastIpcObject.floating ? qsTr("Tile") : qsTr("Float")
function onClicked(): void { function onClicked(): void {
Hyprland.dispatch(`togglefloating address:0x${root.client?.address}`); Hypr.dispatch(`togglefloating address:0x${root.client?.address}`);
} }
} }
@ -133,7 +133,7 @@ ColumnLayout {
text: root.client?.lastIpcObject.pinned ? qsTr("Unpin") : qsTr("Pin") text: root.client?.lastIpcObject.pinned ? qsTr("Unpin") : qsTr("Pin")
function onClicked(): void { function onClicked(): void {
Hyprland.dispatch(`pin address:0x${root.client?.address}`); Hypr.dispatch(`pin address:0x${root.client?.address}`);
} }
} }
} }
@ -144,7 +144,7 @@ ColumnLayout {
text: qsTr("Kill") text: qsTr("Kill")
function onClicked(): void { function onClicked(): void {
Hyprland.dispatch(`killwindow address:0x${root.client?.address}`); Hypr.dispatch(`killwindow address:0x${root.client?.address}`);
} }
} }
} }

View file

@ -18,14 +18,14 @@ Singleton {
} }
function increaseBrightness(): void { function increaseBrightness(): void {
const focusedName = Hyprland.focusedMonitor.name; const focusedName = Hypr.focusedMonitor.name;
const monitor = monitors.find(m => focusedName === m.modelData.name); const monitor = monitors.find(m => focusedName === m.modelData.name);
if (monitor) if (monitor)
monitor.setBrightness(monitor.brightness + 0.1); monitor.setBrightness(monitor.brightness + 0.1);
} }
function decreaseBrightness(): void { function decreaseBrightness(): void {
const focusedName = Hyprland.focusedMonitor.name; const focusedName = Hypr.focusedMonitor.name;
const monitor = monitors.find(m => focusedName === m.modelData.name); const monitor = monitors.find(m => focusedName === m.modelData.name);
if (monitor) if (monitor)
monitor.setBrightness(monitor.brightness - 0.1); monitor.setBrightness(monitor.brightness - 0.1);

View file

@ -1,16 +1,15 @@
pragma Singleton pragma Singleton
import Quickshell import Quickshell
import Quickshell.Hyprland
Singleton { Singleton {
property var screens: new Map() property var screens: new Map()
function load(screen: ShellScreen, visibilities: var): void { function load(screen: ShellScreen, visibilities: var): void {
screens.set(Hyprland.monitorFor(screen), visibilities); screens.set(Hypr.monitorFor(screen), visibilities);
} }
function getForActive(): PersistentProperties { function getForActive(): PersistentProperties {
return screens.get(Hyprland.focusedMonitor); return screens.get(Hypr.focusedMonitor);
} }
} }