Compare commits

...
4 Commits
Author SHA1 Message Date
Hannes 426b96a27e note if idle breaks 2026-08-22 21:39:12 +02:00
Hannes 9f8d774efd rework of IdleButton 2026-08-22 21:35:43 +02:00
Hannes 896264c062 some fixes to remove warnings 2026-08-22 16:54:49 +02:00
Hannes a046c5b3e0 disabled Background (had errors and no use) 2026-08-22 16:43:26 +02:00
10 changed files with 43 additions and 58 deletions
+1 -2
View File
@@ -24,6 +24,7 @@ QtObject {
readonly property int border_width: 2 readonly property int border_width: 2
readonly property string font: "CodeNewRoman Nerd Font" readonly property string font: "CodeNewRoman Nerd Font"
readonly property string jfont: "Noto Sans JP"
function big_font_size(value) { function big_font_size(value) {
return value * 0.6 return value * 0.6
@@ -56,8 +57,6 @@ QtObject {
readonly property int reload_interval: 10000 readonly property int reload_interval: 10000
readonly property int fast_reload_interval: 1000 readonly property int fast_reload_interval: 1000
function maxTextWidth(maxNum, texts) { function maxTextWidth(maxNum, texts) {
let maxWidth = 0; let maxWidth = 0;
+1 -1
View File
@@ -70,7 +70,7 @@ PanelWindow {
Tray{} Tray{}
Battery{} Battery{}
Network {} Network {}
IdleButton {} IdleButton { panelWindow: panel }
PowerButton {} PowerButton {}
} }
-14
View File
@@ -1,14 +0,0 @@
if [ "$1" = "--status" ]; then
if pgrep -x "hypridle" >/dev/null; then
echo 1
else
echo 0
fi
exit 0
fi
if pgrep -x "hypridle" >/dev/null; then
killall hypridle
else
hypridle &
fi
+7 -19
View File
@@ -5,24 +5,12 @@ import Quickshell.Io
import "../../../../config" import "../../../../config"
Item { Item {
property int idle: 0 // true = inhibit idle (prevent hypridle/lock/dpms), false = allow idle
property bool idle: false
Process { // may need this in hypridle.conf
id: statusScript // general {
command: ["sh", "-c", Config.configDir + "/modules/bar/scripts/Idle.sh --status"] // ignore_wayland_inhibit = false # Make sure this is false or omitted
running: true // ignore_dbus_inhibit=false
stdout: StdioCollector { // }
onStreamFinished: {
idle = this.text.trim() === "0" ? 1 : 0
}
}
}
Timer {
interval: 5000
running: true
repeat: true
triggeredOnStart: true
onTriggered: statusScript.running = true
}
} }
+19 -11
View File
@@ -1,6 +1,7 @@
import QtQuick import QtQuick
import Quickshell import Quickshell
import Quickshell.Hyprland import Quickshell.Hyprland
import Quickshell.Wayland
import Quickshell.Io import Quickshell.Io
import "../../../config" import "../../../config"
import "../states/Idle" import "../states/Idle"
@@ -12,16 +13,29 @@ MouseArea {
hoverEnabled: true hoverEnabled: true
cursorShape: Qt.PointingHandCursor cursorShape: Qt.PointingHandCursor
required property PanelWindow panelWindow
IdleInhibitor {
id: idleInhibitor
window: panelWindow
enabled: IdleState.idle
}
IdleMonitor {
id: idleMonitor
enabled: true
timeout: 30
respectInhibitors: true
}
onClicked: { onClicked: {
var newState = IdleState.idle ? 0 : 1 IdleState.idle = !IdleState.idle
console.log("[IdleButton] Toggling idle: " + (newState ? "enabled" : "disabled")) console.log("[IdleButton] Toggling idle: " + (IdleState.idle ? "enabled" : "disabled"))
idleToggleProc.startDetached()
IdleState.idle = newState
} }
Rectangle { Rectangle {
anchors.fill: parent anchors.fill: parent
color: idleButton.containsMouse ? Colors.tertiary : Qt.alpha(Colors.tertiaryContainer, 0.25) color: idleButton.containsMouse ? Colors.tertiary : idleMonitor.isIdle ? Qt.alpha(Colors.secondary, 0.25) : Qt.alpha(Colors.tertiaryContainer, 0.25)
radius: Config.radius_fun(idleButton.height) radius: Config.radius_fun(idleButton.height)
border.width: Config.border_width border.width: Config.border_width
border.color: ( border.color: (
@@ -42,10 +56,4 @@ MouseArea {
) )
} }
} }
Process {
id: idleToggleProc
command: ["sh", "-c", Config.configDir + "/modules/bar/scripts/Idle.sh"]
running: false
}
} }
+6 -6
View File
@@ -75,12 +75,12 @@ Row { // Workspace Row
edges: Edges.Top | Edges.Left edges: Edges.Top | Edges.Left
gravity: Edges.Bottom | Edges.Right gravity: Edges.Bottom | Edges.Right
adjustment: PopupAdjustment.FlipX | PopupAdjustment.SlideY adjustment: PopupAdjustment.FlipX | PopupAdjustment.SlideY
onAnchoring: { // onAnchoring: {
rect.x = trayArea.clickX // rect.x = trayArea.clickX
rect.y = trayArea.clickY // rect.y = trayArea.clickY
rect.w = 1 // rect.w = 1
rect.h = 1 // rect.h = 1
} // }
} }
} }
+6 -2
View File
@@ -69,8 +69,12 @@ Rectangle {
anchors.fill: parent anchors.fill: parent
onClicked: { onClicked: {
console.log("[Workspaces] Switch to workspace: " + workspaceData.id) console.log("[Workspaces] Switch to workspace: " + workspaceData.id)
Hyprland.dispatch("workspace " + workspaceData.id) if (Hyprland.usingLua) {
Hyprland.dispatch("hl.dsp.focus({ workspace = "+workspaceData.id+" })") Hyprland.dispatch("hl.dsp.focus({ workspace = "+workspaceData.id+" })")
} else {
Hyprland.dispatch("workspace " + workspaceData.id)
}
Hyprland.refreshWorkspaces()
} }
Row { Row {
+1 -1
View File
@@ -94,7 +94,7 @@ PanelWindow {
function switchModeChooser() { function switchModeChooser() {
all_invisible() all_invisible()
languageChooser.visible = true languageChooser.visible = true
languageChooser.start() // languageChooser.start()
} }
function switch_KanaVoicing() { function switch_KanaVoicing() {
+1 -1
View File
@@ -64,7 +64,7 @@ PanelWindow {
border.width: 1 border.width: 1
} }
Keys.onReleased: { Keys.onReleased: (event) => {
if (event.key === Qt.Key_Escape) { if (event.key === Qt.Key_Escape) {
console.log("Escape pressed inside TextField") console.log("Escape pressed inside TextField")
console.log("Pressed Escape, closing Wallpaper Picker") console.log("Pressed Escape, closing Wallpaper Picker")
+1 -1
View File
@@ -26,7 +26,7 @@ ShellRoot {
id : wlLoader id : wlLoader
} }
Background {} // Background {}
function openWlogout() { function openWlogout() {
wlLoader.openWlogout() wlLoader.openWlogout()