diff --git a/modules/bar/Bar.qml b/modules/bar/Bar.qml index bc857eb..423ef2c 100644 --- a/modules/bar/Bar.qml +++ b/modules/bar/Bar.qml @@ -70,6 +70,7 @@ PanelWindow { spacing: 8 // TODO: Add bluetooth, network, audio, power, maybe HW monitor + PowerButton {} } diff --git a/modules/bar/widgets/PowerButton.qml b/modules/bar/widgets/PowerButton.qml new file mode 100644 index 0000000..a3a0ce1 --- /dev/null +++ b/modules/bar/widgets/PowerButton.qml @@ -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" + } + } +} \ No newline at end of file diff --git a/modules/wp/WallpaperPickerLoader.qml b/modules/wp/WallpaperPickerLoader.qml index c1ede6d..3b8232f 100644 --- a/modules/wp/WallpaperPickerLoader.qml +++ b/modules/wp/WallpaperPickerLoader.qml @@ -1,10 +1,7 @@ import QtQuick import Quickshell import Quickshell.Hyprland - -import QtQuick.Controls import Quickshell.Io -import Qt.labs.folderlistmodel Item { // container, invisible diff --git a/modules/wp/set-wallpaper.sh b/modules/wp/set-wallpaper.sh index 938751f..4fa0950 100755 --- a/modules/wp/set-wallpaper.sh +++ b/modules/wp/set-wallpaper.sh @@ -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 \ No newline at end of file +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