forked from Shinonome/dots-hyprland
welcome: random wall
This commit is contained in:
@@ -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
|
shift
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
--image)
|
||||||
|
imgpath="$2"
|
||||||
|
shift 2
|
||||||
|
;;
|
||||||
--noswitch)
|
--noswitch)
|
||||||
noswitch_flag="1"
|
noswitch_flag="1"
|
||||||
imgpath=$(swww query | awk -F 'image: ' '{print $2}')
|
imgpath=$(swww query | awk -F 'image: ' '{print $2}')
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import QtQuick.Controls
|
|||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import QtQuick.Window
|
import QtQuick.Window
|
||||||
import Quickshell
|
import Quickshell
|
||||||
|
import Quickshell.Io
|
||||||
import Quickshell.Hyprland
|
import Quickshell.Hyprland
|
||||||
import "root:/services/"
|
import "root:/services/"
|
||||||
import "root:/modules/common/"
|
import "root:/modules/common/"
|
||||||
@@ -40,6 +41,18 @@ ApplicationWindow {
|
|||||||
height: 600
|
height: 600
|
||||||
color: Appearance.m3colors.m3background
|
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 {
|
component Section: ColumnLayout {
|
||||||
id: sectionRoot
|
id: sectionRoot
|
||||||
property string title
|
property string title
|
||||||
@@ -235,7 +248,7 @@ ApplicationWindow {
|
|||||||
id: welcomeText
|
id: welcomeText
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
color: Appearance.colors.colOnLayer0
|
color: Appearance.colors.colOnLayer0
|
||||||
text: "Welcome"
|
text: "Yooooo hi there"
|
||||||
font.pixelSize: Appearance.font.pixelSize.hugeass
|
font.pixelSize: Appearance.font.pixelSize.hugeass
|
||||||
font.family: Appearance.font.family.title
|
font.family: Appearance.font.family.title
|
||||||
}
|
}
|
||||||
@@ -304,6 +317,18 @@ ApplicationWindow {
|
|||||||
dark: true
|
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 {
|
Section {
|
||||||
@@ -323,7 +348,7 @@ ApplicationWindow {
|
|||||||
spacing: 10
|
spacing: 10
|
||||||
StyledText {
|
StyledText {
|
||||||
font.pixelSize: Appearance.font.pixelSize.small
|
font.pixelSize: Appearance.font.pixelSize.small
|
||||||
text: "Open keybind cheatsheet"
|
text: "Keybinds"
|
||||||
color: Appearance.colors.colOnSecondaryContainer
|
color: Appearance.colors.colOnSecondaryContainer
|
||||||
}
|
}
|
||||||
RowLayout {
|
RowLayout {
|
||||||
|
|||||||
Reference in New Issue
Block a user