Merge branch 'main' into fix/pictures-dir-respect-locale

This commit is contained in:
ふらまりん
2025-07-19 09:28:26 +08:00
committed by GitHub
5 changed files with 20 additions and 14 deletions
@@ -15,6 +15,12 @@ Scope {
id: root id: root
property var focusedScreen: Quickshell.screens.find(s => s.name === Hyprland.focusedMonitor?.name) property var focusedScreen: Quickshell.screens.find(s => s.name === Hyprland.focusedMonitor?.name)
function closeAllWindows() {
HyprlandData.windowList.map(w => w.pid).forEach((pid) => {
Quickshell.execDetached(["kill", pid]);
});
}
Loader { Loader {
id: sessionLoader id: sessionLoader
active: false active: false
@@ -111,7 +117,7 @@ Scope {
id: sessionLogout id: sessionLogout
buttonIcon: "logout" buttonIcon: "logout"
buttonText: Translation.tr("Logout") buttonText: Translation.tr("Logout")
onClicked: { Quickshell.execDetached(["pkill", "Hyprland"]); sessionRoot.hide() } onClicked: { root.closeAllWindows(); Quickshell.execDetached(["pkill", "Hyprland"]); sessionRoot.hide() }
onFocusChanged: { if (focus) sessionRoot.subtitle = buttonText } onFocusChanged: { if (focus) sessionRoot.subtitle = buttonText }
KeyNavigation.left: sessionSleep KeyNavigation.left: sessionSleep
KeyNavigation.right: sessionTaskManager KeyNavigation.right: sessionTaskManager
@@ -140,7 +146,7 @@ Scope {
id: sessionShutdown id: sessionShutdown
buttonIcon: "power_settings_new" buttonIcon: "power_settings_new"
buttonText: Translation.tr("Shutdown") buttonText: Translation.tr("Shutdown")
onClicked: { Quickshell.execDetached(["bash", "-c", `systemctl poweroff || loginctl poweroff`]); sessionRoot.hide() } onClicked: { root.closeAllWindows(); Quickshell.execDetached(["bash", "-c", `systemctl poweroff || loginctl poweroff`]); sessionRoot.hide() }
onFocusChanged: { if (focus) sessionRoot.subtitle = buttonText } onFocusChanged: { if (focus) sessionRoot.subtitle = buttonText }
KeyNavigation.left: sessionHibernate KeyNavigation.left: sessionHibernate
KeyNavigation.right: sessionReboot KeyNavigation.right: sessionReboot
@@ -150,7 +156,7 @@ Scope {
id: sessionReboot id: sessionReboot
buttonIcon: "restart_alt" buttonIcon: "restart_alt"
buttonText: Translation.tr("Reboot") buttonText: Translation.tr("Reboot")
onClicked: { Quickshell.execDetached(["bash", "-c", `reboot || loginctl reboot`]); sessionRoot.hide() } onClicked: { root.closeAllWindows(); Quickshell.execDetached(["bash", "-c", `reboot || loginctl reboot`]); sessionRoot.hide() }
onFocusChanged: { if (focus) sessionRoot.subtitle = buttonText } onFocusChanged: { if (focus) sessionRoot.subtitle = buttonText }
KeyNavigation.left: sessionShutdown KeyNavigation.left: sessionShutdown
KeyNavigation.right: sessionFirmwareReboot KeyNavigation.right: sessionFirmwareReboot
@@ -160,7 +166,7 @@ Scope {
id: sessionFirmwareReboot id: sessionFirmwareReboot
buttonIcon: "settings_applications" buttonIcon: "settings_applications"
buttonText: Translation.tr("Reboot to firmware settings") buttonText: Translation.tr("Reboot to firmware settings")
onClicked: { Quickshell.execDetached(["bash", "-c", `systemctl reboot --firmware-setup || loginctl reboot --firmware-setup`]); sessionRoot.hide() } onClicked: { root.closeAllWindows(); Quickshell.execDetached(["bash", "-c", `systemctl reboot --firmware-setup || loginctl reboot --firmware-setup`]); sessionRoot.hide() }
onFocusChanged: { if (focus) sessionRoot.subtitle = buttonText } onFocusChanged: { if (focus) sessionRoot.subtitle = buttonText }
KeyNavigation.up: sessionTaskManager KeyNavigation.up: sessionTaskManager
KeyNavigation.left: sessionReboot KeyNavigation.left: sessionReboot
+1 -1
View File
@@ -7,11 +7,11 @@
pragma ComponentBehavior: "Bound" pragma ComponentBehavior: "Bound"
import qs import qs
import qs.services
import qs.modules.common import qs.modules.common
import qs.modules.common.widgets import qs.modules.common.widgets
import qs.modules.common.functions import qs.modules.common.functions
import QtQuick import QtQuick
import QtQuick.Effects
import QtQuick.Controls import QtQuick.Controls
import QtQuick.Layouts import QtQuick.Layouts
import Quickshell import Quickshell
@@ -29,7 +29,7 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
mkdir -p "$PICTURES_DIR/Wallpapers" mkdir -p "$PICTURES_DIR/Wallpapers"
page=$((1 + RANDOM % 1000)); page=$((1 + RANDOM % 1000));
response=$(curl "https://konachan.com/post.json?tags=rating%3Asafe&limit=1&page=$page") response=$(curl "https://konachan.net/post.json?tags=rating%3Asafe&limit=1&page=$page")
link=$(echo "$response" | jq '.[0].file_url' -r); link=$(echo "$response" | jq '.[0].file_url' -r);
ext=$(echo "$link" | awk -F. '{print $NF}') ext=$(echo "$link" | awk -F. '{print $NF}')
downloadPath="$PICTURES_DIR/Wallpapers/konachan_random_image.$ext" downloadPath="$PICTURES_DIR/Wallpapers/konachan_random_image.$ext"
+4 -4
View File
@@ -58,8 +58,8 @@ Singleton {
}, },
"konachan": { "konachan": {
"name": "Konachan", "name": "Konachan",
"url": "https://konachan.com", "url": "https://konachan.net",
"api": "https://konachan.com/post.json", "api": "https://konachan.net/post.json",
"description": Translation.tr("For desktop wallpapers | Good quality"), "description": Translation.tr("For desktop wallpapers | Good quality"),
"mapFunc": (response) => { "mapFunc": (response) => {
return response.map(item => { return response.map(item => {
@@ -80,7 +80,7 @@ Singleton {
} }
}) })
}, },
"tagSearchTemplate": "https://konachan.com/tag.json?order=count&name={{query}}*", "tagSearchTemplate": "https://konachan.net/tag.json?order=count&name={{query}}*",
"tagMapFunc": (response) => { "tagMapFunc": (response) => {
return response.map(item => { return response.map(item => {
return { return {
@@ -360,7 +360,7 @@ Singleton {
function makeRequest(tags, nsfw=false, limit=20, page=1) { function makeRequest(tags, nsfw=false, limit=20, page=1) {
var url = constructRequestUrl(tags, nsfw, limit, page) var url = constructRequestUrl(tags, nsfw, limit, page)
// console.log("[Booru] Making request to " + url) console.log("[Booru] Making request to " + url)
const newResponse = root.booruResponseDataComponent.createObject(null, { const newResponse = root.booruResponseDataComponent.createObject(null, {
"provider": currentProvider, "provider": currentProvider,
+4 -4
View File
@@ -7,18 +7,18 @@
{ {
"label" : "hibernate", "label" : "hibernate",
"action" : "systemctl hibernate || loginctl hibernate", "action" : "systemctl hibernate || loginctl hibernate",
"text" : "save", "text" : "downloading",
"keybind" : "h" "keybind" : "h"
} }
{ {
"label" : "logout", "label" : "logout",
"action" : "pkill Hyprland || pkill sway || pkill niri || loginctl terminate-user $USER", "action" : "hyprctl clients -j | jq -r '.[].pid' | xargs kill; pkill Hyprland || pkill sway || pkill niri || loginctl terminate-user $USER",
"text" : "logout", "text" : "logout",
"keybind" : "e" "keybind" : "e"
} }
{ {
"label" : "shutdown", "label" : "shutdown",
"action" : "systemctl poweroff || loginctl poweroff", "action" : "hyprctl clients -j | jq -r '.[].pid' | xargs kill; systemctl poweroff || loginctl poweroff",
"text" : "power_settings_new", "text" : "power_settings_new",
"keybind" : "s" "keybind" : "s"
} }
@@ -30,7 +30,7 @@
} }
{ {
"label" : "reboot", "label" : "reboot",
"action" : "systemctl reboot || loginctl reboot", "action" : "hyprctl clients -j | jq -r '.[].pid' | xargs kill; systemctl reboot || loginctl reboot",
"text" : "restart_alt", "text" : "restart_alt",
"keybind" : "r" "keybind" : "r"
} }