internal: rename Hyprland -> Hypr
Prevent shadowing Fixes window info not changing on switching to an empty workspace
This commit is contained in:
parent
3f160d7b1d
commit
d1e5f48446
14 changed files with 39 additions and 40 deletions
|
|
@ -37,8 +37,8 @@ MouseArea {
|
|||
property real sh: Math.abs(sy - ey)
|
||||
|
||||
property list<var> clients: {
|
||||
const ws = Hyprland.activeToplevel?.workspace?.id ?? Hyprland.activeWsId;
|
||||
return Hyprland.toplevels.values.filter(c => c.workspace?.id === ws).sort((a, b) => {
|
||||
const ws = Hypr.activeToplevel?.workspace?.id ?? Hypr.activeWsId;
|
||||
return Hypr.toplevels.values.filter(c => c.workspace?.id === ws).sort((a, b) => {
|
||||
// Pinned first, then fullscreen, then floating, then any other
|
||||
const ac = a.lastIpcObject;
|
||||
const bc = b.lastIpcObject;
|
||||
|
|
@ -164,7 +164,7 @@ MouseArea {
|
|||
}
|
||||
|
||||
Connections {
|
||||
target: Hyprland
|
||||
target: Hypr
|
||||
|
||||
function onActiveWsIdChanged(): void {
|
||||
root.checkClientRects(root.mouseX, root.mouseY);
|
||||
|
|
|
|||
|
|
@ -56,12 +56,12 @@ ColumnLayout {
|
|||
const ch = childAt(width / 2, y) as WrappedLoader;
|
||||
if (ch?.id === "workspaces") {
|
||||
// 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;
|
||||
if (specialWs?.length > 0)
|
||||
Hyprland.dispatch(`togglespecialworkspace ${specialWs.slice(8)}`);
|
||||
else if (angleDelta.y < 0 || (Config.bar.workspaces.perMonitorWorkspaces ? mon.activeWorkspace?.id : Hyprland.activeWsId) > 1)
|
||||
Hyprland.dispatch(`workspace r${angleDelta.y > 0 ? "-" : "+"}1`);
|
||||
Hypr.dispatch(`togglespecialworkspace ${specialWs.slice(8)}`);
|
||||
else if (angleDelta.y < 0 || (Config.bar.workspaces.perMonitorWorkspaces ? mon.activeWorkspace?.id : Hypr.activeWsId) > 1)
|
||||
Hypr.dispatch(`workspace r${angleDelta.y > 0 ? "-" : "+"}1`);
|
||||
} else if (y < screen.height / 2) {
|
||||
// Volume scroll on top half
|
||||
if (angleDelta.y > 0)
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ Item {
|
|||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
|
||||
animate: true
|
||||
text: Icons.getAppCategoryIcon(Hyprland.activeToplevel?.lastIpcObject.class, "desktop_windows")
|
||||
text: Icons.getAppCategoryIcon(Hypr.activeToplevel?.lastIpcObject.class, "desktop_windows")
|
||||
color: root.colour
|
||||
}
|
||||
|
||||
|
|
@ -46,7 +46,7 @@ Item {
|
|||
TextMetrics {
|
||||
id: metrics
|
||||
|
||||
text: Hyprland.activeToplevel?.title ?? qsTr("Desktop")
|
||||
text: Hypr.activeToplevel?.title ?? qsTr("Desktop")
|
||||
font.pointSize: Appearance.font.size.smaller
|
||||
font.family: Appearance.font.family.mono
|
||||
elide: Qt.ElideRight
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ StyledRect {
|
|||
|
||||
sourceComponent: StyledText {
|
||||
animate: true
|
||||
text: Hyprland.kbLayout
|
||||
text: Hypr.kbLayout
|
||||
color: root.colour
|
||||
font.family: Appearance.font.family.mono
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,8 +14,8 @@ Item {
|
|||
id: root
|
||||
|
||||
required property ShellScreen screen
|
||||
readonly property HyprlandMonitor monitor: Hyprland.monitorFor(screen)
|
||||
readonly property string activeSpecial: (Config.bar.workspaces.perMonitorWorkspaces ? monitor : Hyprland.focusedMonitor)?.lastIpcObject.specialWorkspace.name ?? ""
|
||||
readonly property HyprlandMonitor monitor: Hypr.monitorFor(screen)
|
||||
readonly property string activeSpecial: (Config.bar.workspaces.perMonitorWorkspaces ? monitor : Hypr.focusedMonitor)?.lastIpcObject.specialWorkspace.name ?? ""
|
||||
|
||||
layer.enabled: true
|
||||
layer.effect: ShaderEffect {
|
||||
|
|
@ -98,7 +98,7 @@ Item {
|
|||
onCurrentIndexChanged: currentIndex = Qt.binding(() => model.values.findIndex(w => w.name === root.activeSpecial))
|
||||
|
||||
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
|
||||
|
|
@ -229,7 +229,7 @@ Item {
|
|||
|
||||
Repeater {
|
||||
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 {
|
||||
|
|
@ -357,9 +357,9 @@ Item {
|
|||
|
||||
const ws = view.itemAt(event.x, event.y);
|
||||
if (ws?.modelData)
|
||||
Hyprland.dispatch(`togglespecialworkspace ${ws.modelData.name.slice(8)}`);
|
||||
Hypr.dispatch(`togglespecialworkspace ${ws.modelData.name.slice(8)}`);
|
||||
else
|
||||
Hyprland.dispatch("togglespecialworkspace special");
|
||||
Hypr.dispatch("togglespecialworkspace special");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ ColumnLayout {
|
|||
|
||||
Repeater {
|
||||
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 {
|
||||
|
|
|
|||
|
|
@ -13,10 +13,10 @@ StyledClippingRect {
|
|||
|
||||
required property ShellScreen screen
|
||||
|
||||
readonly property bool onSpecial: (Config.bar.workspaces.perMonitorWorkspaces ? Hyprland.monitorFor(screen) : Hyprland.focusedMonitor)?.lastIpcObject.specialWorkspace.name !== ""
|
||||
readonly property int activeWsId: Config.bar.workspaces.perMonitorWorkspaces ? (Hyprland.monitorFor(screen).activeWorkspace?.id ?? 1) : Hyprland.activeWsId
|
||||
readonly property bool onSpecial: (Config.bar.workspaces.perMonitorWorkspaces ? Hypr.monitorFor(screen) : Hypr.focusedMonitor)?.lastIpcObject.specialWorkspace.name !== ""
|
||||
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;
|
||||
return acc;
|
||||
}, {})
|
||||
|
|
@ -91,10 +91,10 @@ StyledClippingRect {
|
|||
anchors.fill: layout
|
||||
onClicked: event => {
|
||||
const ws = layout.childAt(event.x, event.y).index + root.groupOffset + 1;
|
||||
if (Hyprland.activeWsId !== ws)
|
||||
Hyprland.dispatch(`workspace ${ws}`);
|
||||
if (Hypr.activeWsId !== ws)
|
||||
Hypr.dispatch(`workspace ${ws}`);
|
||||
else
|
||||
Hyprland.dispatch("togglespecialworkspace special");
|
||||
Hypr.dispatch("togglespecialworkspace special");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ Item {
|
|||
|
||||
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
|
||||
|
||||
Column {
|
||||
|
|
@ -33,7 +33,7 @@ Item {
|
|||
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
implicitSize: details.implicitHeight
|
||||
source: Icons.getAppIcon(Hyprland.activeToplevel?.lastIpcObject.class ?? "", "image-missing")
|
||||
source: Icons.getAppIcon(Hypr.activeToplevel?.lastIpcObject.class ?? "", "image-missing")
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
|
|
@ -44,14 +44,14 @@ Item {
|
|||
|
||||
StyledText {
|
||||
Layout.fillWidth: true
|
||||
text: Hyprland.activeToplevel?.title ?? ""
|
||||
text: Hypr.activeToplevel?.title ?? ""
|
||||
font.pointSize: Appearance.font.size.normal
|
||||
elide: Text.ElideRight
|
||||
}
|
||||
|
||||
StyledText {
|
||||
Layout.fillWidth: true
|
||||
text: Hyprland.activeToplevel?.lastIpcObject.class ?? ""
|
||||
text: Hypr.activeToplevel?.lastIpcObject.class ?? ""
|
||||
color: Colours.palette.m3onSurfaceVariant
|
||||
elide: Text.ElideRight
|
||||
}
|
||||
|
|
@ -91,7 +91,7 @@ Item {
|
|||
ScreencopyView {
|
||||
id: preview
|
||||
|
||||
captureSource: Hyprland.activeToplevel?.wayland ?? null
|
||||
captureSource: Hypr.activeToplevel?.wayland ?? null
|
||||
live: visible
|
||||
|
||||
constraintSize.width: Config.bar.sizes.windowPreviewSize
|
||||
|
|
|
|||
|
|
@ -2,5 +2,5 @@ import qs.components
|
|||
import qs.services
|
||||
|
||||
StyledText {
|
||||
text: qsTr("Keyboard layout: %1").arg(Hyprland.kbLayoutFull)
|
||||
text: qsTr("Keyboard layout: %1").arg(Hypr.kbLayoutFull)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ Item {
|
|||
|
||||
sourceComponent: WindowInfo {
|
||||
screen: root.screen
|
||||
client: Hyprland.activeToplevel
|
||||
client: Hypr.activeToplevel
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ ColumnLayout {
|
|||
|
||||
Button {
|
||||
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
|
||||
|
||||
color: isCurrent ? Colours.tPalette.m3surfaceContainerHighest : Colours.palette.m3tertiaryContainer
|
||||
|
|
@ -87,7 +87,7 @@ ColumnLayout {
|
|||
disabled: isCurrent
|
||||
|
||||
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")
|
||||
|
||||
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")
|
||||
|
||||
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")
|
||||
|
||||
function onClicked(): void {
|
||||
Hyprland.dispatch(`killwindow address:0x${root.client?.address}`);
|
||||
Hypr.dispatch(`killwindow address:0x${root.client?.address}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,14 +18,14 @@ Singleton {
|
|||
}
|
||||
|
||||
function increaseBrightness(): void {
|
||||
const focusedName = Hyprland.focusedMonitor.name;
|
||||
const focusedName = Hypr.focusedMonitor.name;
|
||||
const monitor = monitors.find(m => focusedName === m.modelData.name);
|
||||
if (monitor)
|
||||
monitor.setBrightness(monitor.brightness + 0.1);
|
||||
}
|
||||
|
||||
function decreaseBrightness(): void {
|
||||
const focusedName = Hyprland.focusedMonitor.name;
|
||||
const focusedName = Hypr.focusedMonitor.name;
|
||||
const monitor = monitors.find(m => focusedName === m.modelData.name);
|
||||
if (monitor)
|
||||
monitor.setBrightness(monitor.brightness - 0.1);
|
||||
|
|
|
|||
|
|
@ -1,16 +1,15 @@
|
|||
pragma Singleton
|
||||
|
||||
import Quickshell
|
||||
import Quickshell.Hyprland
|
||||
|
||||
Singleton {
|
||||
property var screens: new Map()
|
||||
|
||||
function load(screen: ShellScreen, visibilities: var): void {
|
||||
screens.set(Hyprland.monitorFor(screen), visibilities);
|
||||
screens.set(Hypr.monitorFor(screen), visibilities);
|
||||
}
|
||||
|
||||
function getForActive(): PersistentProperties {
|
||||
return screens.get(Hyprland.focusedMonitor);
|
||||
return screens.get(Hypr.focusedMonitor);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue