From e59dd2cab273802d4f5f19acc3274392532cd6e7 Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Sat, 12 Jul 2025 20:13:26 +0700 Subject: [PATCH 1/8] add option to disable theming (#1586) --- .../quickshell/ii/modules/common/Config.qml | 5 ++ .../ii/modules/settings/AdvancedConfig.qml | 46 +++++++++++++++++++ .../ii/scripts/colors/applycolor.sh | 15 +++++- .../ii/scripts/colors/switchwall.sh | 20 ++++++++ .config/quickshell/ii/settings.qml | 5 ++ 5 files changed, 89 insertions(+), 2 deletions(-) create mode 100644 .config/quickshell/ii/modules/settings/AdvancedConfig.qml diff --git a/.config/quickshell/ii/modules/common/Config.qml b/.config/quickshell/ii/modules/common/Config.qml index 5d427a977..1b9b1dd81 100644 --- a/.config/quickshell/ii/modules/common/Config.qml +++ b/.config/quickshell/ii/modules/common/Config.qml @@ -66,6 +66,11 @@ Singleton { property bool extraBackgroundTint: true property int fakeScreenRounding: 2 // 0: None | 1: Always | 2: When not fullscreen property bool transparency: false + property JsonObject wallpaperTheming: JsonObject { + property bool enableAppsAndShell: true + property bool enableQtApps: true + property bool enableTerminal: true + } property JsonObject palette: JsonObject { property string type: "auto" // Allowed: auto, scheme-content, scheme-expressive, scheme-fidelity, scheme-fruit-salad, scheme-monochrome, scheme-neutral, scheme-rainbow, scheme-tonal-spot } diff --git a/.config/quickshell/ii/modules/settings/AdvancedConfig.qml b/.config/quickshell/ii/modules/settings/AdvancedConfig.qml new file mode 100644 index 000000000..d0f22d4d7 --- /dev/null +++ b/.config/quickshell/ii/modules/settings/AdvancedConfig.qml @@ -0,0 +1,46 @@ +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts +import "root:/services/" +import "root:/modules/common/" +import "root:/modules/common/widgets/" + +ContentPage { + forceWidth: true + + ContentSection { + title: "Color generation" + + ConfigRow { + uniform: true + ConfigSwitch { + text: "Shell & utilities" + checked: Config.options.appearance.wallpaperTheming.enableAppsAndShell + onCheckedChanged: { + Config.options.appearance.wallpaperTheming.enableAppsAndShell = checked; + } + } + ConfigSwitch { + text: "Qt apps" + checked: Config.options.appearance.wallpaperTheming.enableQtApps + onCheckedChanged: { + Config.options.appearance.wallpaperTheming.enableQtApps = checked; + } + StyledToolTip { + content: "Shell & utilities theming must also be enabled" + } + } + ConfigSwitch { + text: "Terminal" + checked: Config.options.appearance.wallpaperTheming.enableTerminal + onCheckedChanged: { + Config.options.appearance.wallpaperTheming.enableTerminal = checked; + } + StyledToolTip { + content: "Shell & utilities theming must also be enabled" + } + } + + } + } +} diff --git a/.config/quickshell/ii/scripts/colors/applycolor.sh b/.config/quickshell/ii/scripts/colors/applycolor.sh index b86fb679e..ddb93bd20 100755 --- a/.config/quickshell/ii/scripts/colors/applycolor.sh +++ b/.config/quickshell/ii/scripts/colors/applycolor.sh @@ -57,5 +57,16 @@ apply_qt() { python "$CONFIG_DIR/scripts/kvantum/changeAdwColors.py" # apply config colors } -apply_qt & -apply_term & +# Check if terminal theming is enabled in config +CONFIG_FILE="$XDG_CONFIG_HOME/illogical-impulse/config.json" +if [ -f "$CONFIG_FILE" ]; then + enable_terminal=$(jq -r '.appearance.wallpaperTheming.enableTerminal' "$CONFIG_FILE") + if [ "$enable_terminal" = "true" ]; then + apply_term & + fi +else + echo "Config file not found at $CONFIG_FILE. Applying terminal theming by default." + apply_term & +fi + +# apply_qt & # Qt theming is already handled by kde-material-colors diff --git a/.config/quickshell/ii/scripts/colors/switchwall.sh b/.config/quickshell/ii/scripts/colors/switchwall.sh index de76444fd..0d9ffadbf 100755 --- a/.config/quickshell/ii/scripts/colors/switchwall.sh +++ b/.config/quickshell/ii/scripts/colors/switchwall.sh @@ -12,6 +12,15 @@ MATUGEN_DIR="$XDG_CONFIG_HOME/matugen" terminalscheme="$SCRIPT_DIR/terminal/scheme-base.json" handle_kde_material_you_colors() { + # Check if Qt app theming is enabled in config + CONFIG_FILE="$XDG_CONFIG_HOME/illogical-impulse/config.json" + if [ -f "$CONFIG_FILE" ]; then + enable_qt_apps=$(jq -r '.appearance.wallpaperTheming.enableQtApps' "$CONFIG_FILE") + if [ "$enable_qt_apps" == "false" ]; then + return + fi + fi + # Map $type_flag to allowed scheme variants for kde-material-you-colors-wrapper.sh local kde_scheme_variant="" case "$type_flag" in @@ -46,6 +55,7 @@ post_process() { local screen_height="$2" local wallpaper_path="$3" + handle_kde_material_you_colors & # Determine the largest region on the wallpaper that's sufficiently un-busy to put widgets in @@ -242,6 +252,16 @@ switch() { pre_process "$mode_flag" + # Check if app and shell theming is enabled in config + CONFIG_FILE="$XDG_CONFIG_HOME/illogical-impulse/config.json" + if [ -f "$CONFIG_FILE" ]; then + enable_apps_shell=$(jq -r '.appearance.wallpaperTheming.enableAppsAndShell' "$CONFIG_FILE") + if [ "$enable_apps_shell" == "false" ]; then + echo "App and shell theming disabled, skipping matugen and color generation" + return + fi + fi + matugen "${matugen_args[@]}" source "$(eval echo $ILLOGICAL_IMPULSE_VIRTUAL_ENV)/bin/activate" python3 "$SCRIPT_DIR/generate_colors_material.py" "${generate_colors_material_args[@]}" \ diff --git a/.config/quickshell/ii/settings.qml b/.config/quickshell/ii/settings.qml index 0e181e0b9..e76f8dcb6 100644 --- a/.config/quickshell/ii/settings.qml +++ b/.config/quickshell/ii/settings.qml @@ -42,6 +42,11 @@ ApplicationWindow { icon: "settings", component: "modules/settings/ServicesConfig.qml" }, + { + name: "Advanced", + icon: "construction", + component: "modules/settings/AdvancedConfig.qml" + }, { name: "About", icon: "info", From 271732ed0b1243dbe1bf867bcc02bf8adc59cdfc Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Sat, 12 Jul 2025 20:36:34 +0700 Subject: [PATCH 2/8] bar: weather: fix popup position for bottom bar --- .config/quickshell/ii/modules/bar/weather/WeatherBar.qml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.config/quickshell/ii/modules/bar/weather/WeatherBar.qml b/.config/quickshell/ii/modules/bar/weather/WeatherBar.qml index eae1b6132..a77a2a43f 100644 --- a/.config/quickshell/ii/modules/bar/weather/WeatherBar.qml +++ b/.config/quickshell/ii/modules/bar/weather/WeatherBar.qml @@ -46,9 +46,11 @@ MouseArea { implicitWidth: weatherPopup.implicitWidth implicitHeight: weatherPopup.implicitHeight anchor.item: root - anchor.edges: Edges.Bottom + anchor.edges: Edges.Top anchor.rect.x: (root.implicitWidth - popupWindow.implicitWidth) / 2 - anchor.rect.y: root.implicitHeight + 10 + anchor.rect.y: Config.options.bar.bottom ? + (-weatherPopup.implicitHeight - 15) : + (root.implicitHeight + 15 ) color: "transparent" WeatherPopup { id: weatherPopup From 1641425fffd05591c214d4b5094174011a3a4406 Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Sat, 12 Jul 2025 22:37:38 +0700 Subject: [PATCH 3/8] reapply bar corner transparency fix --- .config/quickshell/ii/modules/bar/Bar.qml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.config/quickshell/ii/modules/bar/Bar.qml b/.config/quickshell/ii/modules/bar/Bar.qml index eeb77f993..7c7f675d7 100644 --- a/.config/quickshell/ii/modules/bar/Bar.qml +++ b/.config/quickshell/ii/modules/bar/Bar.qml @@ -533,7 +533,6 @@ Scope { size: Appearance.rounding.screenRounding color: showBarBackground ? Appearance.colors.colLayer0 : "transparent" - opacity: 1.0 - Appearance.transparency corner: RoundCorner.CornerEnum.TopLeft states: State { @@ -553,7 +552,6 @@ Scope { } size: Appearance.rounding.screenRounding color: showBarBackground ? Appearance.colors.colLayer0 : "transparent" - opacity: 1.0 - Appearance.transparency corner: RoundCorner.CornerEnum.TopRight states: State { From 59afc892f4978bcb206e85ee7b1b46c88cf6d8dd Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Sat, 12 Jul 2025 22:42:25 +0700 Subject: [PATCH 4/8] Revert "bar: use lazyloader" too lazy so revert, bar needed in most cases anyway --- .config/quickshell/ii/modules/bar/Bar.qml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.config/quickshell/ii/modules/bar/Bar.qml b/.config/quickshell/ii/modules/bar/Bar.qml index 7c7f675d7..27d5a6de9 100644 --- a/.config/quickshell/ii/modules/bar/Bar.qml +++ b/.config/quickshell/ii/modules/bar/Bar.qml @@ -37,11 +37,11 @@ Scope { return screens; return screens.filter(screen => list.includes(screen.name)); } - LazyLoader { + Loader { id: barLoader - activeAsync: GlobalStates.barOpen + active: GlobalStates.barOpen required property ShellScreen modelData - component: PanelWindow { // Bar window + sourceComponent: PanelWindow { // Bar window id: barRoot screen: barLoader.modelData From e98f84d9bc34d2bc182d508ceabf30a561af9c9b Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Sun, 13 Jul 2025 00:20:58 +0700 Subject: [PATCH 5/8] bar: fix media title spilling for non-verbose --- .config/quickshell/ii/modules/bar/Media.qml | 1 + 1 file changed, 1 insertion(+) diff --git a/.config/quickshell/ii/modules/bar/Media.qml b/.config/quickshell/ii/modules/bar/Media.qml index 9e7ff96cd..dfad0e207 100644 --- a/.config/quickshell/ii/modules/bar/Media.qml +++ b/.config/quickshell/ii/modules/bar/Media.qml @@ -68,6 +68,7 @@ Item { } StyledText { + visible: Config.options.bar.verbose width: rowLayout.width - (CircularProgress.size + rowLayout.spacing * 2) Layout.alignment: Qt.AlignVCenter Layout.fillWidth: true // Ensures the text takes up available space From f726c9495e61b2ecc0250ffbfe92a8d48e149b31 Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Sun, 13 Jul 2025 01:53:40 +0700 Subject: [PATCH 6/8] media controls: fix black color on first open --- .config/quickshell/ii/modules/mediaControls/PlayerControl.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/quickshell/ii/modules/mediaControls/PlayerControl.qml b/.config/quickshell/ii/modules/mediaControls/PlayerControl.qml index 9cce01112..b58bd7421 100644 --- a/.config/quickshell/ii/modules/mediaControls/PlayerControl.qml +++ b/.config/quickshell/ii/modules/mediaControls/PlayerControl.qml @@ -23,7 +23,7 @@ Item { // Player instance property string artDownloadLocation: Directories.coverArt property string artFileName: Qt.md5(artUrl) + ".jpg" property string artFilePath: `${artDownloadLocation}/${artFileName}` - property color artDominantColor: ColorUtils.mix(colorQuantizer?.colors[0], Appearance.colors.colPrimaryContainer, 0.8) || Appearance.m3colors.m3secondaryContainer + property color artDominantColor: ColorUtils.mix((colorQuantizer?.colors[0] ?? Appearance.colors.colPrimary), Appearance.colors.colPrimaryContainer, 0.8) || Appearance.m3colors.m3secondaryContainer property bool downloaded: false property list visualizerPoints: [] property real maxVisualizerValue: 1000 // Max value in the data points From a5831cf3657dc91e92cf6a9fbf48858343485b1d Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Sun, 13 Jul 2025 01:54:13 +0700 Subject: [PATCH 7/8] slider: more accurate sizes --- .../modules/common/widgets/StyledSlider.qml | 120 ++++++++++++------ 1 file changed, 81 insertions(+), 39 deletions(-) diff --git a/.config/quickshell/ii/modules/common/widgets/StyledSlider.qml b/.config/quickshell/ii/modules/common/widgets/StyledSlider.qml index ca0980030..93fe43f33 100644 --- a/.config/quickshell/ii/modules/common/widgets/StyledSlider.qml +++ b/.config/quickshell/ii/modules/common/widgets/StyledSlider.qml @@ -6,26 +6,53 @@ import QtQuick.Controls import QtQuick.Layouts import Quickshell.Widgets -// Material 3 slider. See https://m3.material.io/components/sliders/overview +/** + * Material 3 slider. See https://m3.material.io/components/sliders/overview + * It doesn't exactly match the spec because it does not make sense to have stuff on a computer that fucking huge. + * Should be at 3/4 scale... + */ + Slider { id: root - property real scale: 0.85 - property real backgroundDotSize: 4 * scale - property real backgroundDotMargins: 4 * scale - // property real handleMargins: 0 * scale - property real handleMargins: (root.pressed ? 0 : 2) * scale - property real handleWidth: (root.pressed ? 3 : 5) * scale - property real handleHeight: 44 * scale - property real handleLimit: root.backgroundDotMargins - property real trackHeight: 30 * scale + + property list stopIndicatorValues: [1] + enum Configuration { + XS = 12, + S = 18, + M = 30, + L = 42, + XL = 72 + } + + property var configuration: StyledSlider.Configuration.S + + property real handleDefaultWidth: 3 + property real handlePressedWidth: 1.5 + property color highlightColor: Appearance.colors.colPrimary property color trackColor: Appearance.colors.colSecondaryContainer property color handleColor: Appearance.m3colors.m3onSecondaryContainer - property real trackRadius: Appearance.rounding.verysmall * scale + property color dotColor: Appearance.m3colors.m3onSecondaryContainer + property color dotColorHighlighted: Appearance.m3colors.m3onPrimary property real unsharpenRadius: Appearance.rounding.unsharpen - - property real limitedHandleRangeWidth: (root.availableWidth - handleWidth - root.handleLimit * 2) + property real trackWidth: configuration + property real trackRadius: trackWidth >= StyledSlider.Configuration.XL ? 21 + : trackWidth >= StyledSlider.Configuration.L ? 12 + : trackWidth >= StyledSlider.Configuration.M ? 9 + : 6 + property real handleHeight: Math.max(33, trackWidth + 9) + property real handleWidth: root.pressed ? handlePressedWidth : handleDefaultWidth + property real handleMargins: 4 + onHandleMarginsChanged: { + console.log("Handle margins changed to", handleMargins); + } + property real trackDotSize: 3 property string tooltipContent: `${Math.round(value * 100)}%` + + leftPadding: handleMargins + rightPadding: handleMargins + property real effectiveDraggingWidth: width - leftPadding - rightPadding + Layout.fillWidth: true from: 0 to: 1 @@ -37,10 +64,20 @@ Slider { } Behavior on handleMargins { - NumberAnimation { - duration: Appearance.animation.elementMoveFast.duration - easing.type: Appearance.animation.elementMoveFast.type - easing.bezierCurve: Appearance.animation.elementMoveFast.bezierCurve + animation: Appearance.animation.elementMoveFast.numberAnimation.createObject(this) + } + + component TrackDot: Rectangle { + required property real value + anchors.verticalCenter: parent.verticalCenter + x: root.handleMargins + (value * root.effectiveDraggingWidth) - (root.trackDotSize / 2) + width: root.trackDotSize + height: root.trackDotSize + radius: Appearance.rounding.full + color: value > root.visualPosition ? root.dotColor : root.dotColorHighlighted + + Behavior on color { + animation: Appearance.animation.elementMoveFast.colorAnimation.createObject(this) } } @@ -52,14 +89,17 @@ Slider { background: Item { anchors.verticalCenter: parent.verticalCenter - implicitHeight: trackHeight + width: parent.width + implicitHeight: trackWidth // Fill left Rectangle { - anchors.verticalCenter: parent.verticalCenter - anchors.left: parent.left - width: root.handleLimit * 2 + root.visualPosition * root.limitedHandleRangeWidth - (root.handleMargins + root.handleWidth / 2) - height: trackHeight + anchors { + verticalCenter: parent.verticalCenter + left: parent.left + } + width: root.handleMargins + (root.visualPosition * root.effectiveDraggingWidth) - (root.handleWidth / 2 + root.handleMargins) + height: trackWidth color: root.highlightColor topLeftRadius: root.trackRadius bottomLeftRadius: root.trackRadius @@ -69,35 +109,37 @@ Slider { // Fill right Rectangle { - anchors.verticalCenter: parent.verticalCenter - anchors.right: parent.right - width: root.handleLimit * 2 + (1 - root.visualPosition) * root.limitedHandleRangeWidth - (root.handleMargins + root.handleWidth / 2) - height: trackHeight + anchors { + verticalCenter: parent.verticalCenter + right: parent.right + } + width: root.handleMargins + ((1 - root.visualPosition) * root.effectiveDraggingWidth) - (root.handleWidth / 2 + root.handleMargins) + height: trackWidth color: root.trackColor - topLeftRadius: root.unsharpenRadius - bottomLeftRadius: root.unsharpenRadius topRightRadius: root.trackRadius bottomRightRadius: root.trackRadius + topLeftRadius: root.unsharpenRadius + bottomLeftRadius: root.unsharpenRadius } - // Dot at the end - Rectangle { - anchors.verticalCenter: parent.verticalCenter - anchors.right: parent.right - anchors.rightMargin: root.backgroundDotMargins - width: root.backgroundDotSize - height: root.backgroundDotSize - radius: Appearance.rounding.full - color: root.handleColor + // Stop indicators + Repeater { + model: root.stopIndicatorValues + TrackDot { + required property real modelData + value: modelData + anchors.verticalCenter: parent.verticalCenter + } } } handle: Rectangle { id: handle - x: root.leftPadding + root.handleLimit + root.visualPosition * root.limitedHandleRangeWidth - y: root.topPadding + root.availableHeight / 2 - height / 2 + implicitWidth: root.handleWidth implicitHeight: root.handleHeight + x: root.handleMargins + (root.visualPosition * root.effectiveDraggingWidth) - (root.handleWidth / 2) + anchors.verticalCenter: parent.verticalCenter radius: Appearance.rounding.full color: root.handleColor From 66d1d3e9c35163693c0d2520e84b15b7632b073a Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Sun, 13 Jul 2025 01:54:30 +0700 Subject: [PATCH 8/8] volume mixer: adjust layout --- .../volumeMixer/VolumeMixerEntry.qml | 73 ++++++++++--------- 1 file changed, 37 insertions(+), 36 deletions(-) diff --git a/.config/quickshell/ii/modules/sidebarRight/volumeMixer/VolumeMixerEntry.qml b/.config/quickshell/ii/modules/sidebarRight/volumeMixer/VolumeMixerEntry.qml index c4600c7b8..84cb572c8 100644 --- a/.config/quickshell/ii/modules/sidebarRight/volumeMixer/VolumeMixerEntry.qml +++ b/.config/quickshell/ii/modules/sidebarRight/volumeMixer/VolumeMixerEntry.qml @@ -11,55 +11,56 @@ import Quickshell.Services.Pipewire Item { id: root - required property PwNode node; - PwObjectTracker { objects: [ node ] } + required property PwNode node + PwObjectTracker { + objects: [node] + } implicitHeight: rowLayout.implicitHeight RowLayout { id: rowLayout anchors.fill: parent - spacing: 10 + spacing: 6 + + Image { + property real size: slider.height * 0.9 + Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter + visible: source != "" + sourceSize.width: size + sourceSize.height: size + source: { + let icon; + icon = AppSearch.guessIcon(root.node.properties["application.icon-name"]); + if (AppSearch.iconExists(icon)) + return Quickshell.iconPath(icon, "image-missing"); + icon = AppSearch.guessIcon(root.node.properties["node.name"]); + return Quickshell.iconPath(icon, "image-missing"); + } + } ColumnLayout { Layout.fillWidth: true - spacing: 0 + spacing: -4 - RowLayout { - StyledText { - Layout.fillWidth: true - font.pixelSize: Appearance.font.pixelSize.normal - elide: Text.ElideRight - text: { - // application.name -> description -> name - const app = root.node.properties["application.name"] ?? (root.node.description != "" ? root.node.description : root.node.name); - const media = root.node.properties["media.name"]; - return media != undefined ? `${app} • ${media}` : app; - } + StyledText { + Layout.fillWidth: true + font.pixelSize: Appearance.font.pixelSize.small + color: Appearance.colors.colSubtext + elide: Text.ElideRight + text: { + // application.name -> description -> name + const app = root.node.properties["application.name"] ?? (root.node.description != "" ? root.node.description : root.node.name); + const media = root.node.properties["media.name"]; + return media != undefined ? `${app} • ${media}` : app; } } - RowLayout { - Image { - property real size: slider.trackHeight * 1.3 - Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter - visible: source != "" - sourceSize.width: size - sourceSize.height: size - source: { - let icon; - icon = AppSearch.guessIcon(root.node.properties["application.icon-name"]); - if (AppSearch.iconExists(icon)) return Quickshell.iconPath(icon, "image-missing"); - icon = AppSearch.guessIcon(root.node.properties["node.name"]); - return Quickshell.iconPath(icon, "image-missing"); - } - } - StyledSlider { - id: slider - value: root.node.audio.volume - onValueChanged: root.node.audio.volume = value - } + StyledSlider { + id: slider + value: root.node.audio.volume + onValueChanged: root.node.audio.volume = value } } } -} \ No newline at end of file +}