diff --git a/.config/quickshell/ii/modules/settings/GeneralConfig.qml b/.config/quickshell/ii/modules/settings/GeneralConfig.qml new file mode 100644 index 000000000..dd6cbebc3 --- /dev/null +++ b/.config/quickshell/ii/modules/settings/GeneralConfig.qml @@ -0,0 +1,232 @@ +import QtQuick +import Quickshell +import QtQuick.Layouts +import qs +import qs.services +import qs.modules.common +import qs.modules.common.functions +import qs.modules.common.widgets + +ContentPage { + forceWidth: true + + ContentSection { + icon: "volume_up" + title: Translation.tr("Audio") + + ConfigSwitch { + text: Translation.tr("Earbang protection") + checked: Config.options.audio.protection.enable + onCheckedChanged: { + Config.options.audio.protection.enable = checked; + } + StyledToolTip { + content: Translation.tr("Prevents abrupt increments and restricts volume limit") + } + } + ConfigRow { + // uniform: true + ConfigSpinBox { + text: Translation.tr("Max allowed increase") + value: Config.options.audio.protection.maxAllowedIncrease + from: 0 + to: 100 + stepSize: 2 + onValueChanged: { + Config.options.audio.protection.maxAllowedIncrease = value; + } + } + ConfigSpinBox { + text: Translation.tr("Volume limit") + value: Config.options.audio.protection.maxAllowed + from: 0 + to: 154 // pavucontrol allows up to 153% + stepSize: 2 + onValueChanged: { + Config.options.audio.protection.maxAllowed = value; + } + } + } + } + + ContentSection { + icon: "battery_android_full" + title: Translation.tr("Battery") + + ConfigRow { + uniform: true + ConfigSpinBox { + text: Translation.tr("Low warning") + value: Config.options.battery.low + from: 0 + to: 100 + stepSize: 5 + onValueChanged: { + Config.options.battery.low = value; + } + } + ConfigSpinBox { + text: Translation.tr("Critical warning") + value: Config.options.battery.critical + from: 0 + to: 100 + stepSize: 5 + onValueChanged: { + Config.options.battery.critical = value; + } + } + } + ConfigRow { + uniform: true + ConfigSwitch { + text: Translation.tr("Automatic suspend") + checked: Config.options.battery.automaticSuspend + onCheckedChanged: { + Config.options.battery.automaticSuspend = checked; + } + StyledToolTip { + content: Translation.tr("Automatically suspends the system when battery is low") + } + } + ConfigSpinBox { + text: Translation.tr("Suspend at") + value: Config.options.battery.suspend + from: 0 + to: 100 + stepSize: 5 + onValueChanged: { + Config.options.battery.suspend = value; + } + } + } + } + + ContentSection { + icon: "language" + title: Translation.tr("Language") + + ContentSubsection { + title: Translation.tr("Interface Language") + tooltip: Translation.tr("Select the language for the user interface.\n\"Auto\" will use your system's locale.") + + ConfigSelectionArray { + id: languageSelector + currentValue: Config.options.language.ui + onSelected: newValue => { + Config.options.language.ui = newValue; + } + options: [ + { + displayName: Translation.tr("Auto (System)"), + value: "auto" + }, + ...Translation.availableLanguages.map(lang => { + return { + displayName: lang.replace('_', '-'), + value: lang + }; + }) + ] + } + } + } + + ContentSection { + icon: "rule" + title: Translation.tr("Policies") + + ConfigRow { + ColumnLayout { + // Weeb policy + ContentSubsectionLabel { + text: Translation.tr("Weeb") + } + ConfigSelectionArray { + currentValue: Config.options.policies.weeb + onSelected: newValue => { + Config.options.policies.weeb = newValue; + } + options: [ + { + displayName: Translation.tr("No"), + value: 0 + }, + { + displayName: Translation.tr("Yes"), + value: 1 + }, + { + displayName: Translation.tr("Closet"), + value: 2 + } + ] + } + } + + ColumnLayout { + // AI policy + ContentSubsectionLabel { + text: Translation.tr("AI") + } + ConfigSelectionArray { + currentValue: Config.options.policies.ai + onSelected: newValue => { + Config.options.policies.ai = newValue; + } + options: [ + { + displayName: Translation.tr("No"), + value: 0 + }, + { + displayName: Translation.tr("Yes"), + value: 1 + }, + { + displayName: Translation.tr("Local only"), + value: 2 + } + ] + } + } + } + } + + ContentSection { + icon: "nest_clock_farsight_analog" + title: Translation.tr("Time") + + ContentSubsection { + title: Translation.tr("Format") + tooltip: "" + + ConfigSelectionArray { + currentValue: Config.options.time.format + onSelected: newValue => { + if (newValue === "hh:mm") { + Quickshell.execDetached(["bash", "-c", `sed -i 's/\\TIME12\\b/TIME/' '${FileUtils.trimFileProtocol(Directories.config)}/hypr/hyprlock.conf'`]); + } else { + Quickshell.execDetached(["bash", "-c", `sed -i 's/\\TIME\\b/TIME12/' '${FileUtils.trimFileProtocol(Directories.config)}/hypr/hyprlock.conf'`]); + } + + Config.options.time.format = newValue; + + } + options: [ + { + displayName: Translation.tr("24h"), + value: "hh:mm" + }, + { + displayName: Translation.tr("12h am/pm"), + value: "h:mm ap" + }, + { + displayName: Translation.tr("12h AM/PM"), + value: "h:mm AP" + }, + ] + } + } + } +} diff --git a/.config/quickshell/ii/modules/settings/InterfaceConfig.qml b/.config/quickshell/ii/modules/settings/InterfaceConfig.qml index 11e6811b4..57074a34f 100644 --- a/.config/quickshell/ii/modules/settings/InterfaceConfig.qml +++ b/.config/quickshell/ii/modules/settings/InterfaceConfig.qml @@ -7,66 +7,6 @@ import qs.modules.common.widgets ContentPage { forceWidth: true - ContentSection { - icon: "rule" - title: Translation.tr("Policies") - - ConfigRow { - ColumnLayout { - // Weeb policy - ContentSubsectionLabel { - text: Translation.tr("Weeb") - } - ConfigSelectionArray { - currentValue: Config.options.policies.weeb - onSelected: newValue => { - Config.options.policies.weeb = newValue; - } - options: [ - { - displayName: Translation.tr("No"), - value: 0 - }, - { - displayName: Translation.tr("Yes"), - value: 1 - }, - { - displayName: Translation.tr("Closet"), - value: 2 - } - ] - } - } - - ColumnLayout { - // AI policy - ContentSubsectionLabel { - text: Translation.tr("AI") - } - ConfigSelectionArray { - currentValue: Config.options.policies.ai - onSelected: newValue => { - Config.options.policies.ai = newValue; - } - options: [ - { - displayName: Translation.tr("No"), - value: 0 - }, - { - displayName: Translation.tr("Yes"), - value: 1 - }, - { - displayName: Translation.tr("Local only"), - value: 2 - } - ] - } - } - } - } ContentSection { icon: "wallpaper" @@ -121,58 +61,6 @@ ContentPage { } } - ContentSection { - icon: "battery_android_full" - title: Translation.tr("Battery") - - ConfigRow { - uniform: true - ConfigSpinBox { - text: Translation.tr("Low warning") - value: Config.options.battery.low - from: 0 - to: 100 - stepSize: 5 - onValueChanged: { - Config.options.battery.low = value; - } - } - ConfigSpinBox { - text: Translation.tr("Critical warning") - value: Config.options.battery.critical - from: 0 - to: 100 - stepSize: 5 - onValueChanged: { - Config.options.battery.critical = value; - } - } - } - ConfigRow { - uniform: true - ConfigSwitch { - text: Translation.tr("Automatic suspend") - checked: Config.options.battery.automaticSuspend - onCheckedChanged: { - Config.options.battery.automaticSuspend = checked; - } - StyledToolTip { - content: Translation.tr("Automatically suspends the system when battery is low") - } - } - ConfigSpinBox { - text: Translation.tr("Suspend at") - value: Config.options.battery.suspend - from: 0 - to: 100 - stepSize: 5 - onValueChanged: { - Config.options.battery.suspend = value; - } - } - } - } - ContentSection { icon: "call_to_action" title: Translation.tr("Dock") @@ -281,10 +169,6 @@ ContentPage { onCheckedChanged: { Config.options.sidebar.cornerOpen.visualize = checked; } - - StyledToolTip { - content: "When this is off you'll have to click" - } } ConfigRow { ConfigSpinBox { @@ -389,33 +273,4 @@ ContentPage { } } - ContentSection { - icon: "language" - title: Translation.tr("Language") - - ContentSubsection { - title: Translation.tr("Interface Language") - tooltip: Translation.tr("Select the language for the user interface.\n\"Auto\" will use your system's locale.") - - ConfigSelectionArray { - id: languageSelector - currentValue: Config.options.language.ui - onSelected: newValue => { - Config.options.language.ui = newValue; - } - options: [ - { - displayName: Translation.tr("Auto (System)"), - value: "auto" - }, - ...Translation.availableLanguages.map(lang => { - return { - displayName: lang.replace('_', '-'), - value: lang - }; - }) - ] - } - } - } } diff --git a/.config/quickshell/ii/modules/settings/ServicesConfig.qml b/.config/quickshell/ii/modules/settings/ServicesConfig.qml index 004a549da..f28eab31a 100644 --- a/.config/quickshell/ii/modules/settings/ServicesConfig.qml +++ b/.config/quickshell/ii/modules/settings/ServicesConfig.qml @@ -10,45 +10,6 @@ import Quickshell ContentPage { forceWidth: true - ContentSection { - icon: "volume_up" - title: Translation.tr("Audio") - - ConfigSwitch { - text: Translation.tr("Earbang protection") - checked: Config.options.audio.protection.enable - onCheckedChanged: { - Config.options.audio.protection.enable = checked; - } - StyledToolTip { - content: Translation.tr("Prevents abrupt increments and restricts volume limit") - } - } - ConfigRow { - // uniform: true - ConfigSpinBox { - text: Translation.tr("Max allowed increase") - value: Config.options.audio.protection.maxAllowedIncrease - from: 0 - to: 100 - stepSize: 2 - onValueChanged: { - Config.options.audio.protection.maxAllowedIncrease = value; - } - } - ConfigSpinBox { - text: Translation.tr("Volume limit") - value: Config.options.audio.protection.maxAllowed - from: 0 - to: 154 // pavucontrol allows up to 153% - stepSize: 2 - onValueChanged: { - Config.options.audio.protection.maxAllowed = value; - } - } - } - } - ContentSection { icon: "neurology" title: Translation.tr("AI") @@ -66,58 +27,6 @@ ContentPage { } } - ContentSection { - icon: "battery_android_full" - title: Translation.tr("Battery") - - ConfigRow { - uniform: true - ConfigSpinBox { - text: Translation.tr("Low warning") - value: Config.options.battery.low - from: 0 - to: 100 - stepSize: 5 - onValueChanged: { - Config.options.battery.low = value; - } - } - ConfigSpinBox { - text: Translation.tr("Critical warning") - value: Config.options.battery.critical - from: 0 - to: 100 - stepSize: 5 - onValueChanged: { - Config.options.battery.critical = value; - } - } - } - ConfigRow { - uniform: true - ConfigSwitch { - text: Translation.tr("Automatic suspend") - checked: Config.options.battery.automaticSuspend - onCheckedChanged: { - Config.options.battery.automaticSuspend = checked; - } - StyledToolTip { - content: Translation.tr("Automatically suspends the system when battery is low") - } - } - ConfigSpinBox { - text: Translation.tr("Suspend at") - value: Config.options.battery.suspend - from: 0 - to: 100 - stepSize: 5 - onValueChanged: { - Config.options.battery.suspend = value; - } - } - } - } - ContentSection { icon: "cell_tower" title: Translation.tr("Networking") @@ -241,42 +150,4 @@ ContentPage { } } } - - ContentSection { - icon: "nest_clock_farsight_analog" - title: Translation.tr("Time") - - ContentSubsection { - title: Translation.tr("Format") - tooltip: "" - - ConfigSelectionArray { - currentValue: Config.options.time.format - onSelected: newValue => { - if (newValue === "hh:mm") { - Quickshell.execDetached(["bash", "-c", `sed -i 's/\\TIME12\\b/TIME/' '${FileUtils.trimFileProtocol(Directories.config)}/hypr/hyprlock.conf'`]); - } else { - Quickshell.execDetached(["bash", "-c", `sed -i 's/\\TIME\\b/TIME12/' '${FileUtils.trimFileProtocol(Directories.config)}/hypr/hyprlock.conf'`]); - } - - Config.options.time.format = newValue; - - } - options: [ - { - displayName: Translation.tr("24h"), - value: "hh:mm" - }, - { - displayName: Translation.tr("12h am/pm"), - value: "h:mm ap" - }, - { - displayName: Translation.tr("12h AM/PM"), - value: "h:mm AP" - }, - ] - } - } - } } diff --git a/.config/quickshell/ii/settings.qml b/.config/quickshell/ii/settings.qml index 9994c7609..22a6a7ddf 100644 --- a/.config/quickshell/ii/settings.qml +++ b/.config/quickshell/ii/settings.qml @@ -28,6 +28,12 @@ ApplicationWindow { icon: "instant_mix", component: "modules/settings/QuickConfig.qml" }, + { + name: Translation.tr("General"), + icon: "dashboard", + iconRotation: 180, + component: "modules/settings/GeneralConfig.qml" + }, { name: Translation.tr("Bar"), icon: "toast",