Fixed reloading config with disabled/enabled hypidle
This commit is contained in:
@@ -1,3 +1,12 @@
|
|||||||
|
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
|
if pgrep -x "hypridle" >/dev/null; then
|
||||||
killall hypridle
|
killall hypridle
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -11,6 +11,10 @@ MouseArea {
|
|||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
cursorShape: Qt.PointingHandCursor
|
cursorShape: Qt.PointingHandCursor
|
||||||
|
|
||||||
|
Component.onCompleted: {
|
||||||
|
idleStatusScript.running = true
|
||||||
|
}
|
||||||
|
|
||||||
property int idle: 0
|
property int idle: 0
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
@@ -46,10 +50,23 @@ MouseArea {
|
|||||||
Text {
|
Text {
|
||||||
id: idleText
|
id: idleText
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
text: idleButton.idle ? "" : ""
|
text: idleButton.idle ? "" : ""
|
||||||
font.pixelSize: 26
|
font.pixelSize: 26
|
||||||
font.family: "Nerd Font"
|
font.family: "Nerd Font"
|
||||||
color: idleButton.containsMouse ? Colors.tertiary_fg : Colors.primary
|
color: idleButton.containsMouse ? Colors.tertiary_fg : idleText.text == "" ? Colors.primary : Colors.tertiary
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Process {
|
||||||
|
id: idleStatusScript
|
||||||
|
command: ["sh", "-c", Quickshell.env("HOME") + "/.config/quickshell/modules/bar/scripts/Idle.sh" + " --status"]
|
||||||
|
stdout: StdioCollector {
|
||||||
|
onStreamFinished: {
|
||||||
|
this.text.trim() === "0" ? idle = 1 : idle = 0
|
||||||
|
console.log("networkScript networkText:", this.text.trim())
|
||||||
|
console.log("networkScript")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user