Fixed reloading config with disabled/enabled hypidle
This commit is contained in:
@@ -1,5 +1,14 @@
|
||||
if pgrep -x "hypridle" >/dev/null ;then
|
||||
killall hypridle
|
||||
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 &
|
||||
hypridle &
|
||||
fi
|
||||
@@ -11,6 +11,10 @@ MouseArea {
|
||||
hoverEnabled: true
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
|
||||
Component.onCompleted: {
|
||||
idleStatusScript.running = true
|
||||
}
|
||||
|
||||
property int idle: 0
|
||||
|
||||
Rectangle {
|
||||
@@ -46,10 +50,23 @@ MouseArea {
|
||||
Text {
|
||||
id: idleText
|
||||
anchors.centerIn: parent
|
||||
text: idleButton.idle ? "" : ""
|
||||
text: idleButton.idle ? "" : ""
|
||||
font.pixelSize: 26
|
||||
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