diff --git a/.config/hypr/hyprland/env.conf b/.config/hypr/hyprland/env.conf index 6f1316304..62e931fd7 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 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 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 diff --git a/.config/quickshell/ii/modules/background/Background.qml b/.config/quickshell/ii/modules/background/Background.qml index cc9b28a1f..47c16f21a 100644 --- a/.config/quickshell/ii/modules/background/Background.qml +++ b/.config/quickshell/ii/modules/background/Background.qml @@ -28,12 +28,11 @@ Variants { // Hide when fullscreen property list workspacesForMonitor: Hyprland.workspaces.values.filter(workspace=>workspace.monitor && workspace.monitor.name == monitor.name) property var activeWorkspaceWithFullscreen: workspacesForMonitor.filter(workspace=>((workspace.toplevels.values.filter(window=>window.wayland.fullscreen)[0] != undefined) && workspace.active))[0] - visible: !(activeWorkspaceWithFullscreen != undefined) // 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 diff --git a/.config/quickshell/ii/modules/bar/ActiveWindow.qml b/.config/quickshell/ii/modules/bar/ActiveWindow.qml index c571b1d02..9e7eeba1f 100644 --- a/.config/quickshell/ii/modules/bar/ActiveWindow.qml +++ b/.config/quickshell/ii/modules/bar/ActiveWindow.qml @@ -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/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/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/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 bcbbd1e33..ac8c4da41 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: 120 + property int touchpadScrollFactor: 450 + } + } + property JsonObject language: JsonObject { property JsonObject translator: JsonObject { property string engine: "auto" // Run `trans -list-engines` for available engines. auto should use google @@ -198,6 +206,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/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 } diff --git a/.config/quickshell/ii/modules/common/widgets/StyledFlickable.qml b/.config/quickshell/ii/modules/common/widgets/StyledFlickable.qml index 14b3af03c..7fcf7be88 100644 --- a/.config/quickshell/ii/modules/common/widgets/StyledFlickable.qml +++ b/.config/quickshell/ii/modules/common/widgets/StyledFlickable.qml @@ -1,6 +1,35 @@ import QtQuick +import qs.modules.common Flickable { + id: root maximumFlickVelocity: 3500 boundsBehavior: Flickable.DragOverBounds + + 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) { + 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) >= 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; + } + } + + 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 7021f24a4..6a9cf258f 100644 --- a/.config/quickshell/ii/modules/common/widgets/StyledListView.qml +++ b/.config/quickshell/ii/modules/common/widgets/StyledListView.qml @@ -15,6 +15,10 @@ ListView { property real dragDistance: 0 property bool popin: true + 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 root.dragDistance = 0 @@ -23,6 +27,29 @@ ListView { maximumFlickVelocity: 3500 boundsBehavior: Flickable.DragOverBounds + MouseArea { + anchors.fill: parent + acceptedButtons: Qt.NoButton + onWheel: function(wheelEvent) { + 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) >= 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; + } + } + + 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/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')) && 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/.config/quickshell/ii/modules/sidebarLeft/AiChat.qml b/.config/quickshell/ii/modules/sidebarLeft/AiChat.qml index dcbff893e..3817afe50 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: Config.options.interactions.scrolling.touchpadScrollFactor * 1.4 + mouseScrollFactor: Config.options.interactions.scrolling.mouseScrollFactor * 1.4 + property int lastResponseLength: 0 clip: true @@ -296,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 a72837725..97dabd942 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: Config.options.interactions.scrolling.touchpadScrollFactor * 1.4 + mouseScrollFactor: Config.options.interactions.scrolling.mouseScrollFactor * 1.4 + property int lastResponseLength: 0 clip: true @@ -149,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) { 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..24a0892fb 100644 --- a/.config/quickshell/ii/services/ai/OpenAiApiStrategy.qml +++ b/.config/quickshell/ii/services/ai/OpenAiApiStrategy.qml @@ -72,6 +72,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 }; }