diff --git a/.config/quickshell/modules/settings/General.qml b/.config/quickshell/modules/settings/General.qml index f998ea00c..dd3323ac4 100644 --- a/.config/quickshell/modules/settings/General.qml +++ b/.config/quickshell/modules/settings/General.qml @@ -6,8 +6,89 @@ import "root:/modules/common/" import "root:/modules/common/widgets/" ContentPage { - StyledText { - text: qsTr("General page") - font.pixelSize: Appearance.font.pixelSize.larger + ContentSection { + title: "Policies" + + RowLayout { + Layout.alignment: Qt.AlignHCenter + spacing: 15 + ColumnLayout { // Weeb policy + StyledText { + text: "Weeb" + color: Appearance.colors.colSubtext + } + ButtonGroup { + id: weebPolicyBtnGroup + property int selectedPolicy: ConfigOptions.policies.weeb + spacing: 2 + SelectionGroupButton { + property int value: 0 + leftmost: true + buttonText: "No" + toggled: (weebPolicyBtnGroup.selectedPolicy === value) + onClicked: { + ConfigLoader.setConfigValueAndSave("policies.weeb", value); + } + } + SelectionGroupButton { + property int value: 1 + buttonText: "Yes" + toggled: (weebPolicyBtnGroup.selectedPolicy === value) + onClicked: { + ConfigLoader.setConfigValueAndSave("policies.weeb", value); + } + } + SelectionGroupButton { + property int value: 2 + rightmost: true + buttonText: "Closet" + toggled: (weebPolicyBtnGroup.selectedPolicy === value) + onClicked: { + ConfigLoader.setConfigValueAndSave("policies.weeb", value); + } + StyledToolTip { + content: "The Anime tab on the left sidebar would still\nbe available, but its tab button won't show" + } + } + } + } + ColumnLayout { // AI policy + StyledText { + text: "AI" + color: Appearance.colors.colSubtext + } + ButtonGroup { + id: aiPolicyBtnGroup + property int selectedPolicy: ConfigOptions.policies.ai + spacing: 2 + SelectionGroupButton { + property int value: 0 + leftmost: true + buttonText: "No" + toggled: (aiPolicyBtnGroup.selectedPolicy === value) + onClicked: { + ConfigLoader.setConfigValueAndSave("policies.ai", value); + } + } + SelectionGroupButton { + property int value: 1 + buttonText: "Yes" + toggled: (aiPolicyBtnGroup.selectedPolicy === value) + onClicked: { + ConfigLoader.setConfigValueAndSave("policies.ai", value); + } + } + SelectionGroupButton { + property int value: 2 + rightmost: true + buttonText: "Local only" + toggled: (aiPolicyBtnGroup.selectedPolicy === value) + onClicked: { + ConfigLoader.setConfigValueAndSave("policies.ai", value); + } + } + } + } + } } } \ No newline at end of file diff --git a/.config/quickshell/modules/settings/Style.qml b/.config/quickshell/modules/settings/Style.qml index 6b60c1224..3b9071cab 100644 --- a/.config/quickshell/modules/settings/Style.qml +++ b/.config/quickshell/modules/settings/Style.qml @@ -1,13 +1,100 @@ import QtQuick import QtQuick.Controls import QtQuick.Layouts +import Quickshell +import Quickshell.Io +import Quickshell.Hyprland import "root:/services/" import "root:/modules/common/" import "root:/modules/common/widgets/" +import "root:/modules/common/functions/color_utils.js" as ColorUtils +import "root:/modules/common/functions/file_utils.js" as FileUtils ContentPage { - StyledText { - text: qsTr("Style settings page") - font.pixelSize: Appearance.font.pixelSize.larger + + 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(); + } + } + } + + ContentSection { + title: "Colors & Wallpaper" + + ButtonGroup { + Layout.fillWidth: true + LightDarkPreferenceButton { + dark: false + } + LightDarkPreferenceButton { + dark: true + } + } + + RowLayout { + Layout.alignment: Qt.AlignHCenter + RippleButtonWithIcon { + id: rndWallBtn + Layout.alignment: Qt.AlignHCenter + buttonRadius: Appearance.rounding.small + iconText: "wallpaper" + mainText: konachanWallProc.running ? "Be patient..." : "Random: Konachan" + onClicked: { + console.log(konachanWallProc.command.join(" ")) + konachanWallProc.running = true; + } + StyledToolTip { + content: "Random SFW Anime wallpaper from Konachan\nImage is saved to ~/Pictures/Wallpapers" + } + } + RippleButtonWithIcon { + iconText: "wallpaper" + StyledToolTip { + content: "Pick wallpaper image on your system" + } + onClicked: { + Hyprland.dispatch(`exec ${Directories.wallpaperSwitchScriptPath}`) + } + mainContentComponent: Component { + RowLayout { + spacing: 10 + StyledText { + font.pixelSize: Appearance.font.pixelSize.small + text: "Choose file" + color: Appearance.colors.colOnSecondaryContainer + } + RowLayout { + spacing: 3 + KeyboardKey { + key: "Ctrl" + } + KeyboardKey { + key: "󰖳" + } + StyledText { + Layout.alignment: Qt.AlignVCenter + text: "+" + } + KeyboardKey { + key: "T" + } + } + } + } + } + } + + StyledText { + Layout.alignment: Qt.AlignHCenter + text: "Change any time later with /dark, /light, /img in the launcher" + font.pixelSize: Appearance.font.pixelSize.smaller + color: Appearance.colors.colSubtext + } } } \ No newline at end of file