Added PowerOff button with wlogout

This commit is contained in:
Hannes
2026-02-12 21:40:13 +01:00
parent d48dae38cf
commit a02ed79a92
4 changed files with 61 additions and 6 deletions
+1
View File
@@ -70,6 +70,7 @@ PanelWindow {
spacing: 8
// TODO: Add bluetooth, network, audio, power, maybe HW monitor
PowerButton {}
}
+47
View File
@@ -0,0 +1,47 @@
import QtQuick
import Quickshell
import Quickshell.Hyprland
import Quickshell.Io
MouseArea {
id: archButton
width: 30
height: 28
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
Rectangle {
anchors.fill: parent
color: archButton.containsMouse ? "#2a2a2a" : "transparent"
radius: 6
Item {
anchors.fill: parent
Process {
id: powerOff
command: ["wlogout", "-b", "2"]
stdout: StdioCollector {
onStreamFinished: console.log(`line read: ${this.text}`)
}
}
MouseArea {
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
anchors.fill: parent
onClicked: {
console.log("Running PowerOff Menu")
powerOff.startDetached()
}
}
}
Text {
anchors.centerIn: parent
text: ""
font.pixelSize: 26
font.family: "Nerd Font"
color: "#ffffff"
}
}
}
-3
View File
@@ -1,10 +1,7 @@
import QtQuick
import Quickshell
import Quickshell.Hyprland
import QtQuick.Controls
import Quickshell.Io
import Qt.labs.folderlistmodel
Item { // container, invisible
+13 -3
View File
@@ -5,8 +5,6 @@ IMAGE="$1"
image_name=$(basename "$IMAGE")
image="$HOME/Pictures/Wallpapers/$image_name"
echo "$image"
echo "start"
# Check if an image was provided
@@ -45,4 +43,16 @@ elif [ -x "/usr/bin/hyprpaper" ]; then
echo "daemon started"
fi
hyprctl hyprpaper wallpaper ", $image"
fi
fi
### Blured Wallpaper for wlogout
blur="50x30"
static_wallpaper_dir="/home/honney/Pictures/Wallpapers/Static"
if [ ! -d $static_wallpaper_dir ]; then
mkdir -p $static_wallpaper_dir;
fi
blurred_wp="$static_wallpaper_dir/blurred.jpg"
magick $image -blur $blur $blurred_wp