From 6ae03b545cf3665abcf20ec33c0fa834d41e7b4a Mon Sep 17 00:00:00 2001 From: sansmoraxz Date: Fri, 1 Aug 2025 22:22:01 +0530 Subject: [PATCH 01/13] terminal env var --- .config/hypr/hyprland/keybinds.conf | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.config/hypr/hyprland/keybinds.conf b/.config/hypr/hyprland/keybinds.conf index 5a3140069..0cc42bcd5 100644 --- a/.config/hypr/hyprland/keybinds.conf +++ b/.config/hypr/hyprland/keybinds.conf @@ -201,10 +201,10 @@ bindl= ,XF86AudioPlay, exec, playerctl play-pause # [hidden] bindl= ,XF86AudioPause, exec, playerctl play-pause # [hidden] ##! Apps -bind = Super, Return, exec, ~/.config/hypr/hyprland/scripts/launch_first_available.sh "kitty -1" "foot" "alacritty" "wezterm" "konsole" "kgx" "uxterm" "xterm" # Terminal -bind = Super, T, exec, ~/.config/hypr/hyprland/scripts/launch_first_available.sh "kitty -1" "foot" "alacritty" "wezterm" "konsole" "kgx" "uxterm" "xterm" # [hidden] Kitty (terminal) (alt) -bind = Ctrl+Alt, T, exec, ~/.config/hypr/hyprland/scripts/launch_first_available.sh "kitty -1" "foot" "alacritty" "wezterm" "konsole" "kgx" "uxterm" "xterm" # [hidden] Kitty (for Ubuntu people) -bind = Super, E, exec, ~/.config/hypr/hyprland/scripts/launch_first_available.sh "dolphin" "nautilus" "nemo" "thunar" "kitty -1 fish -c yazi" # File manager +bind = Super, Return, exec, ~/.config/hypr/hyprland/scripts/launch_first_available.sh "$TERMINAL" "kitty -1" "foot" "alacritty" "wezterm" "konsole" "kgx" "uxterm" "xterm" # Terminal +bind = Super, T, exec, ~/.config/hypr/hyprland/scripts/launch_first_available.sh "$TERMINAL" "kitty -1" "foot" "alacritty" "wezterm" "konsole" "kgx" "uxterm" "xterm" # [hidden] (terminal) (alt) +bind = Ctrl+Alt, T, exec, ~/.config/hypr/hyprland/scripts/launch_first_available.sh "$TERMINAL" "kitty -1" "foot" "alacritty" "wezterm" "konsole" "kgx" "uxterm" "xterm" # [hidden] (terminal) (for Ubuntu people) +bind = Super, E, exec, ~/.config/hypr/hyprland/scripts/launch_first_available.sh "dolphin" "nautilus" "nemo" "thunar" "$TERMINAL" "kitty -1 fish -c yazi" # File manager bind = Super, W, exec, ~/.config/hypr/hyprland/scripts/launch_first_available.sh "google-chrome-stable" "zen-browser" "firefox" "brave" "chromium" "microsoft-edge-stable" "opera" "librewolf" # Browser bind = Super, C, exec, ~/.config/hypr/hyprland/scripts/launch_first_available.sh "code" "codium" "cursor" "zed" "zedit" "zeditor" "kate" "gnome-text-editor" "emacs" "command -v nvim && kitty -1 nvim" # Code editor bind = Super+Shift, W, exec, ~/.config/hypr/hyprland/scripts/launch_first_available.sh "wps" "onlyoffice-desktopeditors" # Office software From dc2777703d74a8a119246284dae4938567c59897 Mon Sep 17 00:00:00 2001 From: sansmoraxz Date: Fri, 1 Aug 2025 22:47:01 +0530 Subject: [PATCH 02/13] update default terminal value --- .config/hypr/hyprland/env.conf | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.config/hypr/hyprland/env.conf b/.config/hypr/hyprland/env.conf index 6f1316304..c58b67a26 100644 --- a/.config/hypr/hyprland/env.conf +++ b/.config/hypr/hyprland/env.conf @@ -22,3 +22,6 @@ env = XDG_MENU_PREFIX, plasma- # ######## Virtual envrionment ######### env = ILLOGICAL_IMPULSE_VIRTUAL_ENV, ~/.local/state/quickshell/.venv + +# ######## Terminal application ######### +env = TERMINAL, "kitty -1" From 2b554cf2863e79f990e2da79b6c34fbd9f20cdcd Mon Sep 17 00:00:00 2001 From: Souyama Date: Sat, 2 Aug 2025 00:28:47 +0530 Subject: [PATCH 03/13] Update env.conf remote direct quotes --- .config/hypr/hyprland/env.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/hypr/hyprland/env.conf b/.config/hypr/hyprland/env.conf index c58b67a26..62e931fd7 100644 --- a/.config/hypr/hyprland/env.conf +++ b/.config/hypr/hyprland/env.conf @@ -24,4 +24,4 @@ env = XDG_MENU_PREFIX, plasma- env = ILLOGICAL_IMPULSE_VIRTUAL_ENV, ~/.local/state/quickshell/.venv # ######## Terminal application ######### -env = TERMINAL, "kitty -1" +env = TERMINAL,kitty -1 From d632111cf97d21be2e116b1ededcfd4d6a6add57 Mon Sep 17 00:00:00 2001 From: finjener Date: Sun, 3 Aug 2025 22:42:42 +0100 Subject: [PATCH 04/13] quickshell: fix qml null safety and monitor property errors --- .config/quickshell/ii/modules/background/Background.qml | 8 ++++---- .config/quickshell/ii/modules/bar/ActiveWindow.qml | 6 +++--- .config/quickshell/ii/modules/bar/weather/WeatherBar.qml | 4 ++-- .config/quickshell/ii/modules/overview/Overview.qml | 2 +- .config/quickshell/ii/modules/overview/OverviewWidget.qml | 4 ++-- .local/state/quickshell/user/ai/chats/chat.json | 7 +++++++ 6 files changed, 19 insertions(+), 12 deletions(-) create mode 100644 .local/state/quickshell/user/ai/chats/chat.json diff --git a/.config/quickshell/ii/modules/background/Background.qml b/.config/quickshell/ii/modules/background/Background.qml index dc6bdece1..5cffaa9f3 100644 --- a/.config/quickshell/ii/modules/background/Background.qml +++ b/.config/quickshell/ii/modules/background/Background.qml @@ -28,12 +28,12 @@ Scope { // Hide when fullscreen readonly property Toplevel activeWindow: ToplevelManager.activeToplevel - property bool focusingThisMonitor: HyprlandData.activeWorkspace.monitor == monitor.name + property bool focusingThisMonitor: HyprlandData.activeWorkspace?.monitor == monitor?.name visible: !(activeWindow?.fullscreen && activeWindow?.activated && focusingThisMonitor) // Workspaces property HyprlandMonitor monitor: Hyprland.monitorFor(modelData) - property list relevantWindows: HyprlandData.windowList.filter(win => win.monitor == monitor.id && win.workspace.id >= 0).sort((a, b) => a.workspace.id - b.workspace.id) + property list relevantWindows: HyprlandData.windowList.filter(win => win.monitor == monitor?.id && win.workspace.id >= 0).sort((a, b) => a.workspace.id - b.workspace.id) property int firstWorkspaceId: relevantWindows[0]?.workspace.id || 1 property int lastWorkspaceId: relevantWindows[relevantWindows.length - 1]?.workspace.id || 10 // Wallpaper @@ -157,7 +157,7 @@ Scope { const lower = Math.floor(bgRoot.firstWorkspaceId / chunkSize) * chunkSize; const upper = Math.ceil(bgRoot.lastWorkspaceId / chunkSize) * chunkSize; const range = upper - lower; - return (Config.options.background.parallax.enableWorkspace ? ((bgRoot.monitor.activeWorkspace.id - lower) / range) : 0.5) + return (Config.options.background.parallax.enableWorkspace ? ((bgRoot.monitor?.activeWorkspace?.id ?? 1 - lower) / range) : 0.5) + (0.15 * GlobalStates.sidebarRightOpen * Config.options.background.parallax.enableSidebar) - (0.15 * GlobalStates.sidebarLeftOpen * Config.options.background.parallax.enableSidebar) } @@ -199,7 +199,7 @@ Scope { ColumnLayout { id: clockColumn - anchors.centerIn: wallpaper + anchors.centerIn: parent spacing: 0 StyledText { diff --git a/.config/quickshell/ii/modules/bar/ActiveWindow.qml b/.config/quickshell/ii/modules/bar/ActiveWindow.qml index 636b23136..bb2b59e5f 100644 --- a/.config/quickshell/ii/modules/bar/ActiveWindow.qml +++ b/.config/quickshell/ii/modules/bar/ActiveWindow.qml @@ -14,8 +14,8 @@ Item { readonly property Toplevel activeWindow: ToplevelManager.activeToplevel property string activeWindowAddress: `0x${activeWindow?.HyprlandToplevel?.address}` - property bool focusingThisMonitor: HyprlandData.activeWorkspace.monitor == monitor.name - property var biggestWindow: HyprlandData.biggestWindowForWorkspace(HyprlandData.monitors[root.monitor.id]?.activeWorkspace.id) + property bool focusingThisMonitor: HyprlandData.activeWorkspace?.monitor == monitor?.name + property var biggestWindow: HyprlandData.biggestWindowForWorkspace(HyprlandData.monitors[root.monitor?.id]?.activeWorkspace.id) implicitWidth: colLayout.implicitWidth @@ -45,7 +45,7 @@ Item { elide: Text.ElideRight text: root.focusingThisMonitor && root.activeWindow?.activated && root.biggestWindow ? root.activeWindow?.title : - (root.biggestWindow?.title) ?? `${Translation.tr("Workspace")} ${monitor.activeWorkspace?.id}` + (root.biggestWindow?.title) ?? `${Translation.tr("Workspace")} ${monitor?.activeWorkspace?.id ?? 1}` } } diff --git a/.config/quickshell/ii/modules/bar/weather/WeatherBar.qml b/.config/quickshell/ii/modules/bar/weather/WeatherBar.qml index 363d9ba53..933750f9a 100644 --- a/.config/quickshell/ii/modules/bar/weather/WeatherBar.qml +++ b/.config/quickshell/ii/modules/bar/weather/WeatherBar.qml @@ -21,7 +21,7 @@ MouseArea { MaterialSymbol { fill: 0 - text: WeatherIcons.codeToName[Weather.data.wCode] + text: WeatherIcons.codeToName[Weather.data?.wCode] ?? "question_mark" iconSize: Appearance.font.pixelSize.large color: Appearance.colors.colOnLayer1 Layout.alignment: Qt.AlignVCenter @@ -31,7 +31,7 @@ MouseArea { visible: true font.pixelSize: Appearance.font.pixelSize.small color: Appearance.colors.colOnLayer1 - text: Weather.data.temp + text: Weather.data?.temp ?? "--°" Layout.alignment: Qt.AlignVCenter } } diff --git a/.config/quickshell/ii/modules/overview/Overview.qml b/.config/quickshell/ii/modules/overview/Overview.qml index 80c692b6b..89845bc6f 100644 --- a/.config/quickshell/ii/modules/overview/Overview.qml +++ b/.config/quickshell/ii/modules/overview/Overview.qml @@ -21,7 +21,7 @@ Scope { required property var modelData property string searchingText: "" readonly property HyprlandMonitor monitor: Hyprland.monitorFor(root.screen) - property bool monitorIsFocused: (Hyprland.focusedMonitor?.id == monitor.id) + property bool monitorIsFocused: (Hyprland.focusedMonitor?.id == monitor?.id) screen: modelData visible: GlobalStates.overviewOpen diff --git a/.config/quickshell/ii/modules/overview/OverviewWidget.qml b/.config/quickshell/ii/modules/overview/OverviewWidget.qml index 550d72c1a..9cfe9147e 100644 --- a/.config/quickshell/ii/modules/overview/OverviewWidget.qml +++ b/.config/quickshell/ii/modules/overview/OverviewWidget.qml @@ -20,7 +20,7 @@ Item { property var windows: HyprlandData.windowList property var windowByAddress: HyprlandData.windowByAddress property var windowAddresses: HyprlandData.addresses - property var monitorData: HyprlandData.monitors.find(m => m.id === root.monitor.id) + property var monitorData: HyprlandData.monitors.find(m => m.id === root.monitor?.id) property real scale: Config.options.overview.scale property color activeBorderColor: Appearance.colors.colSecondary @@ -149,7 +149,7 @@ Item { const address = `0x${toplevel.HyprlandToplevel.address}` var win = windowByAddress[address] const inWorkspaceGroup = (root.workspaceGroup * root.workspacesShown < win?.workspace?.id && win?.workspace?.id <= (root.workspaceGroup + 1) * root.workspacesShown) - const inMonitor = root.monitor.id === win.monitor + const inMonitor = root.monitor?.id === win.monitor return inWorkspaceGroup && inMonitor; }) } diff --git a/.local/state/quickshell/user/ai/chats/chat.json b/.local/state/quickshell/user/ai/chats/chat.json new file mode 100644 index 000000000..20540c1d0 --- /dev/null +++ b/.local/state/quickshell/user/ai/chats/chat.json @@ -0,0 +1,7 @@ +{ + "messages": [], + "created": "2024-01-01T00:00:00Z", + "updated": "2024-01-01T00:00:00Z", + "title": "Default Chat", + "id": "default" +} \ No newline at end of file From 86ddb61a3ff4da07f434f8441cf21e87fce0d6fc Mon Sep 17 00:00:00 2001 From: Runze Date: Thu, 7 Aug 2025 22:26:26 +0800 Subject: [PATCH 05/13] fix(touchpad): differentiate scroll speed between touchpad and mouse wheel --- .../modules/common/widgets/StyledFlickable.qml | 18 ++++++++++++++++++ .../modules/common/widgets/StyledListView.qml | 17 +++++++++++++++++ .../ii/modules/sidebarLeft/AiChat.qml | 3 +++ .../ii/modules/sidebarLeft/Anime.qml | 3 +++ 4 files changed, 41 insertions(+) diff --git a/.config/quickshell/ii/modules/common/widgets/StyledFlickable.qml b/.config/quickshell/ii/modules/common/widgets/StyledFlickable.qml index 14b3af03c..b077e141d 100644 --- a/.config/quickshell/ii/modules/common/widgets/StyledFlickable.qml +++ b/.config/quickshell/ii/modules/common/widgets/StyledFlickable.qml @@ -1,6 +1,24 @@ import QtQuick Flickable { + id: root maximumFlickVelocity: 3500 boundsBehavior: Flickable.DragOverBounds + + property real touchpadScrollFactor: 100 + property real mouseScrollFactor: 50 + + MouseArea { + anchors.fill: parent + acceptedButtons: Qt.NoButton + onWheel: function(wheelEvent) { + var delta = wheelEvent.angleDelta.y / 120; + // The angleDelta.y of a touchpad is usually small and continuous, + // while that of a mouse wheel is typically in multiples of ±120. + var scrollFactor = Math.abs(wheelEvent.angleDelta.y) >= 120 ? root.mouseScrollFactor : root.touchpadScrollFactor; + var targetY = root.contentY - delta * scrollFactor; + targetY = Math.max(0, Math.min(targetY, root.contentHeight - root.height)); + root.contentY = targetY; + } + } } diff --git a/.config/quickshell/ii/modules/common/widgets/StyledListView.qml b/.config/quickshell/ii/modules/common/widgets/StyledListView.qml index 7021f24a4..c6119fcc0 100644 --- a/.config/quickshell/ii/modules/common/widgets/StyledListView.qml +++ b/.config/quickshell/ii/modules/common/widgets/StyledListView.qml @@ -15,6 +15,9 @@ ListView { property real dragDistance: 0 property bool popin: true + property real touchpadScrollFactor: 100 + property real mouseScrollFactor: 50 + function resetDrag() { root.dragIndex = -1 root.dragDistance = 0 @@ -23,6 +26,20 @@ ListView { maximumFlickVelocity: 3500 boundsBehavior: Flickable.DragOverBounds + MouseArea { + anchors.fill: parent + acceptedButtons: Qt.NoButton + onWheel: function(wheelEvent) { + var delta = wheelEvent.angleDelta.y / 120; + // The angleDelta.y of a touchpad is usually small and continuous, + // while that of a mouse wheel is typically in multiples of ±120. + var scrollFactor = Math.abs(wheelEvent.angleDelta.y) >= 120 ? root.mouseScrollFactor : root.touchpadScrollFactor; + var targetY = root.contentY - delta * scrollFactor; + targetY = Math.max(0, Math.min(targetY, root.contentHeight - root.height)); + root.contentY = targetY; + } + } + add: Transition { animations: [ Appearance?.animation.elementMove.numberAnimation.createObject(this, { diff --git a/.config/quickshell/ii/modules/sidebarLeft/AiChat.qml b/.config/quickshell/ii/modules/sidebarLeft/AiChat.qml index dcbff893e..9120a8f72 100644 --- a/.config/quickshell/ii/modules/sidebarLeft/AiChat.qml +++ b/.config/quickshell/ii/modules/sidebarLeft/AiChat.qml @@ -282,6 +282,9 @@ Inline w/ backslash and round brackets \\(e^{i\\pi} + 1 = 0\\) spacing: 10 popin: false + touchpadScrollFactor: 600 + mouseScrollFactor: 200 + property int lastResponseLength: 0 clip: true diff --git a/.config/quickshell/ii/modules/sidebarLeft/Anime.qml b/.config/quickshell/ii/modules/sidebarLeft/Anime.qml index a72837725..07575ca36 100644 --- a/.config/quickshell/ii/modules/sidebarLeft/Anime.qml +++ b/.config/quickshell/ii/modules/sidebarLeft/Anime.qml @@ -137,6 +137,9 @@ Item { anchors.fill: parent spacing: 10 + touchpadScrollFactor: 600 + mouseScrollFactor: 200 + property int lastResponseLength: 0 clip: true From f581fd4821ac1a19931a38ae4de0300af86d45d5 Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Thu, 7 Aug 2025 21:39:48 +0700 Subject: [PATCH 06/13] config option to (not) filter duplicate media controls --- .config/quickshell/ii/modules/common/Config.qml | 5 +++++ .../quickshell/ii/modules/mediaControls/MediaControls.qml | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.config/quickshell/ii/modules/common/Config.qml b/.config/quickshell/ii/modules/common/Config.qml index bcbbd1e33..503b23b73 100644 --- a/.config/quickshell/ii/modules/common/Config.qml +++ b/.config/quickshell/ii/modules/common/Config.qml @@ -198,6 +198,11 @@ Singleton { } } + property JsonObject media: JsonObject { + // Attempt to remove dupes (the aggregator playerctl one and browsers' native ones when there's plasma browser integration) + property bool filterDuplicatePlayers: true + } + property JsonObject networking: JsonObject { property string userAgent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36" } diff --git a/.config/quickshell/ii/modules/mediaControls/MediaControls.qml b/.config/quickshell/ii/modules/mediaControls/MediaControls.qml index 06d1a3818..2d880d010 100644 --- a/.config/quickshell/ii/modules/mediaControls/MediaControls.qml +++ b/.config/quickshell/ii/modules/mediaControls/MediaControls.qml @@ -25,7 +25,7 @@ Scope { property real artRounding: Appearance.rounding.verysmall property list visualizerPoints: [] - property bool hasPlasmaIntegration: true + property bool hasPlasmaIntegration: false Process { id: plasmaIntegrationAvailabilityCheckProc running: true @@ -35,7 +35,9 @@ Scope { } } function isRealPlayer(player) { - // return true + if (!Config.options.media.filterDuplicatePlayers) { + return true; + } return ( // Remove unecessary native buses from browsers if there's plasma integration !(hasPlasmaIntegration && player.dbusName.startsWith('org.mpris.MediaPlayer2.firefox')) && From 733a79261064754f3f9e67708757c8064a9e009c Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Thu, 7 Aug 2025 21:53:37 +0700 Subject: [PATCH 07/13] ai: add usage metadata for openai and mistral --- .../quickshell/ii/services/ai/MistralApiStrategy.qml | 11 +++++++++++ .../quickshell/ii/services/ai/OpenAiApiStrategy.qml | 12 ++++++++++++ 2 files changed, 23 insertions(+) diff --git a/.config/quickshell/ii/services/ai/MistralApiStrategy.qml b/.config/quickshell/ii/services/ai/MistralApiStrategy.qml index dfcb950eb..1ae7fc13f 100644 --- a/.config/quickshell/ii/services/ai/MistralApiStrategy.qml +++ b/.config/quickshell/ii/services/ai/MistralApiStrategy.qml @@ -100,6 +100,17 @@ ApiStrategy { message.content += newContent; message.rawContent += newContent; + // Usage metadata + if (dataJson.usage) { + return { + tokenUsage: { + input: dataJson.usage.prompt_tokens ?? -1, + output: dataJson.usage.completion_tokens ?? -1, + total: dataJson.usage.total_tokens ?? -1 + } + }; + } + if (`dataJson`.done) { return { finished: true }; } diff --git a/.config/quickshell/ii/services/ai/OpenAiApiStrategy.qml b/.config/quickshell/ii/services/ai/OpenAiApiStrategy.qml index a5792ace7..85d5e0463 100644 --- a/.config/quickshell/ii/services/ai/OpenAiApiStrategy.qml +++ b/.config/quickshell/ii/services/ai/OpenAiApiStrategy.qml @@ -46,6 +46,7 @@ ApiStrategy { // Real stuff try { const dataJson = JSON.parse(cleanData); + console.log(JSON.stringify(dataJson, null, 2)); let newContent = ""; const responseContent = dataJson.choices[0]?.delta?.content || dataJson.message?.content; @@ -72,6 +73,17 @@ ApiStrategy { message.content += newContent; message.rawContent += newContent; + // Usage metadata + if (dataJson.usage) { + return { + tokenUsage: { + input: dataJson.usage.prompt_tokens ?? -1, + output: dataJson.usage.completion_tokens ?? -1, + total: dataJson.usage.total_tokens ?? -1 + } + }; + } + if (dataJson.done) { return { finished: true }; } From 4f40ba8e6e910a5c556384f33d5bba07b9901f0c Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Thu, 7 Aug 2025 22:01:05 +0700 Subject: [PATCH 08/13] more intuitive power profiles icons --- .config/quickshell/ii/modules/bar/UtilButtons.qml | 6 +++--- .config/quickshell/ii/services/ai/OpenAiApiStrategy.qml | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.config/quickshell/ii/modules/bar/UtilButtons.qml b/.config/quickshell/ii/modules/bar/UtilButtons.qml index a9ecbb5a4..98ee4f6cd 100644 --- a/.config/quickshell/ii/modules/bar/UtilButtons.qml +++ b/.config/quickshell/ii/modules/bar/UtilButtons.qml @@ -129,9 +129,9 @@ Item { horizontalAlignment: Qt.AlignHCenter fill: 0 text: switch(PowerProfiles.profile) { - case PowerProfile.PowerSaver: return "battery_saver" - case PowerProfile.Balanced: return "dynamic_form" - case PowerProfile.Performance: return "speed" + case PowerProfile.PowerSaver: return "energy_savings_leaf" + case PowerProfile.Balanced: return "settings_slow_motion" + case PowerProfile.Performance: return "local_fire_department" } iconSize: Appearance.font.pixelSize.large color: Appearance.colors.colOnLayer2 diff --git a/.config/quickshell/ii/services/ai/OpenAiApiStrategy.qml b/.config/quickshell/ii/services/ai/OpenAiApiStrategy.qml index 85d5e0463..24a0892fb 100644 --- a/.config/quickshell/ii/services/ai/OpenAiApiStrategy.qml +++ b/.config/quickshell/ii/services/ai/OpenAiApiStrategy.qml @@ -46,7 +46,6 @@ ApiStrategy { // Real stuff try { const dataJson = JSON.parse(cleanData); - console.log(JSON.stringify(dataJson, null, 2)); let newContent = ""; const responseContent = dataJson.choices[0]?.delta?.content || dataJson.message?.content; From 0506917b87c2edc1689793bf31b4af41e8cb5415 Mon Sep 17 00:00:00 2001 From: Souyama Date: Thu, 7 Aug 2025 20:48:11 +0530 Subject: [PATCH 09/13] launch_first_available.sh should skip empty cmds --- .config/hypr/hyprland/scripts/launch_first_available.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/hypr/hyprland/scripts/launch_first_available.sh b/.config/hypr/hyprland/scripts/launch_first_available.sh index 499947a9d..31dd23a55 100755 --- a/.config/hypr/hyprland/scripts/launch_first_available.sh +++ b/.config/hypr/hyprland/scripts/launch_first_available.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash for cmd in "$@"; do + [[ -z "$cmd" ]] && continue eval "command -v ${cmd%% *}" >/dev/null 2>&1 || continue eval "$cmd" & exit done -exit 1 From f1c1ed833c28a455bfc5056b0fd9fcd830a57bc5 Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Thu, 7 Aug 2025 22:31:19 +0700 Subject: [PATCH 10/13] use StyledListView for SelectionDialog --- .../quickshell/ii/modules/common/widgets/SelectionDialog.qml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.config/quickshell/ii/modules/common/widgets/SelectionDialog.qml b/.config/quickshell/ii/modules/common/widgets/SelectionDialog.qml index 72da7ec5e..6044cbfea 100644 --- a/.config/quickshell/ii/modules/common/widgets/SelectionDialog.qml +++ b/.config/quickshell/ii/modules/common/widgets/SelectionDialog.qml @@ -63,7 +63,7 @@ Item { Layout.rightMargin: dialogPadding } - ListView { + StyledListView { id: choiceListView Layout.fillWidth: true Layout.fillHeight: true @@ -71,9 +71,6 @@ Item { currentIndex: root.defaultChoice !== undefined ? root.items.indexOf(root.defaultChoice) : -1 spacing: 6 - maximumFlickVelocity: 3500 - boundsBehavior: Flickable.DragOverBounds - model: ScriptModel { id: choiceModel } From 199b23d14a929125a40c9e6ddfda8184f000e912 Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Thu, 7 Aug 2025 22:32:02 +0700 Subject: [PATCH 11/13] add config options for scroll factors and threshold --- .config/quickshell/ii/modules/common/Config.qml | 8 ++++++++ .../ii/modules/common/widgets/StyledFlickable.qml | 10 ++++++---- .../ii/modules/common/widgets/StyledListView.qml | 9 +++++---- 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/.config/quickshell/ii/modules/common/Config.qml b/.config/quickshell/ii/modules/common/Config.qml index bcbbd1e33..d2b979c6a 100644 --- a/.config/quickshell/ii/modules/common/Config.qml +++ b/.config/quickshell/ii/modules/common/Config.qml @@ -181,6 +181,14 @@ Singleton { property list ignoredAppRegexes: [] } + property JsonObject interactions: JsonObject { + property JsonObject scrolling: JsonObject { + property int mouseScrollDeltaThreshold: 120 // delta >= this then it gets detected as mouse scroll rather than touchpad + property int mouseScrollFactor: 50 + property int touchpadScrollFactor: 100 + } + } + property JsonObject language: JsonObject { property JsonObject translator: JsonObject { property string engine: "auto" // Run `trans -list-engines` for available engines. auto should use google diff --git a/.config/quickshell/ii/modules/common/widgets/StyledFlickable.qml b/.config/quickshell/ii/modules/common/widgets/StyledFlickable.qml index b077e141d..bde7bff9b 100644 --- a/.config/quickshell/ii/modules/common/widgets/StyledFlickable.qml +++ b/.config/quickshell/ii/modules/common/widgets/StyledFlickable.qml @@ -1,21 +1,23 @@ import QtQuick +import qs.modules.common Flickable { id: root maximumFlickVelocity: 3500 boundsBehavior: Flickable.DragOverBounds - property real touchpadScrollFactor: 100 - property real mouseScrollFactor: 50 + property real touchpadScrollFactor: Config?.options.interactions.scrolling.touchpadScrollFactor ?? 100 + property real mouseScrollFactor: Config?.options.interactions.scrolling.mouseScrollFactor ?? 50 + property real mouseScrollDeltaThreshold: Config?.options.interactions.scrolling.mouseScrollDeltaThreshold ?? 120 MouseArea { anchors.fill: parent acceptedButtons: Qt.NoButton onWheel: function(wheelEvent) { - var delta = wheelEvent.angleDelta.y / 120; + const delta = wheelEvent.angleDelta.y / root.mouseScrollDeltaThreshold; // The angleDelta.y of a touchpad is usually small and continuous, // while that of a mouse wheel is typically in multiples of ±120. - var scrollFactor = Math.abs(wheelEvent.angleDelta.y) >= 120 ? root.mouseScrollFactor : root.touchpadScrollFactor; + var scrollFactor = Math.abs(wheelEvent.angleDelta.y) >= root.mouseScrollDeltaThreshold ? root.mouseScrollFactor : root.touchpadScrollFactor; var targetY = root.contentY - delta * scrollFactor; targetY = Math.max(0, Math.min(targetY, root.contentHeight - root.height)); root.contentY = targetY; diff --git a/.config/quickshell/ii/modules/common/widgets/StyledListView.qml b/.config/quickshell/ii/modules/common/widgets/StyledListView.qml index c6119fcc0..61e6740fc 100644 --- a/.config/quickshell/ii/modules/common/widgets/StyledListView.qml +++ b/.config/quickshell/ii/modules/common/widgets/StyledListView.qml @@ -15,8 +15,9 @@ ListView { property real dragDistance: 0 property bool popin: true - property real touchpadScrollFactor: 100 - property real mouseScrollFactor: 50 + property real touchpadScrollFactor: Config?.options.interactions.scrolling.touchpadScrollFactor ?? 100 + property real mouseScrollFactor: Config?.options.interactions.scrolling.mouseScrollFactor ?? 50 + property real mouseScrollDeltaThreshold: Config?.options.interactions.scrolling.mouseScrollDeltaThreshold ?? 120 function resetDrag() { root.dragIndex = -1 @@ -30,10 +31,10 @@ ListView { anchors.fill: parent acceptedButtons: Qt.NoButton onWheel: function(wheelEvent) { - var delta = wheelEvent.angleDelta.y / 120; + const delta = wheelEvent.angleDelta.y / root.mouseScrollDeltaThreshold; // The angleDelta.y of a touchpad is usually small and continuous, // while that of a mouse wheel is typically in multiples of ±120. - var scrollFactor = Math.abs(wheelEvent.angleDelta.y) >= 120 ? root.mouseScrollFactor : root.touchpadScrollFactor; + var scrollFactor = Math.abs(wheelEvent.angleDelta.y) >= root.mouseScrollDeltaThreshold ? root.mouseScrollFactor : root.touchpadScrollFactor; var targetY = root.contentY - delta * scrollFactor; targetY = Math.max(0, Math.min(targetY, root.contentHeight - root.height)); root.contentY = targetY; From a31733e2db5651e6d14743160b2534031f7c49b0 Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Thu, 7 Aug 2025 22:39:30 +0700 Subject: [PATCH 12/13] move scrolling animation to styled components --- .../ii/modules/common/widgets/StyledFlickable.qml | 9 +++++++++ .../ii/modules/common/widgets/StyledListView.qml | 9 +++++++++ .config/quickshell/ii/modules/sidebarLeft/AiChat.qml | 9 --------- .config/quickshell/ii/modules/sidebarLeft/Anime.qml | 9 --------- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/.config/quickshell/ii/modules/common/widgets/StyledFlickable.qml b/.config/quickshell/ii/modules/common/widgets/StyledFlickable.qml index bde7bff9b..7fcf7be88 100644 --- a/.config/quickshell/ii/modules/common/widgets/StyledFlickable.qml +++ b/.config/quickshell/ii/modules/common/widgets/StyledFlickable.qml @@ -23,4 +23,13 @@ Flickable { root.contentY = targetY; } } + + Behavior on contentY { + NumberAnimation { + id: scrollAnim + duration: Appearance.animation.scroll.duration + easing.type: Appearance.animation.scroll.type + easing.bezierCurve: Appearance.animation.scroll.bezierCurve + } + } } diff --git a/.config/quickshell/ii/modules/common/widgets/StyledListView.qml b/.config/quickshell/ii/modules/common/widgets/StyledListView.qml index 61e6740fc..6a9cf258f 100644 --- a/.config/quickshell/ii/modules/common/widgets/StyledListView.qml +++ b/.config/quickshell/ii/modules/common/widgets/StyledListView.qml @@ -41,6 +41,15 @@ ListView { } } + Behavior on contentY { + NumberAnimation { + id: scrollAnim + duration: Appearance.animation.scroll.duration + easing.type: Appearance.animation.scroll.type + easing.bezierCurve: Appearance.animation.scroll.bezierCurve + } + } + add: Transition { animations: [ Appearance?.animation.elementMove.numberAnimation.createObject(this, { diff --git a/.config/quickshell/ii/modules/sidebarLeft/AiChat.qml b/.config/quickshell/ii/modules/sidebarLeft/AiChat.qml index 9120a8f72..f3a1dae8f 100644 --- a/.config/quickshell/ii/modules/sidebarLeft/AiChat.qml +++ b/.config/quickshell/ii/modules/sidebarLeft/AiChat.qml @@ -299,15 +299,6 @@ Inline w/ backslash and round brackets \\(e^{i\\pi} + 1 = 0\\) add: null // Prevent function calls from being janky - Behavior on contentY { - NumberAnimation { - id: scrollAnim - duration: Appearance.animation.scroll.duration - easing.type: Appearance.animation.scroll.type - easing.bezierCurve: Appearance.animation.scroll.bezierCurve - } - } - model: ScriptModel { values: Ai.messageIDs.filter(id => { const message = Ai.messageByID[id]; diff --git a/.config/quickshell/ii/modules/sidebarLeft/Anime.qml b/.config/quickshell/ii/modules/sidebarLeft/Anime.qml index 07575ca36..68d4947b8 100644 --- a/.config/quickshell/ii/modules/sidebarLeft/Anime.qml +++ b/.config/quickshell/ii/modules/sidebarLeft/Anime.qml @@ -152,15 +152,6 @@ Item { } } - Behavior on contentY { - NumberAnimation { - id: scrollAnim - duration: Appearance.animation.scroll.duration - easing.type: Appearance.animation.scroll.type - easing.bezierCurve: Appearance.animation.scroll.bezierCurve - } - } - model: ScriptModel { values: { if(root.responses.length > booruResponseListView.lastResponseLength) { From 7013b459a3884376e35272ded87c73ee654e2251 Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Thu, 7 Aug 2025 23:13:07 +0700 Subject: [PATCH 13/13] adjust scrolling speed --- .config/quickshell/ii/modules/common/Appearance.qml | 3 +-- .config/quickshell/ii/modules/common/Config.qml | 4 ++-- .config/quickshell/ii/modules/sidebarLeft/AiChat.qml | 4 ++-- .config/quickshell/ii/modules/sidebarLeft/Anime.qml | 4 ++-- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/.config/quickshell/ii/modules/common/Appearance.qml b/.config/quickshell/ii/modules/common/Appearance.qml index 9c9374860..cfc9e1cae 100644 --- a/.config/quickshell/ii/modules/common/Appearance.qml +++ b/.config/quickshell/ii/modules/common/Appearance.qml @@ -266,7 +266,6 @@ Singleton { easing.bezierCurve: root.animation.elementMoveFast.bezierCurve }} } - property QtObject clickBounce: QtObject { property int duration: 200 property int type: Easing.BezierSpline @@ -279,7 +278,7 @@ Singleton { }} } property QtObject scroll: QtObject { - property int duration: 400 + property int duration: 200 property int type: Easing.BezierSpline property list bezierCurve: animationCurves.standardDecel } diff --git a/.config/quickshell/ii/modules/common/Config.qml b/.config/quickshell/ii/modules/common/Config.qml index d2b979c6a..ed10b805d 100644 --- a/.config/quickshell/ii/modules/common/Config.qml +++ b/.config/quickshell/ii/modules/common/Config.qml @@ -184,8 +184,8 @@ Singleton { property JsonObject interactions: JsonObject { property JsonObject scrolling: JsonObject { property int mouseScrollDeltaThreshold: 120 // delta >= this then it gets detected as mouse scroll rather than touchpad - property int mouseScrollFactor: 50 - property int touchpadScrollFactor: 100 + property int mouseScrollFactor: 120 + property int touchpadScrollFactor: 450 } } diff --git a/.config/quickshell/ii/modules/sidebarLeft/AiChat.qml b/.config/quickshell/ii/modules/sidebarLeft/AiChat.qml index f3a1dae8f..3817afe50 100644 --- a/.config/quickshell/ii/modules/sidebarLeft/AiChat.qml +++ b/.config/quickshell/ii/modules/sidebarLeft/AiChat.qml @@ -282,8 +282,8 @@ Inline w/ backslash and round brackets \\(e^{i\\pi} + 1 = 0\\) spacing: 10 popin: false - touchpadScrollFactor: 600 - mouseScrollFactor: 200 + touchpadScrollFactor: Config.options.interactions.scrolling.touchpadScrollFactor * 1.4 + mouseScrollFactor: Config.options.interactions.scrolling.mouseScrollFactor * 1.4 property int lastResponseLength: 0 diff --git a/.config/quickshell/ii/modules/sidebarLeft/Anime.qml b/.config/quickshell/ii/modules/sidebarLeft/Anime.qml index 68d4947b8..97dabd942 100644 --- a/.config/quickshell/ii/modules/sidebarLeft/Anime.qml +++ b/.config/quickshell/ii/modules/sidebarLeft/Anime.qml @@ -137,8 +137,8 @@ Item { anchors.fill: parent spacing: 10 - touchpadScrollFactor: 600 - mouseScrollFactor: 200 + touchpadScrollFactor: Config.options.interactions.scrolling.touchpadScrollFactor * 1.4 + mouseScrollFactor: Config.options.interactions.scrolling.mouseScrollFactor * 1.4 property int lastResponseLength: 0