Compare commits
4 commits
6e1fb585e3
...
c9e7e7022b
| Author | SHA1 | Date | |
|---|---|---|---|
| c9e7e7022b | |||
| e82bdbc9a2 | |||
| f62e017536 | |||
| 13c7526440 |
7 changed files with 30 additions and 43 deletions
|
|
@ -128,7 +128,6 @@ Singleton {
|
|||
}
|
||||
|
||||
readonly property QtObject notifs: QtObject {
|
||||
readonly property bool expire: true
|
||||
readonly property int defaultExpireTimeout: 5000
|
||||
readonly property real clearThreshold: 0.3
|
||||
|
||||
|
|
@ -176,7 +175,7 @@ Singleton {
|
|||
readonly property real buttonSize: 64
|
||||
|
||||
property list<string> logout: ["hyprctl", "dispatch", "exit"]
|
||||
property list<string> lock: ["hyprlock", "--immediate"]
|
||||
property list<string> lock: ["hyprlock"]
|
||||
property list<string> suspend: ["systemctl", "suspend"]
|
||||
property list<string> hibernate: ["systemctl", "suspend-then-hibernate"]
|
||||
property list<string> sleep: suspend
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ ColumnLayout {
|
|||
Toggle {
|
||||
label.text: qsTr("Inhibit While Playing Audio")
|
||||
checked: Idle.inhibitPipewire
|
||||
toggle.onToggled: Idle.toggleInhibitPipewire()
|
||||
toggle.onToggled: Idle.inhibitPipewire = !Idle.inhibitPipewire
|
||||
}
|
||||
|
||||
component Toggle: RowLayout {
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ ColumnLayout {
|
|||
Column {
|
||||
anchors.centerIn: parent
|
||||
|
||||
readonly property color color: res.warning1 ? Color.mute(Config.colors.error, 1.3, 1.2) :
|
||||
readonly property color color: res.warning1 ? Color.mute(Config.colors.error, 1.2, 1.1) :
|
||||
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.3, 1.2) :
|
||||
readonly property color color: res.warning2 ? Color.mute(Config.colors.error, 1.2, 1.1) :
|
||||
res.value2 === 0 ? Config.colors.inactive : Config.colors.primary
|
||||
|
||||
CustomText {
|
||||
|
|
|
|||
|
|
@ -21,29 +21,32 @@ 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;
|
||||
const panelX = panel.x + Config.border.thickness;
|
||||
return x >= panelX - Config.border.rounding && x <= panelX + panel.width + Config.border.rounding;
|
||||
}
|
||||
|
||||
function withinPanelHeight(panel: Item, y: real): bool {
|
||||
const panelY = panel.y;
|
||||
return y >= panelY + Config.bar.height - Config.border.rounding
|
||||
&& y <= panelY + panel.height + Config.bar.height + Config.border.rounding;
|
||||
const panelY = panel.y + Config.bar.height;
|
||||
return y >= panelY - Config.border.rounding && y <= panelY + panel.height + Config.border.rounding;
|
||||
}
|
||||
|
||||
function inBottomPanel(panel: Item, x: real, y: real): bool {
|
||||
return y > root.height - Config.border.thickness - panel.height - Config.border.rounding && withinPanelWidth(panel, x);
|
||||
return y > panel.y + Config.bar.height && withinPanelWidth(panel, x);
|
||||
}
|
||||
|
||||
function inLeftPanel(panel: Item, x: real, y: real): bool {
|
||||
return x < Config.border.thickness + panel.x + panel.width && withinPanelHeight(panel, y);
|
||||
return x < panel.x + panel.width + Config.border.thickness && withinPanelHeight(panel, y);
|
||||
}
|
||||
|
||||
function inRightPanel(panel: Item, x: real, y: real): bool {
|
||||
return x > Config.border.thickness + panel.x && withinPanelHeight(panel, y);
|
||||
return x > panel.x + Config.border.thickness && withinPanelHeight(panel, y);
|
||||
}
|
||||
|
||||
// Handling Mouse Input
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ Variants {
|
|||
|
||||
UIState {
|
||||
id: uiState
|
||||
window: window
|
||||
screen: scope.modelData
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -8,12 +8,15 @@ import Quickshell.Hyprland
|
|||
Scope {
|
||||
id: root
|
||||
|
||||
required property QtObject window
|
||||
required property ShellScreen screen
|
||||
property alias uiState: uiState
|
||||
|
||||
PersistentProperties {
|
||||
id: uiState
|
||||
reloadableId: `uiState-${QsWindow.window.screen.name}`
|
||||
reloadableId: `uiState-${root.screen.name}`
|
||||
|
||||
readonly property QtObject window: root.window
|
||||
|
||||
// Open panels
|
||||
property bool dashboard
|
||||
|
|
|
|||
|
|
@ -1,47 +1,28 @@
|
|||
pragma Singleton
|
||||
|
||||
import qs.util
|
||||
import QtQuick
|
||||
import Quickshell
|
||||
import Quickshell.Io
|
||||
import Quickshell.Wayland
|
||||
import Quickshell.Services.Pipewire
|
||||
|
||||
Singleton {
|
||||
id: root
|
||||
|
||||
property alias inhibit: inhibitor.running
|
||||
property bool inhibitPipewire
|
||||
property bool inhibit: false
|
||||
property bool inhibitPipewire: true
|
||||
|
||||
function toggleInhibitPipewire() {
|
||||
root.inhibitPipewire = !root.inhibitPipewire;
|
||||
pipewireInhibitor.running = true;
|
||||
}
|
||||
|
||||
// Idle Inhibitor
|
||||
|
||||
Process {
|
||||
IdleInhibitor {
|
||||
id: inhibitor
|
||||
command: ["wayland-idle-inhibitor"]
|
||||
enabled: root.inhibit ||
|
||||
(root.inhibitPipewire &&
|
||||
!!Pipewire.nodes.values.find(node => node.isSink && node.isStream))
|
||||
window: null
|
||||
}
|
||||
|
||||
// Idle Inhibit on Pipewire
|
||||
|
||||
readonly property string pipewireInhibitorService: "wayland-pipewire-idle-inhibit.service"
|
||||
|
||||
Timer {
|
||||
id: pipewireInhibitorTimer
|
||||
running: true
|
||||
repeat: true
|
||||
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]
|
||||
onTriggered: inhibitor.window = States.screens.values().next()?.value?.window
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue