welcome: random wall

This commit is contained in:
end-4
2025-06-17 10:49:11 +02:00
parent 8419697542
commit 745857e515
3 changed files with 41 additions and 2 deletions
+10
View File
@@ -0,0 +1,10 @@
#!/usr/bin/env bash
mkdir -p ~/Pictures/Wallpapers
page=$((1 + RANDOM % 1000));
response=$(curl "https://konachan.com/post.json?tags=rating%3Asafe&limit=1&page=$page")
link=$(echo "$response" | jq '.[0].file_url' -r);
ext=$(echo "$link" | awk -F. '{print $NF}')
downloadPath="$HOME/Pictures/Wallpapers/konachan_random_image.$ext"
curl "$link" -o "$downloadPath"
~/.config/quickshell/scripts/colors/switchwall.sh --image "$downloadPath"
@@ -291,6 +291,10 @@ main() {
shift
fi
;;
--image)
imgpath="$2"
shift 2
;;
--noswitch)
noswitch_flag="1"
imgpath=$(swww query | awk -F 'image: ' '{print $2}')
+27 -2
View File
@@ -11,6 +11,7 @@ import QtQuick.Controls
import QtQuick.Layouts
import QtQuick.Window
import Quickshell
import Quickshell.Io
import Quickshell.Hyprland
import "root:/services/"
import "root:/modules/common/"
@@ -40,6 +41,18 @@ ApplicationWindow {
height: 600
color: Appearance.m3colors.m3background
Process {
id: konachanWallProc
property string status: ""
command: ["bash", "-c", FileUtils.trimFileProtocol(`${Directories.config}/quickshell/scripts/colors/random_konachan_wall.sh`)]
stdout: SplitParser {
onRead: data => {
console.log(`Konachan wall proc output: ${data}`);
konachanWallProc.status = data.trim();
}
}
}
component Section: ColumnLayout {
id: sectionRoot
property string title
@@ -235,7 +248,7 @@ ApplicationWindow {
id: welcomeText
anchors.centerIn: parent
color: Appearance.colors.colOnLayer0
text: "Welcome"
text: "Yooooo hi there"
font.pixelSize: Appearance.font.pixelSize.hugeass
font.family: Appearance.font.family.title
}
@@ -304,6 +317,18 @@ ApplicationWindow {
dark: true
}
}
ButtonWithIcon {
id: rndWallBtn
Layout.alignment: Qt.AlignHCenter
buttonRadius: Appearance.rounding.small
iconText: "ifl"
mainText: konachanWallProc.running ? "Be patient..." : "Random SFW Konachan wallpaper"
onClicked: {
console.log(konachanWallProc.command.join(" "))
konachanWallProc.running = true;
}
}
}
Section {
@@ -323,7 +348,7 @@ ApplicationWindow {
spacing: 10
StyledText {
font.pixelSize: Appearance.font.pixelSize.small
text: "Open keybind cheatsheet"
text: "Keybinds"
color: Appearance.colors.colOnSecondaryContainer
}
RowLayout {