Compare commits

..

No commits in common. "c9e7e7022b982f0dc05f2e5c16d390c7f0c9bcb2" and "6e1fb585e30d3503dd120f19e64535005357ffc7" have entirely different histories.

7 changed files with 44 additions and 31 deletions

View file

@ -128,6 +128,7 @@ Singleton {
}
readonly property QtObject notifs: QtObject {
readonly property bool expire: true
readonly property int defaultExpireTimeout: 5000
readonly property real clearThreshold: 0.3
@ -175,7 +176,7 @@ Singleton {
readonly property real buttonSize: 64
property list<string> logout: ["hyprctl", "dispatch", "exit"]
property list<string> lock: ["hyprlock"]
property list<string> lock: ["hyprlock", "--immediate"]
property list<string> suspend: ["systemctl", "suspend"]
property list<string> hibernate: ["systemctl", "suspend-then-hibernate"]
property list<string> sleep: suspend

View file

@ -23,7 +23,7 @@ ColumnLayout {
Toggle {
label.text: qsTr("Inhibit While Playing Audio")
checked: Idle.inhibitPipewire
toggle.onToggled: Idle.inhibitPipewire = !Idle.inhibitPipewire
toggle.onToggled: Idle.toggleInhibitPipewire()
}
component Toggle: RowLayout {

View file

@ -107,7 +107,7 @@ ColumnLayout {
Column {
anchors.centerIn: parent
readonly property color color: res.warning1 ? Color.mute(Config.colors.error, 1.2, 1.1) :
readonly property color color: res.warning1 ? Color.mute(Config.colors.error, 1.3, 1.2) :
res.value1 === 0 ? Config.colors.inactive : Config.colors.primary
CustomText {
@ -133,7 +133,7 @@ ColumnLayout {
anchors.horizontalCenterOffset: -res.thickness / 2
anchors.topMargin: res.thickness / 2 + 5
readonly property color color: res.warning2 ? Color.mute(Config.colors.error, 1.2, 1.1) :
readonly property color color: res.warning2 ? Color.mute(Config.colors.error, 1.3, 1.2) :
res.value2 === 0 ? Config.colors.inactive : Config.colors.primary
CustomText {

View file

@ -21,32 +21,29 @@ CustomMouseArea {
property bool dashboardShortcutActive
anchors.fill: parent
// HACK: Fixes weird pixel alignment issues that drop mouse events
anchors.rightMargin: -1
anchors.bottomMargin: -1
hoverEnabled: true
function withinPanelWidth(panel: Item, x: real): bool {
const panelX = panel.x + Config.border.thickness;
const panelX = panel.x;
return x >= panelX - Config.border.rounding && x <= panelX + panel.width + Config.border.rounding;
}
function withinPanelHeight(panel: Item, y: real): bool {
const panelY = panel.y + Config.bar.height;
return y >= panelY - Config.border.rounding && y <= panelY + panel.height + Config.border.rounding;
const panelY = panel.y;
return y >= panelY + Config.bar.height - Config.border.rounding
&& y <= panelY + panel.height + Config.bar.height + Config.border.rounding;
}
function inBottomPanel(panel: Item, x: real, y: real): bool {
return y > panel.y + Config.bar.height && withinPanelWidth(panel, x);
return y > root.height - Config.border.thickness - panel.height - Config.border.rounding && withinPanelWidth(panel, x);
}
function inLeftPanel(panel: Item, x: real, y: real): bool {
return x < panel.x + panel.width + Config.border.thickness && withinPanelHeight(panel, y);
return x < Config.border.thickness + panel.x + panel.width && withinPanelHeight(panel, y);
}
function inRightPanel(panel: Item, x: real, y: real): bool {
return x > panel.x + Config.border.thickness && withinPanelHeight(panel, y);
return x > Config.border.thickness + panel.x && withinPanelHeight(panel, y);
}
// Handling Mouse Input

View file

@ -30,7 +30,6 @@ Variants {
UIState {
id: uiState
window: window
screen: scope.modelData
}

View file

@ -8,15 +8,12 @@ import Quickshell.Hyprland
Scope {
id: root
required property QtObject window
required property ShellScreen screen
property alias uiState: uiState
PersistentProperties {
id: uiState
reloadableId: `uiState-${root.screen.name}`
readonly property QtObject window: root.window
reloadableId: `uiState-${QsWindow.window.screen.name}`
// Open panels
property bool dashboard

View file

@ -1,28 +1,47 @@
pragma Singleton
import qs.util
import QtQuick
import Quickshell
import Quickshell.Wayland
import Quickshell.Services.Pipewire
import Quickshell.Io
Singleton {
id: root
property bool inhibit: false
property bool inhibitPipewire: true
property alias inhibit: inhibitor.running
property bool inhibitPipewire
IdleInhibitor {
id: inhibitor
enabled: root.inhibit ||
(root.inhibitPipewire &&
!!Pipewire.nodes.values.find(node => node.isSink && node.isStream))
window: null
function toggleInhibitPipewire() {
root.inhibitPipewire = !root.inhibitPipewire;
pipewireInhibitor.running = true;
}
// Idle Inhibitor
Process {
id: inhibitor
command: ["wayland-idle-inhibitor"]
}
// Idle Inhibit on Pipewire
readonly property string pipewireInhibitorService: "wayland-pipewire-idle-inhibit.service"
Timer {
id: pipewireInhibitorTimer
running: true
repeat: true
onTriggered: inhibitor.window = States.screens.values().next()?.value?.window
triggeredOnStart: true
onTriggered: pipewireInhibitorCheck.running = true
}
Process {
id: pipewireInhibitorCheck
command: ["systemctl", "status", "--user", root.pipewireInhibitorService]
onExited: (code, _) => root.inhibitPipewire = (code === 0)
}
Process {
id: pipewireInhibitor
command: ["systemctl", root.inhibitPipewire ? "start" : "stop", "--user", root.pipewireInhibitorService]
}
}