diff --git a/.config/fish/config.fish b/.config/fish/config.fish index 4a86ee4f8..8e0c95bf3 100755 --- a/.config/fish/config.fish +++ b/.config/fish/config.fish @@ -20,6 +20,7 @@ end alias pamcan pacman alias ls 'eza --icons' alias clear "printf '\033[2J\033[3J\033[1;1H'" +alias q 'qs -c ii' # function fish_prompt diff --git a/.config/hypr/hyprland.conf b/.config/hypr/hyprland.conf index 48648f475..5698f5945 100644 --- a/.config/hypr/hyprland.conf +++ b/.config/hypr/hyprland.conf @@ -1,6 +1,7 @@ # This file sources other files in `hyprland` and `custom` folders # You wanna add your stuff in files in `custom` +$qsConfig = ii exec = hyprctl dispatch submap global # DO NOT REMOVE THIS OR YOU WON'T BE ABLE TO USE ANY KEYBIND submap = global # This is required for catchall to work diff --git a/.config/hypr/hyprland/execs.conf b/.config/hypr/hyprland/execs.conf index 9d4747a90..33fc3ffb7 100644 --- a/.config/hypr/hyprland/execs.conf +++ b/.config/hypr/hyprland/execs.conf @@ -1,8 +1,8 @@ # Bar, wallpaper -exec-once = swww-daemon --format xrgb --no-cache -exec-once = sleep 0.5; swww img "$(cat ~/.local/state/quickshell/user/generated/wallpaper/path.txt)" --transition-step 100 --transition-fps 120 --transition-type grow --transition-angle 30 --transition-duration 1 exec-once = ~/.config/hypr/hyprland/scripts/start_geoclue_agent.sh & gammastep -exec-once = qs & +exec-once = sleep 0.7; [ "$(hyprctl monitors -j | jq 'length')" -eq 1 ] && swww-daemon --format xrgb --no-cache || swww-daemon --format xrgb +exec-once = sleep 0.7; swww img "$(cat ~/.local/state/quickshell/user/generated/wallpaper/path.txt)" --transition-step 100 --transition-fps 120 --transition-type grow --transition-angle 30 --transition-duration 1 +exec-once = qs -c $qsConfig & # Input method exec-once = fcitx5 diff --git a/.config/hypr/hyprland/keybinds.conf b/.config/hypr/hyprland/keybinds.conf index a07d4255c..d7c208648 100644 --- a/.config/hypr/hyprland/keybinds.conf +++ b/.config/hypr/hyprland/keybinds.conf @@ -5,7 +5,7 @@ ##! Shell # These absolutely need to be on top, or they won't work consistently bindid = Super, Super_L, Toggle overview, global, quickshell:overviewToggleRelease # Toggle overview/launcher -bind = Super, Super_L, exec, qs ipc call TEST_ALIVE || pkill fuzzel || fuzzel # [hidden] Launcher (fallback) +bind = Super, Super_L, exec, qs -c $qsConfig ipc call TEST_ALIVE || pkill fuzzel || fuzzel # [hidden] Launcher (fallback) binditn = Super, catchall, global, quickshell:overviewToggleReleaseInterrupt # [hidden] bind = Ctrl, Super_L, global, quickshell:overviewToggleReleaseInterrupt # [hidden] bind = Super, mouse:272, global, quickshell:overviewToggleReleaseInterrupt # [hidden] @@ -30,11 +30,12 @@ bindd = Super, Slash, Toggle cheatsheet, global, quickshell:cheatsheetToggle # T bindd = Super, K, Toggle on-screen keyboard, global, quickshell:oskToggle # Toggle on-screen keyboard bindd = Super, M, Toggle media controls, global, quickshell:mediaControlsToggle # Toggle media controls bindd = Ctrl+Alt, Delete, Toggle session menu, global, quickshell:sessionToggle # Toggle session menu -bind = Ctrl+Alt, Delete, exec, qs ipc call TEST_ALIVE || pkill wlogout || wlogout -p layer-shell # [hidden] Session menu (fallback) -bind = Shift+Super+Alt, Slash, exec, qs -p ~/.config/quickshell/welcome.qml # [hidden] Launch welcome app +bindd = Super, J, Toggle bar, global, quickshell:barToggle # Toggle bar +bind = Ctrl+Alt, Delete, exec, qs -c $qsConfig ipc call TEST_ALIVE || pkill wlogout || wlogout -p layer-shell # [hidden] Session menu (fallback) +bind = Shift+Super+Alt, Slash, exec, qs -p ~/.config/quickshell/$qsConfig/welcome.qml # [hidden] Launch welcome app -bindle=, XF86MonBrightnessUp, exec, qs ipc call brightness increment || brightnessctl s 5%+ # [hidden] -bindle=, XF86MonBrightnessDown, exec, qs ipc call brightness decrement || brightnessctl s 5%- # [hidden] +bindle=, XF86MonBrightnessUp, exec, qs -c $qsConfig ipc call brightness increment || brightnessctl s 5%+ # [hidden] +bindle=, XF86MonBrightnessDown, exec, qs -c $qsConfig ipc call brightness decrement || brightnessctl s 5%- # [hidden] bindle=, XF86AudioRaiseVolume, exec, wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 2%+ # [hidden] bindle=, XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 2%- # [hidden] @@ -43,14 +44,14 @@ bindld = Super+Shift,M, Toggle mute, exec, wpctl set-mute @DEFAULT_SINK@ toggle bindl = Alt ,XF86AudioMute, exec, wpctl set-mute @DEFAULT_SOURCE@ toggle # [hidden] bindl = ,XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_SOURCE@ toggle # [hidden] bindld = Super+Alt,M, Toggle mic, exec, wpctl set-mute @DEFAULT_SOURCE@ toggle # [hidden] -bindd = Ctrl+Super, T, Change wallpaper, exec, ~/.config/quickshell/scripts/colors/switchwall.sh # Change wallpaper -bind = Ctrl+Super, R, exec, killall ags agsv1 gjs ydotool qs quickshell; qs & # Restart widgets +bindd = Ctrl+Super, T, Change wallpaper, exec, ~/.config/quickshell/$qsConfig/scripts/colors/switchwall.sh # Change wallpaper +bind = Ctrl+Super, R, exec, killall ags agsv1 gjs ydotool qs quickshell; qs -c $qsConfig & # Restart widgets ##! Utilities # Screenshot, Record, OCR, Color picker, Clipboard history -bindd = Super, V, Copy clipboard history entry, exec, qs ipc call TEST_ALIVE || pkill fuzzel || cliphist list | fuzzel --match-mode fzf --dmenu | cliphist decode | wl-copy # [hidden] Clipboard history >> clipboard (fallback) -bindd = Super, Period, Copy an emoji, exec, qs ipc call TEST_ALIVE || pkill fuzzel || ~/.config/hypr/hyprland/scripts/fuzzel-emoji.sh copy # [hidden] Emoji >> clipboard (fallback) -bindd = Super+Shift, S, Screen snip, exec, qs -p ~/.config/quickshell/screenshot.qml || pidof slurp || hyprshot --freeze --clipboard-only --mode region --silent # Screen snip +bindd = Super, V, Copy clipboard history entry, exec, qs -c $qsConfig ipc call TEST_ALIVE || pkill fuzzel || cliphist list | fuzzel --match-mode fzf --dmenu | cliphist decode | wl-copy # [hidden] Clipboard history >> clipboard (fallback) +bindd = Super, Period, Copy an emoji, exec, qs -c $qsConfig ipc call TEST_ALIVE || pkill fuzzel || ~/.config/hypr/hyprland/scripts/fuzzel-emoji.sh copy # [hidden] Emoji >> clipboard (fallback) +bindd = Super+Shift, S, Screen snip, exec, qs -p ~/.config/quickshell/$qsConfig/screenshot.qml || pidof slurp || hyprshot --freeze --clipboard-only --mode region --silent # Screen snip # OCR bindd = Super+Shift, T, Character recognition,exec,grim -g "$(slurp $SLURP_ARGS)" "tmp.png" && tesseract "tmp.png" - | wl-copy && rm "tmp.png" # [hidden] # Color picker @@ -183,10 +184,10 @@ bindd = Ctrl+Shift+Alt+Super, Delete, Shutdown, exec, systemctl poweroff || logi ##! Screen # Zoom -binde = Super, Minus, exec, qs ipc call zoom zoomOut # Zoom out -binde = Super, Equal, exec, qs ipc call zoom zoomIn # Zoom in -binde = Super, Minus, exec, qs ipc call TEST_ALIVE || ~/.config/hypr/hyprland/scripts/zoom.sh decrease 0.1 # [hidden] Zoom out -binde = Super, Equal, exec, qs ipc call TEST_ALIVE || ~/.config/hypr/hyprland/scripts/zoom.sh increase 0.1 # [hidden] Zoom in +binde = Super, Minus, exec, qs -c $qsConfig ipc call zoom zoomOut # Zoom out +binde = Super, Equal, exec, qs -c $qsConfig ipc call zoom zoomIn # Zoom in +binde = Super, Minus, exec, qs -c $qsConfig ipc call TEST_ALIVE || ~/.config/hypr/hyprland/scripts/zoom.sh decrease 0.1 # [hidden] Zoom out +binde = Super, Equal, exec, qs -c $qsConfig ipc call TEST_ALIVE || ~/.config/hypr/hyprland/scripts/zoom.sh increase 0.1 # [hidden] Zoom in ##! Media bindl= Super+Shift, N, exec, playerctl next || playerctl position `bc <<< "100 * $(playerctl metadata mpris:length) / 1000000 / 100"` # Next track @@ -205,12 +206,12 @@ bind = Super, T, exec, ~/.config/hypr/hyprland/scripts/launch_first_available.sh 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, W, exec, ~/.config/hypr/hyprland/scripts/launch_first_available.sh "google-chrome-stable" "zen-browser" "firefox" "brave" "chromium" "microsoft-edge-stable" "opera" # Browser -bind = Super, C, exec, ~/.config/hypr/hyprland/scripts/launch_first_available.sh "code" "codium" "zed" "zedit" "zeditor" "kate" "gnome-text-editor" "emacs" "command -v nvim && kitty -1 nvim" # Code editor +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 bind = Super, X, exec, ~/.config/hypr/hyprland/scripts/launch_first_available.sh "kate" "gnome-text-editor" "emacs" # Text editor bind = Ctrl+Super, V, exec, ~/.config/hypr/hyprland/scripts/launch_first_available.sh "pavucontrol-qt" "pavucontrol" # Volume mixer -bind = Super, I, exec, XDG_CURRENT_DESKTOP=gnome ~/.config/hypr/hyprland/scripts/launch_first_available.sh "qs -p ~/.config/quickshell/settings.qml" "systemsettings" "gnome-control-center" "better-control" # Settings app -bind = Ctrl+Shift, Escape, exec, ~/.config/hypr/hyprland/scripts/launch_first_available.sh "gnome-system-monitor" "plasma-systemmonitzor --page-name Processes" "command -v btop && kitty -1 fish -c btop" # Task manager +bind = Super, I, exec, XDG_CURRENT_DESKTOP=gnome ~/.config/hypr/hyprland/scripts/launch_first_available.sh "qs -p ~/.config/quickshell/$qsConfig/settings.qml" "systemsettings" "gnome-control-center" "better-control" # Settings app +bind = Ctrl+Shift, Escape, exec, ~/.config/hypr/hyprland/scripts/launch_first_available.sh "gnome-system-monitor" "plasma-systemmonitor --page-name Processes" "command -v btop && kitty -1 fish -c btop" # Task manager # Cursed stuff ## Make window not amogus large diff --git a/.config/hypr/hyprland/rules.conf b/.config/hypr/hyprland/rules.conf index 2465cc0b8..6b6922a5b 100644 --- a/.config/hypr/hyprland/rules.conf +++ b/.config/hypr/hyprland/rules.conf @@ -27,12 +27,17 @@ windowrulev2 = float, class:.*bluedevilwizard windowrulev2 = float, title:.*Welcome windowrulev2 = float, title:^(illogical-impulse Settings)$ windowrulev2 = float, class:org.freedesktop.impl.portal.desktop.kde +windowrulev2 = float, class:^(Zotero)$ +windowrulev2 = size 45%, class:^(Zotero)$ -# No appearance + +# Move # kde-material-you-colors spawns a window when changing dark/light theme. This is to make sure it doesn't interfere at all. windowrulev2 = float, class:^(plasma-changeicons)$ windowrulev2 = noinitialfocus, class:^(plasma-changeicons)$ windowrulev2 = move 999999 999999, class:^(plasma-changeicons)$ +# stupid dolphin copy +windowrulev2 = move 40 80, title:^(Copying — Dolphin)$ # Tiling windowrulev2 = tile, class:^dev\.warp\.Warp$ @@ -135,6 +140,7 @@ layerrule = animation fade, quickshell:notificationPopup layerrule = blur, quickshell:backgroundWidgets layerrule = ignorealpha 0.05, quickshell:backgroundWidgets layerrule = noanim, quickshell:screenshot +layerrule = animation popin 120%, quickshell:screenCorners # Launchers need to be FAST diff --git a/.config/kde-material-you-colors/config.conf b/.config/kde-material-you-colors/config.conf index 1d63c8405..caa1fb8a4 100644 --- a/.config/kde-material-you-colors/config.conf +++ b/.config/kde-material-you-colors/config.conf @@ -10,7 +10,7 @@ monitor = 0 # File containing absolute path of an image (Takes precedence over automatic wallpaper detection) # Commented by default -file = /home/end/.local/state/quickshell/user/wallpaper.txt +file = ~/.local/state/quickshell/user/generated/wallpaper/path.txt # List of 7 space separated colors (hex or rgb) to be used for text in pywal/konsole/KSyntaxHighlighting instead of wallpaper ones # Accepted values are hex e.g #ff0000 and rgb e.g 255,0,0 colors (rgb is converted to hex) diff --git a/.config/qt6ct/qt6ct.conf b/.config/qt6ct/qt6ct.conf index e8163baa7..f7bfd6003 100644 --- a/.config/qt6ct/qt6ct.conf +++ b/.config/qt6ct/qt6ct.conf @@ -1,5 +1,5 @@ [Appearance] -color_scheme_path=/home/end/.config/qt6ct/style-colors.conf +color_scheme_path=~/.config/qt6ct/style-colors.conf custom_palette=true icon_theme=OneUI standard_dialogs=default diff --git a/.config/quickshell/.qmlformat.ini b/.config/quickshell/ii/.qmlformat.ini similarity index 100% rename from .config/quickshell/.qmlformat.ini rename to .config/quickshell/ii/.qmlformat.ini diff --git a/.config/quickshell/GlobalStates.qml b/.config/quickshell/ii/GlobalStates.qml similarity index 98% rename from .config/quickshell/GlobalStates.qml rename to .config/quickshell/ii/GlobalStates.qml index b7ddef5a9..75f7bd2cd 100644 --- a/.config/quickshell/GlobalStates.qml +++ b/.config/quickshell/ii/GlobalStates.qml @@ -8,6 +8,7 @@ pragma ComponentBehavior: Bound Singleton { id: root + property bool barOpen: true property bool sidebarLeftOpen: false property bool sidebarRightOpen: false property bool overviewOpen: false diff --git a/.config/quickshell/ReloadPopup.qml b/.config/quickshell/ii/ReloadPopup.qml similarity index 100% rename from .config/quickshell/ReloadPopup.qml rename to .config/quickshell/ii/ReloadPopup.qml diff --git a/.config/quickshell/assets/icons/ai-openai-symbolic.svg b/.config/quickshell/ii/assets/icons/ai-openai-symbolic.svg similarity index 100% rename from .config/quickshell/assets/icons/ai-openai-symbolic.svg rename to .config/quickshell/ii/assets/icons/ai-openai-symbolic.svg diff --git a/.config/quickshell/assets/icons/arch-symbolic.svg b/.config/quickshell/ii/assets/icons/arch-symbolic.svg similarity index 100% rename from .config/quickshell/assets/icons/arch-symbolic.svg rename to .config/quickshell/ii/assets/icons/arch-symbolic.svg diff --git a/.config/quickshell/assets/icons/cachyos-symbolic.svg b/.config/quickshell/ii/assets/icons/cachyos-symbolic.svg similarity index 100% rename from .config/quickshell/assets/icons/cachyos-symbolic.svg rename to .config/quickshell/ii/assets/icons/cachyos-symbolic.svg diff --git a/.config/quickshell/assets/icons/cloudflare-dns-symbolic.svg b/.config/quickshell/ii/assets/icons/cloudflare-dns-symbolic.svg similarity index 100% rename from .config/quickshell/assets/icons/cloudflare-dns-symbolic.svg rename to .config/quickshell/ii/assets/icons/cloudflare-dns-symbolic.svg diff --git a/.config/quickshell/assets/icons/crosshair-symbolic.svg b/.config/quickshell/ii/assets/icons/crosshair-symbolic.svg similarity index 100% rename from .config/quickshell/assets/icons/crosshair-symbolic.svg rename to .config/quickshell/ii/assets/icons/crosshair-symbolic.svg diff --git a/.config/quickshell/assets/icons/debian-symbolic.svg b/.config/quickshell/ii/assets/icons/debian-symbolic.svg similarity index 100% rename from .config/quickshell/assets/icons/debian-symbolic.svg rename to .config/quickshell/ii/assets/icons/debian-symbolic.svg diff --git a/.config/quickshell/assets/icons/deepseek-symbolic.svg b/.config/quickshell/ii/assets/icons/deepseek-symbolic.svg similarity index 100% rename from .config/quickshell/assets/icons/deepseek-symbolic.svg rename to .config/quickshell/ii/assets/icons/deepseek-symbolic.svg diff --git a/.config/quickshell/assets/icons/desktop-symbolic.svg b/.config/quickshell/ii/assets/icons/desktop-symbolic.svg similarity index 100% rename from .config/quickshell/assets/icons/desktop-symbolic.svg rename to .config/quickshell/ii/assets/icons/desktop-symbolic.svg diff --git a/.config/quickshell/assets/icons/endeavouros-symbolic.svg b/.config/quickshell/ii/assets/icons/endeavouros-symbolic.svg similarity index 100% rename from .config/quickshell/assets/icons/endeavouros-symbolic.svg rename to .config/quickshell/ii/assets/icons/endeavouros-symbolic.svg diff --git a/.config/quickshell/assets/icons/fedora-symbolic.svg b/.config/quickshell/ii/assets/icons/fedora-symbolic.svg similarity index 100% rename from .config/quickshell/assets/icons/fedora-symbolic.svg rename to .config/quickshell/ii/assets/icons/fedora-symbolic.svg diff --git a/.config/quickshell/assets/icons/flatpak-symbolic.svg b/.config/quickshell/ii/assets/icons/flatpak-symbolic.svg similarity index 100% rename from .config/quickshell/assets/icons/flatpak-symbolic.svg rename to .config/quickshell/ii/assets/icons/flatpak-symbolic.svg diff --git a/.config/quickshell/assets/icons/github-symbolic.svg b/.config/quickshell/ii/assets/icons/github-symbolic.svg similarity index 100% rename from .config/quickshell/assets/icons/github-symbolic.svg rename to .config/quickshell/ii/assets/icons/github-symbolic.svg diff --git a/.config/quickshell/assets/icons/google-gemini-symbolic.svg b/.config/quickshell/ii/assets/icons/google-gemini-symbolic.svg similarity index 100% rename from .config/quickshell/assets/icons/google-gemini-symbolic.svg rename to .config/quickshell/ii/assets/icons/google-gemini-symbolic.svg diff --git a/.config/quickshell/assets/icons/linux-symbolic.svg b/.config/quickshell/ii/assets/icons/linux-symbolic.svg similarity index 100% rename from .config/quickshell/assets/icons/linux-symbolic.svg rename to .config/quickshell/ii/assets/icons/linux-symbolic.svg diff --git a/.config/quickshell/assets/icons/microsoft-symbolic.svg b/.config/quickshell/ii/assets/icons/microsoft-symbolic.svg similarity index 100% rename from .config/quickshell/assets/icons/microsoft-symbolic.svg rename to .config/quickshell/ii/assets/icons/microsoft-symbolic.svg diff --git a/.config/quickshell/assets/icons/nixos-symbolic.svg b/.config/quickshell/ii/assets/icons/nixos-symbolic.svg similarity index 100% rename from .config/quickshell/assets/icons/nixos-symbolic.svg rename to .config/quickshell/ii/assets/icons/nixos-symbolic.svg diff --git a/.config/quickshell/assets/icons/ollama-symbolic.svg b/.config/quickshell/ii/assets/icons/ollama-symbolic.svg similarity index 100% rename from .config/quickshell/assets/icons/ollama-symbolic.svg rename to .config/quickshell/ii/assets/icons/ollama-symbolic.svg diff --git a/.config/quickshell/assets/icons/openai-symbolic.svg b/.config/quickshell/ii/assets/icons/openai-symbolic.svg similarity index 100% rename from .config/quickshell/assets/icons/openai-symbolic.svg rename to .config/quickshell/ii/assets/icons/openai-symbolic.svg diff --git a/.config/quickshell/assets/icons/openrouter-symbolic.svg b/.config/quickshell/ii/assets/icons/openrouter-symbolic.svg similarity index 100% rename from .config/quickshell/assets/icons/openrouter-symbolic.svg rename to .config/quickshell/ii/assets/icons/openrouter-symbolic.svg diff --git a/.config/quickshell/assets/icons/spark-symbolic.svg b/.config/quickshell/ii/assets/icons/spark-symbolic.svg similarity index 100% rename from .config/quickshell/assets/icons/spark-symbolic.svg rename to .config/quickshell/ii/assets/icons/spark-symbolic.svg diff --git a/.config/quickshell/assets/icons/ubuntu-symbolic.svg b/.config/quickshell/ii/assets/icons/ubuntu-symbolic.svg similarity index 100% rename from .config/quickshell/assets/icons/ubuntu-symbolic.svg rename to .config/quickshell/ii/assets/icons/ubuntu-symbolic.svg diff --git a/.config/quickshell/assets/images/default_wallpaper.png b/.config/quickshell/ii/assets/images/default_wallpaper.png similarity index 100% rename from .config/quickshell/assets/images/default_wallpaper.png rename to .config/quickshell/ii/assets/images/default_wallpaper.png diff --git a/.config/quickshell/defaults/ai/prompts/NoPrompt.md b/.config/quickshell/ii/defaults/ai/prompts/NoPrompt.md similarity index 100% rename from .config/quickshell/defaults/ai/prompts/NoPrompt.md rename to .config/quickshell/ii/defaults/ai/prompts/NoPrompt.md diff --git a/.config/quickshell/defaults/ai/prompts/ii-Default.md b/.config/quickshell/ii/defaults/ai/prompts/ii-Default.md similarity index 100% rename from .config/quickshell/defaults/ai/prompts/ii-Default.md rename to .config/quickshell/ii/defaults/ai/prompts/ii-Default.md diff --git a/.config/quickshell/defaults/ai/prompts/ii-Imouto.md b/.config/quickshell/ii/defaults/ai/prompts/ii-Imouto.md similarity index 100% rename from .config/quickshell/defaults/ai/prompts/ii-Imouto.md rename to .config/quickshell/ii/defaults/ai/prompts/ii-Imouto.md diff --git a/.config/quickshell/defaults/ai/prompts/w-FourPointedSparkle.md b/.config/quickshell/ii/defaults/ai/prompts/w-FourPointedSparkle.md similarity index 100% rename from .config/quickshell/defaults/ai/prompts/w-FourPointedSparkle.md rename to .config/quickshell/ii/defaults/ai/prompts/w-FourPointedSparkle.md diff --git a/.config/quickshell/defaults/ai/prompts/w-OpenMechanicalFlower.md b/.config/quickshell/ii/defaults/ai/prompts/w-OpenMechanicalFlower.md similarity index 100% rename from .config/quickshell/defaults/ai/prompts/w-OpenMechanicalFlower.md rename to .config/quickshell/ii/defaults/ai/prompts/w-OpenMechanicalFlower.md diff --git a/.config/quickshell/modules/backgroundWidgets/BackgroundWidgets.qml b/.config/quickshell/ii/modules/backgroundWidgets/BackgroundWidgets.qml similarity index 97% rename from .config/quickshell/modules/backgroundWidgets/BackgroundWidgets.qml rename to .config/quickshell/ii/modules/backgroundWidgets/BackgroundWidgets.qml index 4197e4959..35f30534e 100644 --- a/.config/quickshell/modules/backgroundWidgets/BackgroundWidgets.qml +++ b/.config/quickshell/ii/modules/backgroundWidgets/BackgroundWidgets.qml @@ -80,9 +80,9 @@ Scope { right: true } color: "transparent" - HyprlandWindow.visibleMask: Region { - item: widgetBackground - } + // HyprlandWindow.visibleMask: Region { // Buggy with scaled monitors + // item: widgetBackground + // } Rectangle { id: widgetBackground diff --git a/.config/quickshell/modules/bar/ActiveWindow.qml b/.config/quickshell/ii/modules/bar/ActiveWindow.qml similarity index 56% rename from .config/quickshell/modules/bar/ActiveWindow.qml rename to .config/quickshell/ii/modules/bar/ActiveWindow.qml index 95e25c6f2..d9f069c61 100644 --- a/.config/quickshell/modules/bar/ActiveWindow.qml +++ b/.config/quickshell/ii/modules/bar/ActiveWindow.qml @@ -1,3 +1,4 @@ +import "root:/services" import "root:/modules/common" import "root:/modules/common/widgets" import QtQuick @@ -11,6 +12,10 @@ Item { readonly property HyprlandMonitor monitor: Hyprland.monitorFor(bar.screen) 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) + implicitWidth: colLayout.implicitWidth ColumnLayout { @@ -26,7 +31,10 @@ Item { font.pixelSize: Appearance.font.pixelSize.smaller color: Appearance.colors.colSubtext elide: Text.ElideRight - text: root.activeWindow?.activated ? root.activeWindow?.appId : qsTr("Desktop") + text: root.focusingThisMonitor && root.activeWindow?.activated && root.biggestWindow ? + root.activeWindow?.appId : + (root.biggestWindow?.class) ?? qsTr("Desktop") + } StyledText { @@ -34,7 +42,9 @@ Item { font.pixelSize: Appearance.font.pixelSize.small color: Appearance.colors.colOnLayer0 elide: Text.ElideRight - text: root.activeWindow?.activated ? root.activeWindow?.title : `${qsTr("Workspace")} ${monitor.activeWorkspace?.id}` + text: root.focusingThisMonitor && root.activeWindow?.activated && root.biggestWindow ? + root.activeWindow?.title : + (root.biggestWindow?.title) ?? `${qsTr("Workspace")} ${monitor.activeWorkspace?.id}` } } diff --git a/.config/quickshell/ii/modules/bar/Bar.qml b/.config/quickshell/ii/modules/bar/Bar.qml new file mode 100644 index 000000000..27d5a6de9 --- /dev/null +++ b/.config/quickshell/ii/modules/bar/Bar.qml @@ -0,0 +1,613 @@ +import "root:/" +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/bar/weather" +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts +import Qt5Compat.GraphicalEffects +import Quickshell +import Quickshell.Io +import Quickshell.Wayland +import Quickshell.Hyprland +import Quickshell.Services.UPower + +Scope { + id: bar + + readonly property int osdHideMouseMoveThreshold: 20 + property bool showBarBackground: Config.options.bar.showBackground + + component VerticalBarSeparator: Rectangle { + Layout.topMargin: Appearance.sizes.baseBarHeight / 3 + Layout.bottomMargin: Appearance.sizes.baseBarHeight / 3 + Layout.fillHeight: true + implicitWidth: 1 + color: Appearance.colors.colOutlineVariant + } + + Variants { + // For each monitor + model: { + const screens = Quickshell.screens; + const list = Config.options.bar.screenList; + if (!list || list.length === 0) + return screens; + return screens.filter(screen => list.includes(screen.name)); + } + Loader { + id: barLoader + active: GlobalStates.barOpen + required property ShellScreen modelData + sourceComponent: PanelWindow { // Bar window + id: barRoot + screen: barLoader.modelData + + property var brightnessMonitor: Brightness.getMonitorForScreen(barLoader.modelData) + property real useShortenedForm: (Appearance.sizes.barHellaShortenScreenWidthThreshold >= screen.width) ? 2 : (Appearance.sizes.barShortenScreenWidthThreshold >= screen.width) ? 1 : 0 + readonly property int centerSideModuleWidth: (useShortenedForm == 2) ? Appearance.sizes.barCenterSideModuleWidthHellaShortened : (useShortenedForm == 1) ? Appearance.sizes.barCenterSideModuleWidthShortened : Appearance.sizes.barCenterSideModuleWidth + + WlrLayershell.namespace: "quickshell:bar" + implicitHeight: Appearance.sizes.barHeight + Appearance.rounding.screenRounding + exclusiveZone: Appearance.sizes.baseBarHeight + (Config.options.bar.cornerStyle === 1 ? Appearance.sizes.hyprlandGapsOut : 0) + mask: Region { + item: barContent + } + color: "transparent" + + anchors { + top: !Config.options.bar.bottom + bottom: Config.options.bar.bottom + left: true + right: true + } + + Item { // Bar content region + id: barContent + anchors { + right: parent.right + left: parent.left + top: parent.top + bottom: undefined + } + implicitHeight: Appearance.sizes.barHeight + height: Appearance.sizes.barHeight + + states: State { + name: "bottom" + when: Config.options.bar.bottom + AnchorChanges { + target: barContent + anchors { + right: parent.right + left: parent.left + top: undefined + bottom: parent.bottom + } + } + } + + // Background shadow + Loader { + active: showBarBackground && Config.options.bar.cornerStyle === 1 + anchors.fill: barBackground + sourceComponent: StyledRectangularShadow { + anchors.fill: undefined // The loader's anchors act on this, and this should not have any anchor + target: barBackground + } + } + // Background + Rectangle { + id: barBackground + anchors { + fill: parent + margins: Config.options.bar.cornerStyle === 1 ? (Appearance.sizes.hyprlandGapsOut) : 0 // idk why but +1 is needed + } + color: showBarBackground ? Appearance.colors.colLayer0 : "transparent" + radius: Config.options.bar.cornerStyle === 1 ? Appearance.rounding.windowRounding : 0 + border.width: Config.options.bar.cornerStyle === 1 ? 1 : 0 + border.color: Appearance.m3colors.m3outlineVariant + } + + MouseArea { // Left side | scroll to change brightness + id: barLeftSideMouseArea + anchors.left: parent.left + implicitHeight: Appearance.sizes.baseBarHeight + height: Appearance.sizes.barHeight + width: (barRoot.width - middleSection.width) / 2 + property bool hovered: false + property real lastScrollX: 0 + property real lastScrollY: 0 + property bool trackingScroll: false + acceptedButtons: Qt.LeftButton + hoverEnabled: true + propagateComposedEvents: true + onEntered: event => { + barLeftSideMouseArea.hovered = true; + } + onExited: event => { + barLeftSideMouseArea.hovered = false; + barLeftSideMouseArea.trackingScroll = false; + } + onPressed: event => { + if (event.button === Qt.LeftButton) { + Hyprland.dispatch('global quickshell:sidebarLeftOpen'); + } + } + // Scroll to change brightness + WheelHandler { + onWheel: event => { + if (event.angleDelta.y < 0) + barRoot.brightnessMonitor.setBrightness(barRoot.brightnessMonitor.brightness - 0.05); + else if (event.angleDelta.y > 0) + barRoot.brightnessMonitor.setBrightness(barRoot.brightnessMonitor.brightness + 0.05); + // Store the mouse position and start tracking + barLeftSideMouseArea.lastScrollX = event.x; + barLeftSideMouseArea.lastScrollY = event.y; + barLeftSideMouseArea.trackingScroll = true; + } + acceptedDevices: PointerDevice.Mouse | PointerDevice.TouchPad + } + onPositionChanged: mouse => { + if (barLeftSideMouseArea.trackingScroll) { + const dx = mouse.x - barLeftSideMouseArea.lastScrollX; + const dy = mouse.y - barLeftSideMouseArea.lastScrollY; + if (Math.sqrt(dx * dx + dy * dy) > osdHideMouseMoveThreshold) { + Hyprland.dispatch('global quickshell:osdBrightnessHide'); + barLeftSideMouseArea.trackingScroll = false; + } + } + } + Item { + // Left section + anchors.fill: parent + implicitHeight: leftSectionRowLayout.implicitHeight + implicitWidth: leftSectionRowLayout.implicitWidth + + ScrollHint { + reveal: barLeftSideMouseArea.hovered + icon: "light_mode" + tooltipText: qsTr("Scroll to change brightness") + side: "left" + anchors.left: parent.left + anchors.verticalCenter: parent.verticalCenter + } + + RowLayout { // Content + id: leftSectionRowLayout + anchors.fill: parent + spacing: 10 + + RippleButton { + // Left sidebar button + Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter + Layout.leftMargin: Appearance.rounding.screenRounding + Layout.fillWidth: false + property real buttonPadding: 5 + implicitWidth: distroIcon.width + buttonPadding * 2 + implicitHeight: distroIcon.height + buttonPadding * 2 + + buttonRadius: Appearance.rounding.full + colBackground: barLeftSideMouseArea.hovered ? Appearance.colors.colLayer1Hover : ColorUtils.transparentize(Appearance.colors.colLayer1Hover, 1) + colBackgroundHover: Appearance.colors.colLayer1Hover + colRipple: Appearance.colors.colLayer1Active + colBackgroundToggled: Appearance.colors.colSecondaryContainer + colBackgroundToggledHover: Appearance.colors.colSecondaryContainerHover + colRippleToggled: Appearance.colors.colSecondaryContainerActive + toggled: GlobalStates.sidebarLeftOpen + property color colText: toggled ? Appearance.m3colors.m3onSecondaryContainer : Appearance.colors.colOnLayer0 + + onPressed: { + Hyprland.dispatch('global quickshell:sidebarLeftToggle'); + } + + CustomIcon { + id: distroIcon + anchors.centerIn: parent + width: 19.5 + height: 19.5 + source: Config.options.bar.topLeftIcon == 'distro' ? SystemInfo.distroIcon : "spark-symbolic" + colorize: true + color: Appearance.colors.colOnLayer0 + } + } + + ActiveWindow { + visible: barRoot.useShortenedForm === 0 + Layout.rightMargin: Appearance.rounding.screenRounding + Layout.fillWidth: true + Layout.fillHeight: true + bar: barRoot + } + } + } + } + + RowLayout { // Middle section + id: middleSection + anchors.centerIn: parent + spacing: Config.options?.bar.borderless ? 4 : 8 + + BarGroup { + id: leftCenterGroup + Layout.preferredWidth: barRoot.centerSideModuleWidth + Layout.fillHeight: true + + Resources { + alwaysShowAllResources: barRoot.useShortenedForm === 2 + Layout.fillWidth: barRoot.useShortenedForm === 2 + } + + Media { + visible: barRoot.useShortenedForm < 2 + Layout.fillWidth: true + } + } + + VerticalBarSeparator { + visible: Config.options?.bar.borderless + } + + BarGroup { + id: middleCenterGroup + padding: workspacesWidget.widgetPadding + Layout.fillHeight: true + + Workspaces { + id: workspacesWidget + bar: barRoot + Layout.fillHeight: true + MouseArea { + // Right-click to toggle overview + anchors.fill: parent + acceptedButtons: Qt.RightButton + + onPressed: event => { + if (event.button === Qt.RightButton) { + Hyprland.dispatch('global quickshell:overviewToggle'); + } + } + } + } + } + + VerticalBarSeparator { + visible: Config.options?.bar.borderless + } + + MouseArea { + id: rightCenterGroup + implicitWidth: rightCenterGroupContent.implicitWidth + implicitHeight: rightCenterGroupContent.implicitHeight + Layout.preferredWidth: barRoot.centerSideModuleWidth + Layout.fillHeight: true + + onPressed: { + Hyprland.dispatch('global quickshell:sidebarRightToggle'); + } + + BarGroup { + id: rightCenterGroupContent + anchors.fill: parent + + ClockWidget { + showDate: (Config.options.bar.verbose && barRoot.useShortenedForm < 2) + Layout.alignment: Qt.AlignVCenter + Layout.fillWidth: true + } + + UtilButtons { + visible: (Config.options.bar.verbose && barRoot.useShortenedForm === 0) + Layout.alignment: Qt.AlignVCenter + } + + BatteryIndicator { + visible: (barRoot.useShortenedForm < 2 && UPower.displayDevice.isLaptopBattery) + Layout.alignment: Qt.AlignVCenter + } + } + } + + VerticalBarSeparator { + visible: Config.options.bar.borderless && Config.options.bar.weather.enable + } + } + + MouseArea { // Right side | scroll to change volume + id: barRightSideMouseArea + + anchors.right: parent.right + implicitHeight: Appearance.sizes.baseBarHeight + height: Appearance.sizes.barHeight + width: (barRoot.width - middleSection.width) / 2 + + property bool hovered: false + property real lastScrollX: 0 + property real lastScrollY: 0 + property bool trackingScroll: false + + acceptedButtons: Qt.LeftButton + hoverEnabled: true + propagateComposedEvents: true + onEntered: event => { + barRightSideMouseArea.hovered = true; + } + onExited: event => { + barRightSideMouseArea.hovered = false; + barRightSideMouseArea.trackingScroll = false; + } + onPressed: event => { + if (event.button === Qt.LeftButton) { + Hyprland.dispatch('global quickshell:sidebarRightOpen'); + } else if (event.button === Qt.RightButton) { + MprisController.activePlayer.next(); + } + } + // Scroll to change volume + WheelHandler { + onWheel: event => { + const currentVolume = Audio.value; + const step = currentVolume < 0.1 ? 0.01 : 0.02 || 0.2; + if (event.angleDelta.y < 0) + Audio.sink.audio.volume -= step; + else if (event.angleDelta.y > 0) + Audio.sink.audio.volume = Math.min(1, Audio.sink.audio.volume + step); + // Store the mouse position and start tracking + barRightSideMouseArea.lastScrollX = event.x; + barRightSideMouseArea.lastScrollY = event.y; + barRightSideMouseArea.trackingScroll = true; + } + acceptedDevices: PointerDevice.Mouse | PointerDevice.TouchPad + } + onPositionChanged: mouse => { + if (barRightSideMouseArea.trackingScroll) { + const dx = mouse.x - barRightSideMouseArea.lastScrollX; + const dy = mouse.y - barRightSideMouseArea.lastScrollY; + if (Math.sqrt(dx * dx + dy * dy) > osdHideMouseMoveThreshold) { + Hyprland.dispatch('global quickshell:osdVolumeHide'); + barRightSideMouseArea.trackingScroll = false; + } + } + } + + Item { + anchors.fill: parent + implicitHeight: rightSectionRowLayout.implicitHeight + implicitWidth: rightSectionRowLayout.implicitWidth + + ScrollHint { + reveal: barRightSideMouseArea.hovered + icon: "volume_up" + tooltipText: qsTr("Scroll to change volume") + side: "right" + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + } + + RowLayout { + id: rightSectionRowLayout + anchors.fill: parent + spacing: 5 + layoutDirection: Qt.RightToLeft + + RippleButton { // Right sidebar button + id: rightSidebarButton + + Layout.alignment: Qt.AlignRight | Qt.AlignVCenter + Layout.rightMargin: Appearance.rounding.screenRounding + Layout.fillWidth: false + + implicitWidth: indicatorsRowLayout.implicitWidth + 10 * 2 + implicitHeight: indicatorsRowLayout.implicitHeight + 5 * 2 + + buttonRadius: Appearance.rounding.full + colBackground: barRightSideMouseArea.hovered ? Appearance.colors.colLayer1Hover : ColorUtils.transparentize(Appearance.colors.colLayer1Hover, 1) + colBackgroundHover: Appearance.colors.colLayer1Hover + colRipple: Appearance.colors.colLayer1Active + colBackgroundToggled: Appearance.colors.colSecondaryContainer + colBackgroundToggledHover: Appearance.colors.colSecondaryContainerHover + colRippleToggled: Appearance.colors.colSecondaryContainerActive + toggled: GlobalStates.sidebarRightOpen + property color colText: toggled ? Appearance.m3colors.m3onSecondaryContainer : Appearance.colors.colOnLayer0 + + Behavior on colText { + animation: Appearance.animation.elementMoveFast.colorAnimation.createObject(this) + } + + onPressed: { + Hyprland.dispatch('global quickshell:sidebarRightToggle'); + } + + RowLayout { + id: indicatorsRowLayout + anchors.centerIn: parent + property real realSpacing: 15 + spacing: 0 + + Revealer { + reveal: Audio.sink?.audio?.muted ?? false + Layout.fillHeight: true + Layout.rightMargin: reveal ? indicatorsRowLayout.realSpacing : 0 + Behavior on Layout.rightMargin { + NumberAnimation { + duration: Appearance.animation.elementMoveFast.duration + easing.type: Appearance.animation.elementMoveFast.type + easing.bezierCurve: Appearance.animation.elementMoveFast.bezierCurve + } + } + MaterialSymbol { + text: "volume_off" + iconSize: Appearance.font.pixelSize.larger + color: rightSidebarButton.colText + } + } + Revealer { + reveal: Audio.source?.audio?.muted ?? false + Layout.fillHeight: true + Layout.rightMargin: reveal ? indicatorsRowLayout.realSpacing : 0 + Behavior on Layout.rightMargin { + NumberAnimation { + duration: Appearance.animation.elementMoveFast.duration + easing.type: Appearance.animation.elementMoveFast.type + easing.bezierCurve: Appearance.animation.elementMoveFast.bezierCurve + } + } + MaterialSymbol { + text: "mic_off" + iconSize: Appearance.font.pixelSize.larger + color: rightSidebarButton.colText + } + } + MaterialSymbol { + Layout.rightMargin: indicatorsRowLayout.realSpacing + text: Network.materialSymbol + iconSize: Appearance.font.pixelSize.larger + color: rightSidebarButton.colText + } + MaterialSymbol { + text: Bluetooth.bluetoothConnected ? "bluetooth_connected" : Bluetooth.bluetoothEnabled ? "bluetooth" : "bluetooth_disabled" + iconSize: Appearance.font.pixelSize.larger + color: rightSidebarButton.colText + } + } + } + + SysTray { + bar: barRoot + visible: barRoot.useShortenedForm === 0 + Layout.fillWidth: false + Layout.fillHeight: true + } + + Item { + Layout.fillWidth: true + Layout.fillHeight: true + } + + // Weather + Loader { + Layout.leftMargin: 8 + Layout.fillHeight: true + active: Config.options.bar.weather.enable + sourceComponent: BarGroup { + implicitHeight: Appearance.sizes.baseBarHeight + WeatherBar {} + } + } + } + } + } + } + + // Round decorators + Loader { + id: roundDecorators + anchors { + left: parent.left + right: parent.right + } + y: Appearance.sizes.barHeight + width: parent.width + height: Appearance.rounding.screenRounding + active: showBarBackground && Config.options.bar.cornerStyle === 0 // Hug + + states: State { + name: "bottom" + when: Config.options.bar.bottom + PropertyChanges { + roundDecorators.y: 0 + } + } + + sourceComponent: Item { + implicitHeight: Appearance.rounding.screenRounding + RoundCorner { + id: leftCorner + anchors { + top: parent.top + bottom: parent.bottom + left: parent.left + } + + size: Appearance.rounding.screenRounding + color: showBarBackground ? Appearance.colors.colLayer0 : "transparent" + + corner: RoundCorner.CornerEnum.TopLeft + states: State { + name: "bottom" + when: Config.options.bar.bottom + PropertyChanges { + leftCorner.corner: RoundCorner.CornerEnum.BottomLeft + } + } + } + RoundCorner { + id: rightCorner + anchors { + right: parent.right + top: !Config.options.bar.bottom ? parent.top : undefined + bottom: Config.options.bar.bottom ? parent.bottom : undefined + } + size: Appearance.rounding.screenRounding + color: showBarBackground ? Appearance.colors.colLayer0 : "transparent" + + corner: RoundCorner.CornerEnum.TopRight + states: State { + name: "bottom" + when: Config.options.bar.bottom + PropertyChanges { + rightCorner.corner: RoundCorner.CornerEnum.BottomRight + } + } + } + } + } + } + } + } + + IpcHandler { + target: "bar" + + function toggle(): void { + GlobalStates.barOpen = !GlobalStates.barOpen + } + + function close(): void { + GlobalStates.barOpen = false + } + + function open(): void { + GlobalStates.barOpen = true + } + } + + GlobalShortcut { + name: "barToggle" + description: qsTr("Toggles bar on press") + + onPressed: { + GlobalStates.barOpen = !GlobalStates.barOpen; + } + } + + GlobalShortcut { + name: "barOpen" + description: qsTr("Opens bar on press") + + onPressed: { + GlobalStates.barOpen = true; + } + } + + GlobalShortcut { + name: "barClose" + description: qsTr("Closes bar on press") + + onPressed: { + GlobalStates.barOpen = false; + } + } +} diff --git a/.config/quickshell/modules/bar/BarGroup.qml b/.config/quickshell/ii/modules/bar/BarGroup.qml similarity index 100% rename from .config/quickshell/modules/bar/BarGroup.qml rename to .config/quickshell/ii/modules/bar/BarGroup.qml diff --git a/.config/quickshell/modules/bar/BatteryIndicator.qml b/.config/quickshell/ii/modules/bar/BatteryIndicator.qml similarity index 100% rename from .config/quickshell/modules/bar/BatteryIndicator.qml rename to .config/quickshell/ii/modules/bar/BatteryIndicator.qml diff --git a/.config/quickshell/modules/bar/CircleUtilButton.qml b/.config/quickshell/ii/modules/bar/CircleUtilButton.qml similarity index 100% rename from .config/quickshell/modules/bar/CircleUtilButton.qml rename to .config/quickshell/ii/modules/bar/CircleUtilButton.qml diff --git a/.config/quickshell/modules/bar/ClockWidget.qml b/.config/quickshell/ii/modules/bar/ClockWidget.qml similarity index 100% rename from .config/quickshell/modules/bar/ClockWidget.qml rename to .config/quickshell/ii/modules/bar/ClockWidget.qml diff --git a/.config/quickshell/modules/bar/Media.qml b/.config/quickshell/ii/modules/bar/Media.qml similarity index 98% rename from .config/quickshell/modules/bar/Media.qml rename to .config/quickshell/ii/modules/bar/Media.qml index 9e7ff96cd..dfad0e207 100644 --- a/.config/quickshell/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 diff --git a/.config/quickshell/modules/bar/Resource.qml b/.config/quickshell/ii/modules/bar/Resource.qml similarity index 100% rename from .config/quickshell/modules/bar/Resource.qml rename to .config/quickshell/ii/modules/bar/Resource.qml diff --git a/.config/quickshell/modules/bar/Resources.qml b/.config/quickshell/ii/modules/bar/Resources.qml similarity index 100% rename from .config/quickshell/modules/bar/Resources.qml rename to .config/quickshell/ii/modules/bar/Resources.qml diff --git a/.config/quickshell/modules/bar/ScrollHint.qml b/.config/quickshell/ii/modules/bar/ScrollHint.qml similarity index 100% rename from .config/quickshell/modules/bar/ScrollHint.qml rename to .config/quickshell/ii/modules/bar/ScrollHint.qml diff --git a/.config/quickshell/modules/bar/SysTray.qml b/.config/quickshell/ii/modules/bar/SysTray.qml similarity index 100% rename from .config/quickshell/modules/bar/SysTray.qml rename to .config/quickshell/ii/modules/bar/SysTray.qml diff --git a/.config/quickshell/modules/bar/SysTrayItem.qml b/.config/quickshell/ii/modules/bar/SysTrayItem.qml similarity index 100% rename from .config/quickshell/modules/bar/SysTrayItem.qml rename to .config/quickshell/ii/modules/bar/SysTrayItem.qml diff --git a/.config/quickshell/modules/bar/UtilButtons.qml b/.config/quickshell/ii/modules/bar/UtilButtons.qml similarity index 100% rename from .config/quickshell/modules/bar/UtilButtons.qml rename to .config/quickshell/ii/modules/bar/UtilButtons.qml diff --git a/.config/quickshell/modules/bar/Workspaces.qml b/.config/quickshell/ii/modules/bar/Workspaces.qml similarity index 95% rename from .config/quickshell/modules/bar/Workspaces.qml rename to .config/quickshell/ii/modules/bar/Workspaces.qml index f91cdaa93..f4d7c73d0 100644 --- a/.config/quickshell/modules/bar/Workspaces.qml +++ b/.config/quickshell/ii/modules/bar/Workspaces.qml @@ -173,14 +173,7 @@ Item { id: workspaceButtonBackground implicitWidth: workspaceButtonWidth implicitHeight: workspaceButtonWidth - property var biggestWindow: { - const windowsInThisWorkspace = HyprlandData.windowList.filter(w => w.workspace.id == button.workspaceValue) - return windowsInThisWorkspace.reduce((maxWin, win) => { - const maxArea = (maxWin?.size?.[0] ?? 0) * (maxWin?.size?.[1] ?? 0) - const winArea = (win?.size?.[0] ?? 0) * (win?.size?.[1] ?? 0) - return winArea > maxArea ? win : maxWin - }, null) - } + property var biggestWindow: HyprlandData.biggestWindowForWorkspace(button.workspaceValue) property var mainAppIconSource: Quickshell.iconPath(AppSearch.guessIcon(biggestWindow?.class), "image-missing") StyledText { // Workspace number text diff --git a/.config/quickshell/modules/bar/weather/WeatherBar.qml b/.config/quickshell/ii/modules/bar/weather/WeatherBar.qml similarity index 88% rename from .config/quickshell/modules/bar/weather/WeatherBar.qml rename to .config/quickshell/ii/modules/bar/weather/WeatherBar.qml index 5d54562d7..a77a2a43f 100644 --- a/.config/quickshell/modules/bar/weather/WeatherBar.qml +++ b/.config/quickshell/ii/modules/bar/weather/WeatherBar.qml @@ -1,7 +1,6 @@ pragma ComponentBehavior: Bound import "root:/modules/common" import "root:/modules/common/widgets" -import "root:/constants" import "root:/services" import Quickshell import QtQuick @@ -47,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 diff --git a/.config/quickshell/modules/bar/weather/WeatherCard.qml b/.config/quickshell/ii/modules/bar/weather/WeatherCard.qml similarity index 100% rename from .config/quickshell/modules/bar/weather/WeatherCard.qml rename to .config/quickshell/ii/modules/bar/weather/WeatherCard.qml diff --git a/.config/quickshell/constants/WeatherIcons.qml b/.config/quickshell/ii/modules/bar/weather/WeatherIcons.qml similarity index 100% rename from .config/quickshell/constants/WeatherIcons.qml rename to .config/quickshell/ii/modules/bar/weather/WeatherIcons.qml diff --git a/.config/quickshell/modules/bar/weather/WeatherPopup.qml b/.config/quickshell/ii/modules/bar/weather/WeatherPopup.qml similarity index 100% rename from .config/quickshell/modules/bar/weather/WeatherPopup.qml rename to .config/quickshell/ii/modules/bar/weather/WeatherPopup.qml diff --git a/.config/quickshell/modules/cheatsheet/Cheatsheet.qml b/.config/quickshell/ii/modules/cheatsheet/Cheatsheet.qml similarity index 55% rename from .config/quickshell/modules/cheatsheet/Cheatsheet.qml rename to .config/quickshell/ii/modules/cheatsheet/Cheatsheet.qml index 0edc121ee..8e409ab94 100644 --- a/.config/quickshell/modules/cheatsheet/Cheatsheet.qml +++ b/.config/quickshell/ii/modules/cheatsheet/Cheatsheet.qml @@ -7,6 +7,7 @@ import QtQuick import QtQuick.Controls import QtQuick.Effects import QtQuick.Layouts +import Qt5Compat.GraphicalEffects import Quickshell.Io import Quickshell import Quickshell.Widgets @@ -15,11 +16,22 @@ import Quickshell.Hyprland Scope { // Scope id: root + property var tabButtonList: [ + { + "icon": "keyboard", + "name": qsTr("Keybinds") + }, + { + "icon": "experiment", + "name": qsTr("Elements") + }, + ] + property int selectedTab: 0 Loader { id: cheatsheetLoader active: false - + sourceComponent: PanelWindow { // Window id: cheatsheetRoot visible: cheatsheetLoader.active @@ -32,7 +44,7 @@ Scope { // Scope } function hide() { - cheatsheetLoader.active = false + cheatsheetLoader.active = false; } exclusiveZone: 0 implicitWidth: cheatsheetBackground.width + Appearance.sizes.elevationMargin * 2 @@ -48,14 +60,14 @@ Scope { // Scope HyprlandFocusGrab { // Click outside to close id: grab - windows: [ cheatsheetRoot ] + windows: [cheatsheetRoot] active: cheatsheetRoot.visible onCleared: () => { - if (!active) cheatsheetRoot.hide() + if (!active) + cheatsheetRoot.hide(); } } - // Background StyledRectangularShadow { target: cheatsheetBackground @@ -71,9 +83,24 @@ Scope { // Scope implicitWidth: cheatsheetColumnLayout.implicitWidth + padding * 2 implicitHeight: cheatsheetColumnLayout.implicitHeight + padding * 2 - Keys.onPressed: (event) => { // Esc to close + Keys.onPressed: event => { // Esc to close if (event.key === Qt.Key_Escape) { - cheatsheetRoot.hide() + cheatsheetRoot.hide(); + } + if (event.modifiers === Qt.ControlModifier) { + if (event.key === Qt.Key_PageDown) { + root.selectedTab = Math.min(root.selectedTab + 1, root.tabButtonList.length - 1); + event.accepted = true; + } else if (event.key === Qt.Key_PageUp) { + root.selectedTab = Math.max(root.selectedTab - 1, 0); + event.accepted = true; + } else if (event.key === Qt.Key_Tab) { + root.selectedTab = (root.selectedTab + 1) % root.tabButtonList.length; + event.accepted = true; + } else if (event.key === Qt.Key_Backtab) { + root.selectedTab = (root.selectedTab - 1 + root.tabButtonList.length) % root.tabButtonList.length; + event.accepted = true; + } } } @@ -91,7 +118,7 @@ Scope { // Scope } onClicked: { - cheatsheetRoot.hide() + cheatsheetRoot.hide(); } contentItem: MaterialSymbol { @@ -114,10 +141,50 @@ Scope { // Scope font.pixelSize: Appearance.font.pixelSize.title text: qsTr("Cheat sheet") } - CheatsheetKeybinds {} + PrimaryTabBar { // Tab strip + id: tabBar + tabButtonList: root.tabButtonList + externalTrackedTab: root.selectedTab + function onCurrentIndexChanged(currentIndex) { + root.selectedTab = currentIndex; + } + } + + SwipeView { // Content pages + id: swipeView + Layout.topMargin: 5 + Layout.fillWidth: true + Layout.fillHeight: true + spacing: 10 + + Behavior on implicitWidth { + animation: Appearance.animation.elementMoveFast.numberAnimation.createObject(this) + } + Behavior on implicitHeight { + animation: Appearance.animation.elementMoveFast.numberAnimation.createObject(this) + } + + currentIndex: tabBar.externalTrackedTab + onCurrentIndexChanged: { + tabBar.enableIndicatorAnimation = true; + root.selectedTab = currentIndex; + } + + clip: true + layer.enabled: true + layer.effect: OpacityMask { + maskSource: Rectangle { + width: swipeView.width + height: swipeView.height + radius: Appearance.rounding.small + } + } + + CheatsheetKeybinds {} + CheatsheetPeriodicTable {} + } } } - } } @@ -125,15 +192,15 @@ Scope { // Scope target: "cheatsheet" function toggle(): void { - cheatsheetLoader.active = !cheatsheetLoader.active + cheatsheetLoader.active = !cheatsheetLoader.active; } function close(): void { - cheatsheetLoader.active = false + cheatsheetLoader.active = false; } function open(): void { - cheatsheetLoader.active = true + cheatsheetLoader.active = true; } } @@ -163,5 +230,4 @@ Scope { // Scope cheatsheetLoader.active = false; } } - } diff --git a/.config/quickshell/modules/cheatsheet/CheatsheetKeybinds.qml b/.config/quickshell/ii/modules/cheatsheet/CheatsheetKeybinds.qml similarity index 100% rename from .config/quickshell/modules/cheatsheet/CheatsheetKeybinds.qml rename to .config/quickshell/ii/modules/cheatsheet/CheatsheetKeybinds.qml diff --git a/.config/quickshell/ii/modules/cheatsheet/CheatsheetPeriodicTable.qml b/.config/quickshell/ii/modules/cheatsheet/CheatsheetPeriodicTable.qml new file mode 100644 index 000000000..774c522e3 --- /dev/null +++ b/.config/quickshell/ii/modules/cheatsheet/CheatsheetPeriodicTable.qml @@ -0,0 +1,73 @@ +import "root:/" +import "root:/services" +import "root:/modules/common" +import "root:/modules/common/widgets" +import "root:/modules/common/functions/file_utils.js" as FileUtils +import "periodic_table.js" as PTable +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts +import Quickshell +import Quickshell.Io +import Quickshell.Widgets +import Quickshell.Hyprland + +Item { + id: root + readonly property var elements: PTable.elements + readonly property var series: PTable.series + property real spacing: 6 + implicitWidth: mainLayout.implicitWidth + implicitHeight: mainLayout.implicitHeight + + ColumnLayout { + id: mainLayout + spacing: root.spacing + + Repeater { // Main table rows + model: root.elements + + delegate: RowLayout { // Table cells + id: tableRow + spacing: root.spacing + required property var modelData + + Repeater { + model: tableRow.modelData + delegate: ElementTile { + required property var modelData + element: modelData + } + + } + } + + } + + Item { + id: gap + implicitHeight: 20 + } + + Repeater { // Main table rows + model: root.series + + delegate: RowLayout { // Table cells + id: seriesTableRow + spacing: root.spacing + required property var modelData + + Repeater { + model: seriesTableRow.modelData + delegate: ElementTile { + required property var modelData + element: modelData + } + + } + } + + } + } + +} \ No newline at end of file diff --git a/.config/quickshell/ii/modules/cheatsheet/ElementTile.qml b/.config/quickshell/ii/modules/cheatsheet/ElementTile.qml new file mode 100644 index 000000000..baeb72ad6 --- /dev/null +++ b/.config/quickshell/ii/modules/cheatsheet/ElementTile.qml @@ -0,0 +1,59 @@ +import "root:/modules/common" +import "root:/modules/common/widgets" +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts +import Quickshell +import Quickshell.Io + +RippleButton { + id: root + required property var element + opacity: element.type != "empty" ? 1 : 0 + implicitHeight: 60 + implicitWidth: 60 + colBackground: Appearance.colors.colLayer2 + buttonRadius: Appearance.rounding.small + + Rectangle { + anchors { + top: parent.top + left: parent.left + topMargin: 4 + leftMargin: 4 + } + color: Appearance.colors.colLayer2 + radius: Appearance.rounding.full + implicitWidth: Math.max(20, elementNumber.implicitWidth) + implicitHeight: Math.max(20, elementNumber.implicitHeight) + width: height + + StyledText { + id: elementNumber + anchors.centerIn: parent + color: Appearance.colors.colOnLayer2 + text: root.element.number + font.pixelSize: Appearance.font.pixelSize.smallest + } + } + + StyledText { + id: elementSymbol + anchors.centerIn: parent + color: Appearance.colors.colSecondary + font.pixelSize: Appearance.font.pixelSize.huge + text: root.element.symbol + } + + StyledText { + id: elementName + anchors { + horizontalCenter: parent.horizontalCenter + bottom: parent.bottom + bottomMargin: 4 + } + font.pixelSize: Appearance.font.pixelSize.smallest + color: Appearance.colors.colOnLayer2 + text: root.element.name + } +} diff --git a/.config/quickshell/ii/modules/cheatsheet/periodic_table.js b/.config/quickshell/ii/modules/cheatsheet/periodic_table.js new file mode 100644 index 000000000..45d69cc99 --- /dev/null +++ b/.config/quickshell/ii/modules/cheatsheet/periodic_table.js @@ -0,0 +1,196 @@ +// List of rows +const elements = [ + [ + { name: 'Hydrogen', symbol: 'H', number: 1, weight: 1.01, type: 'nonmetal' }, + { name: '', symbol: '', number: -1, weight: 0, type: 'empty' }, + { name: '', symbol: '', number: -1, weight: 0, type: 'empty' }, + { name: '', symbol: '', number: -1, weight: 0, type: 'empty' }, + { name: '', symbol: '', number: -1, weight: 0, type: 'empty' }, + { name: '', symbol: '', number: -1, weight: 0, type: 'empty' }, + { name: '', symbol: '', number: -1, weight: 0, type: 'empty' }, + { name: '', symbol: '', number: -1, weight: 0, type: 'empty' }, + { name: '', symbol: '', number: -1, weight: 0, type: 'empty' }, + { name: '', symbol: '', number: -1, weight: 0, type: 'empty' }, + { name: '', symbol: '', number: -1, weight: 0, type: 'empty' }, + { name: '', symbol: '', number: -1, weight: 0, type: 'empty' }, + { name: '', symbol: '', number: -1, weight: 0, type: 'empty' }, + { name: '', symbol: '', number: -1, weight: 0, type: 'empty' }, + { name: '', symbol: '', number: -1, weight: 0, type: 'empty' }, + { name: '', symbol: '', number: -1, weight: 0, type: 'empty' }, + { name: '', symbol: '', number: -1, weight: 0, type: 'empty' }, + { name: 'Helium', symbol: 'He', number: 2, weight: 4.00, type: 'noblegas' }, + ], + [ + { name: 'Lithium', symbol: 'Li', number: 3, weight: 6.94, type: 'metal' }, + { name: 'Beryllium', symbol: 'Be', number: 4, weight: 9.01, type: 'metal' }, + { name: '', symbol: '', number: -1, weight: 0, type: 'empty' }, + { name: '', symbol: '', number: -1, weight: 0, type: 'empty' }, + { name: '', symbol: '', number: -1, weight: 0, type: 'empty' }, + { name: '', symbol: '', number: -1, weight: 0, type: 'empty' }, + { name: '', symbol: '', number: -1, weight: 0, type: 'empty' }, + { name: '', symbol: '', number: -1, weight: 0, type: 'empty' }, + { name: '', symbol: '', number: -1, weight: 0, type: 'empty' }, + { name: '', symbol: '', number: -1, weight: 0, type: 'empty' }, + { name: '', symbol: '', number: -1, weight: 0, type: 'empty' }, + { name: '', symbol: '', number: -1, weight: 0, type: 'empty' }, + { name: 'Boron', symbol: 'B', number: 5, weight: 10.81, type: 'nonmetal' }, + { name: 'Carbon', symbol: 'C', number: 6, weight: 12.01, type: 'nonmetal' }, + { name: 'Nitrogen', symbol: 'N', number: 7, weight: 14.01, type: 'nonmetal' }, + { name: 'Oxygen', symbol: 'O', number: 8, weight: 16, type: 'nonmetal' }, + { name: 'Fluorine', symbol: 'F', number: 9, weight: 19, type: 'nonmetal' }, + { name: 'Neon', symbol: 'Ne', number: 10, weight: 20.18, type: 'noblegas' }, + + + ], + [ + { name: 'Sodium', symbol: 'Na', number: 11, weight: 22.99, type: 'metal' }, + { name: 'Magnesium', symbol: 'Mg', number: 12, weight: 24.31, type: 'metal' }, + { name: '', symbol: '', number: -1, weight: 0, type: 'empty' }, + { name: '', symbol: '', number: -1, weight: 0, type: 'empty' }, + { name: '', symbol: '', number: -1, weight: 0, type: 'empty' }, + { name: '', symbol: '', number: -1, weight: 0, type: 'empty' }, + { name: '', symbol: '', number: -1, weight: 0, type: 'empty' }, + { name: '', symbol: '', number: -1, weight: 0, type: 'empty' }, + { name: '', symbol: '', number: -1, weight: 0, type: 'empty' }, + { name: '', symbol: '', number: -1, weight: 0, type: 'empty' }, + { name: '', symbol: '', number: -1, weight: 0, type: 'empty' }, + { name: '', symbol: '', number: -1, weight: 0, type: 'empty' }, + { name: 'Aluminum', symbol: 'Al', number: 13, weight: 26.98, type: 'metal' }, + { name: 'Silicon', symbol: 'Si', number: 14, weight: 28.09, type: 'nonmetal' }, + { name: 'Phosphorus', symbol: 'P', number: 15, weight: 30.97, type: 'nonmetal' }, + { name: 'Sulfur', symbol: 'S', number: 16, weight: 32.07, type: 'nonmetal' }, + { name: 'Chlorine', symbol: 'Cl', number: 17, weight: 35.45, type: 'nonmetal' }, + { name: 'Argon', symbol: 'Ar', number: 18, weight: 39.95, type: 'noblegas' }, + ], + [ + { name: 'Potassium', symbol: 'K', number: 19, weight: 39.098, type: 'metal' }, + { name: 'Calcium', symbol: 'Ca', number: 20, weight: 40.078, type: 'metal' }, + { name: 'Scandium', symbol: 'Sc', number: 21, weight: 44.956, type: 'metal' }, + { name: 'Titanium', symbol: 'Ti', number: 22, weight: 47.87, type: 'metal' }, + { name: 'Vanadium', symbol: 'V', number: 23, weight: 50.94, type: 'metal' }, + { name: 'Chromium', symbol: 'Cr', number: 24, weight: 52, type: 'metal'/*, icon: 'chromium-browser'*/ }, + { name: 'Manganese', symbol: 'Mn', number: 25, weight: 54.94, type: 'metal' }, + { name: 'Iron', symbol: 'Fe', number: 26, weight: 55.85, type: 'metal' }, + { name: 'Cobalt', symbol: 'Co', number: 27, weight: 58.93, type: 'metal' }, + { name: 'Nickel', symbol: 'Ni', number: 28, weight: 58.69, type: 'metal' }, + { name: 'Copper', symbol: 'Cu', number: 29, weight: 63.55, type: 'metal' }, + { name: 'Zinc', symbol: 'Zn', number: 30, weight: 65.38, type: 'metal' }, + { name: 'Gallium', symbol: 'Ga', number: 31, weight: 69.72, type: 'metal' }, + { name: 'Germanium', symbol: 'Ge', number: 32, weight: 72.63, type: 'metal' }, + { name: 'Arsenic', symbol: 'As', number: 33, weight: 74.92, type: 'nonmetal' }, + { name: 'Selenium', symbol: 'Se', number: 34, weight: 78.96, type: 'nonmetal' }, + { name: 'Bromine', symbol: 'Br', number: 35, weight: 79.904, type: 'nonmetal' }, + { name: 'Krypton', symbol: 'Kr', number: 36, weight: 83.8, type: 'noblegas' }, + ], + [ + { name: 'Rubidium', symbol: 'Rb', number: 37, weight: 85.47, type: 'metal' }, + { name: 'Strontium', symbol: 'Sr', number: 38, weight: 87.62, type: 'metal' }, + { name: 'Yttrium', symbol: 'Y', number: 39, weight: 88.91, type: 'metal' }, + { name: 'Zirconium', symbol: 'Zr', number: 40, weight: 91.22, type: 'metal' }, + { name: 'Niobium', symbol: 'Nb', number: 41, weight: 92.91, type: 'metal' }, + { name: 'Molybdenum', symbol: 'Mo', number: 42, weight: 95.94, type: 'metal' }, + { name: 'Technetium', symbol: 'Tc', number: 43, weight: 98, type: 'metal' }, + { name: 'Ruthenium', symbol: 'Ru', number: 44, weight: 101.07, type: 'metal' }, + { name: 'Rhodium', symbol: 'Rh', number: 45, weight: 102.91, type: 'metal' }, + { name: 'Palladium', symbol: 'Pd', number: 46, weight: 106.42, type: 'metal' }, + { name: 'Silver', symbol: 'Ag', number: 47, weight: 107.87, type: 'metal' }, + { name: 'Cadmium', symbol: 'Cd', number: 48, weight: 112.41, type: 'metal' }, + { name: 'Indium', symbol: 'In', number: 49, weight: 114.82, type: 'metal' }, + { name: 'Tin', symbol: 'Sn', number: 50, weight: 118.71, type: 'metal' }, + { name: 'Antimony', symbol: 'Sb', number: 51, weight: 121.76, type: 'metal' }, + { name: 'Tellurium', symbol: 'Te', number: 52, weight: 127.6, type: 'nonmetal' }, + { name: 'Iodine', symbol: 'I', number: 53, weight: 126.9, type: 'nonmetal' }, + { name: 'Xenon', symbol: 'Xe', number: 54, weight: 131.29, type: 'noblegas' }, + ], + [ + { name: 'Cesium', symbol: 'Cs', number: 55, weight: 132.91, type: 'metal' }, + { name: 'Barium', symbol: 'Ba', number: 56, weight: 137.33, type: 'metal' }, + { name: 'Lanthanum', symbol: 'La', number: 57, weight: 138.91, type: 'lanthanum' }, + { name: 'Hafnium', symbol: 'Hf', number: 72, weight: 178.49, type: 'metal' }, + { name: 'Tantalum', symbol: 'Ta', number: 73, weight: 180.95, type: 'metal' }, + { name: 'Tungsten', symbol: 'W', number: 74, weight: 183.84, type: 'metal' }, + { name: 'Rhenium', symbol: 'Re', number: 75, weight: 186.21, type: 'metal' }, + { name: 'Osmium', symbol: 'Os', number: 76, weight: 190.23, type: 'metal' }, + { name: 'Iridium', symbol: 'Ir', number: 77, weight: 192.22, type: 'metal' }, + { name: 'Platinum', symbol: 'Pt', number: 78, weight: 195.09, type: 'metal' }, + { name: 'Gold', symbol: 'Au', number: 79, weight: 196.97, type: 'metal' }, + { name: 'Mercury', symbol: 'Hg', number: 80, weight: 200.59, type: 'metal' }, + { name: 'Thallium', symbol: 'Tl', number: 81, weight: 204.38, type: 'metal' }, + { name: 'Lead', symbol: 'Pb', number: 82, weight: 207.2, type: 'metal' }, + { name: 'Bismuth', symbol: 'Bi', number: 83, weight: 208.98, type: 'metal' }, + { name: 'Polonium', symbol: 'Po', number: 84, weight: 209, type: 'metal' }, + { name: 'Astatine', symbol: 'At', number: 85, weight: 210, type: 'nonmetal' }, + { name: 'Radon', symbol: 'Rn', number: 86, weight: 222, type: 'noblegas' }, + ], + [ + { name: 'Francium', symbol: 'Fr', number: 87, weight: 223, type: 'metal' }, + { name: 'Radium', symbol: 'Ra', number: 88, weight: 226, type: 'metal' }, + { name: 'Actinium', symbol: 'Ac', number: 89, weight: 227, type: 'actinium' }, + { name: 'Rutherfordium', symbol: 'Rf', number: 104, weight: 267, type: 'metal' }, + { name: 'Dubnium', symbol: 'Db', number: 105, weight: 268, type: 'metal' }, + { name: 'Seaborgium', symbol: 'Sg', number: 106, weight: 271, type: 'metal' }, + { name: 'Bohrium', symbol: 'Bh', number: 107, weight: 272, type: 'metal' }, + { name: 'Hassium', symbol: 'Hs', number: 108, weight: 277, type: 'metal' }, + { name: 'Meitnerium', symbol: 'Mt', number: 109, weight: 278, type: 'metal' }, + { name: 'Darmstadtium', symbol: 'Ds', number: 110, weight: 281, type: 'metal' }, + { name: 'Roentgenium', symbol: 'Rg', number: 111, weight: 280, type: 'metal' }, + { name: 'Copernicium', symbol: 'Cn', number: 112, weight: 285, type: 'metal' }, + { name: 'Nihonium', symbol: 'Nh', number: 113, weight: 286, type: 'metal' }, + { name: 'Flerovium', symbol: 'Fl', number: 114, weight: 289, type: 'metal' }, + { name: 'Moscovium', symbol: 'Mc', number: 115, weight: 290, type: 'metal' }, + { name: 'Livermorium', symbol: 'Lv', number: 116, weight: 293, type: 'metal' }, + { name: 'Tennessine', symbol: 'Ts', number: 117, weight: 294, type: 'metal' }, + { name: 'Oganesson', symbol: 'Og', number: 118, weight: 294, type: 'noblegas' }, + ], +] + +const series = [ + [ + { name: '', symbol: '', number: -1, weight: 0, type: 'empty' }, + { name: '', symbol: '', number: -1, weight: 0, type: 'empty' }, + { name: '', symbol: '', number: -1, weight: 0, type: 'empty' }, + { name: 'Cerium', symbol: 'Ce', number: 58, weight: 140.12, type: 'lanthanum' }, + { name: 'Praseodymium', symbol: 'Pr', number: 59, weight: 140.91, type: 'lanthanum' }, + { name: 'Neodymium', symbol: 'Nd', number: 60, weight: 144.24, type: 'lanthanum' }, + { name: 'Promethium', symbol: 'Pm', number: 61, weight: 145, type: 'lanthanum' }, + { name: 'Samarium', symbol: 'Sm', number: 62, weight: 150.36, type: 'lanthanum' }, + { name: 'Europium', symbol: 'Eu', number: 63, weight: 151.96, type: 'lanthanum' }, + { name: 'Gadolinium', symbol: 'Gd', number: 64, weight: 157.25, type: 'lanthanum' }, + { name: 'Terbium', symbol: 'Tb', number: 65, weight: 158.93, type: 'lanthanum' }, + { name: 'Dysprosium', symbol: 'Dy', number: 66, weight: 162.5, type: 'lanthanum' }, + { name: 'Holmium', symbol: 'Ho', number: 67, weight: 164.93, type: 'lanthanum' }, + { name: 'Erbium', symbol: 'Er', number: 68, weight: 167.26, type: 'lanthanum' }, + { name: 'Thulium', symbol: 'Tm', number: 69, weight: 168.93, type: 'lanthanum' }, + { name: 'Ytterbium', symbol: 'Yb', number: 70, weight: 173.04, type: 'lanthanum' }, + { name: 'Lutetium', symbol: 'Lu', number: 71, weight: 174.97, type: 'lanthanum' }, + { name: '', symbol: '', number: -1, weight: 0, type: 'empty' }, + ], + [ + { name: '', symbol: '', number: -1, weight: 0, type: 'empty' }, + { name: '', symbol: '', number: -1, weight: 0, type: 'empty' }, + { name: '', symbol: '', number: -1, weight: 0, type: 'empty' }, + { name: 'Thorium', symbol: 'Th', number: 90, weight: 232.04, type: 'actinium' }, + { name: 'Protactinium', symbol: 'Pa', number: 91, weight: 231.04, type: 'actinium' }, + { name: 'Uranium', symbol: 'U', number: 92, weight: 238.03, type: 'actinium' }, + { name: 'Neptunium', symbol: 'Np', number: 93, weight: 237, type: 'actinium' }, + { name: 'Plutonium', symbol: 'Pu', number: 94, weight: 244, type: 'actinium' }, + { name: 'Americium', symbol: 'Am', number: 95, weight: 243, type: 'actinium' }, + { name: 'Curium', symbol: 'Cm', number: 96, weight: 247, type: 'actinium' }, + { name: 'Berkelium', symbol: 'Bk', number: 97, weight: 247, type: 'actinium' }, + { name: 'Californium', symbol: 'Cf', number: 98, weight: 251, type: 'actinium' }, + { name: 'Einsteinium', symbol: 'Es', number: 99, weight: 252, type: 'actinium' }, + { name: 'Fermium', symbol: 'Fm', number: 100, weight: 257, type: 'actinium' }, + { name: 'Mendelevium', symbol: 'Md', number: 101, weight: 258, type: 'actinium' }, + { name: 'Nobelium', symbol: 'No', number: 102, weight: 259, type: 'actinium' }, + { name: 'Lawrencium', symbol: 'Lr', number: 103, weight: 262, type: 'actinium' }, + { name: '', symbol: '', number: -1, weight: 0, type: 'empty' }, + ], +]; + +const niceTypes = { + 'metal': "Metal", + 'nonmetal': "Nonmetal", + 'noblegas': "Noble gas", + 'lanthanum': "Lanthanum", + 'actinium': "Actinium" +} diff --git a/.config/quickshell/modules/common/Appearance.qml b/.config/quickshell/ii/modules/common/Appearance.qml similarity index 99% rename from .config/quickshell/modules/common/Appearance.qml rename to .config/quickshell/ii/modules/common/Appearance.qml index c8b62350a..88e04bd30 100644 --- a/.config/quickshell/modules/common/Appearance.qml +++ b/.config/quickshell/ii/modules/common/Appearance.qml @@ -100,7 +100,7 @@ Singleton { colors: QtObject { property color colSubtext: m3colors.m3outline - property color colLayer0: ColorUtils.mix(ColorUtils.transparentize(m3colors.m3background, root.transparency), m3colors.m3primary, Config.options.appearance.extraBackgroundTint ? 0.97 : 1) + property color colLayer0: ColorUtils.mix(ColorUtils.transparentize(m3colors.m3background, root.transparency), m3colors.m3primary, Config.options.appearance.extraBackgroundTint ? 0.99 : 1) property color colOnLayer0: m3colors.m3onBackground property color colLayer0Hover: ColorUtils.transparentize(ColorUtils.mix(colLayer0, colOnLayer0, 0.9, root.contentTransparency)) property color colLayer0Active: ColorUtils.transparentize(ColorUtils.mix(colLayer0, colOnLayer0, 0.8, root.contentTransparency)) diff --git a/.config/quickshell/modules/common/Config.qml b/.config/quickshell/ii/modules/common/Config.qml similarity index 96% rename from .config/quickshell/modules/common/Config.qml rename to .config/quickshell/ii/modules/common/Config.qml index 81a8989de..1b9b1dd81 100644 --- a/.config/quickshell/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 } @@ -211,7 +216,7 @@ Singleton { property JsonObject time: JsonObject { // https://doc.qt.io/qt-6/qtime.html#toString property string format: "hh:mm" - property string dateFormat: "dddd, dd/MM" + property string dateFormat: "ddd, dd/MM" } property JsonObject windows: JsonObject { @@ -222,6 +227,10 @@ Singleton { property JsonObject hacks: JsonObject { property int arbitraryRaceConditionDelay: 20 // milliseconds } + + property JsonObject screenshotTool: JsonObject { + property bool showContentRegions: true + } } } } diff --git a/.config/quickshell/modules/common/Directories.qml b/.config/quickshell/ii/modules/common/Directories.qml similarity index 83% rename from .config/quickshell/modules/common/Directories.qml rename to .config/quickshell/ii/modules/common/Directories.qml index b058c2001..38cfd73d7 100644 --- a/.config/quickshell/modules/common/Directories.qml +++ b/.config/quickshell/ii/modules/common/Directories.qml @@ -16,7 +16,8 @@ Singleton { readonly property string downloads: StandardPaths.standardLocations(StandardPaths.DownloadLocation)[0] // Other dirs used by the shell, without "file://" - property string scriptPath: FileUtils.trimFileProtocol(`${Directories.config}/quickshell/scripts`) + property string assetsPath: Quickshell.configPath("assets") + property string scriptPath: Quickshell.configPath("scripts") property string favicons: FileUtils.trimFileProtocol(`${Directories.cache}/media/favicons`) property string coverArt: FileUtils.trimFileProtocol(`${Directories.cache}/media/coverart`) property string booruPreviews: FileUtils.trimFileProtocol(`${Directories.cache}/media/boorus`) @@ -30,17 +31,20 @@ Singleton { property string notificationsPath: FileUtils.trimFileProtocol(`${Directories.cache}/notifications/notifications.json`) property string generatedMaterialThemePath: FileUtils.trimFileProtocol(`${Directories.state}/user/generated/colors.json`) property string cliphistDecode: FileUtils.trimFileProtocol(`/tmp/quickshell/media/cliphist`) + property string screenshotTemp: "/tmp/quickshell/media/screenshot" property string wallpaperSwitchScriptPath: FileUtils.trimFileProtocol(`${Directories.scriptPath}/colors/switchwall.sh`) - property string defaultAiPrompts: FileUtils.trimFileProtocol(`${Directories.config}/quickshell/defaults/ai/prompts`) + property string defaultAiPrompts: Quickshell.configPath("defaults/ai/prompts") property string userAiPrompts: FileUtils.trimFileProtocol(`${Directories.shellConfig}/ai/prompts`) + property string aiChats: FileUtils.trimFileProtocol(`${Directories.state}/user/ai/chats`) // Cleanup on init Component.onCompleted: { - Quickshell.execDetached(["bash", "-c", `mkdir -p '${shellConfig}'`]) - Quickshell.execDetached(["bash", "-c", `mkdir -p '${favicons}'`]) + Quickshell.execDetached(["mkdir", "-p", `${shellConfig}`]) + Quickshell.execDetached(["mkdir", "-p", `${favicons}`]) Quickshell.execDetached(["bash", "-c", `rm -rf '${coverArt}'; mkdir -p '${coverArt}'`]) Quickshell.execDetached(["bash", "-c", `rm -rf '${booruPreviews}'; mkdir -p '${booruPreviews}'`]) Quickshell.execDetached(["bash", "-c", `mkdir -p '${booruDownloads}' && mkdir -p '${booruDownloadsNsfw}'`]) Quickshell.execDetached(["bash", "-c", `rm -rf '${latexOutput}'; mkdir -p '${latexOutput}'`]) Quickshell.execDetached(["bash", "-c", `rm -rf '${cliphistDecode}'; mkdir -p '${cliphistDecode}'`]) + Quickshell.execDetached(["mkdir", "-p", `${aiChats}`]) } } diff --git a/.config/quickshell/modules/common/Persistent.qml b/.config/quickshell/ii/modules/common/Persistent.qml similarity index 100% rename from .config/quickshell/modules/common/Persistent.qml rename to .config/quickshell/ii/modules/common/Persistent.qml diff --git a/.config/quickshell/modules/common/PersistentStates.qml b/.config/quickshell/ii/modules/common/PersistentStates.qml similarity index 100% rename from .config/quickshell/modules/common/PersistentStates.qml rename to .config/quickshell/ii/modules/common/PersistentStates.qml diff --git a/.config/quickshell/modules/common/functions/color_utils.js b/.config/quickshell/ii/modules/common/functions/color_utils.js similarity index 100% rename from .config/quickshell/modules/common/functions/color_utils.js rename to .config/quickshell/ii/modules/common/functions/color_utils.js diff --git a/.config/quickshell/modules/common/functions/file_utils.js b/.config/quickshell/ii/modules/common/functions/file_utils.js similarity index 100% rename from .config/quickshell/modules/common/functions/file_utils.js rename to .config/quickshell/ii/modules/common/functions/file_utils.js diff --git a/.config/quickshell/modules/common/functions/fuzzysort.js b/.config/quickshell/ii/modules/common/functions/fuzzysort.js similarity index 100% rename from .config/quickshell/modules/common/functions/fuzzysort.js rename to .config/quickshell/ii/modules/common/functions/fuzzysort.js diff --git a/.config/quickshell/modules/common/functions/levendist.js b/.config/quickshell/ii/modules/common/functions/levendist.js similarity index 100% rename from .config/quickshell/modules/common/functions/levendist.js rename to .config/quickshell/ii/modules/common/functions/levendist.js diff --git a/.config/quickshell/modules/common/functions/object_utils.js b/.config/quickshell/ii/modules/common/functions/object_utils.js similarity index 100% rename from .config/quickshell/modules/common/functions/object_utils.js rename to .config/quickshell/ii/modules/common/functions/object_utils.js diff --git a/.config/quickshell/modules/common/functions/string_utils.js b/.config/quickshell/ii/modules/common/functions/string_utils.js similarity index 100% rename from .config/quickshell/modules/common/functions/string_utils.js rename to .config/quickshell/ii/modules/common/functions/string_utils.js diff --git a/.config/quickshell/modules/common/widgets/ButtonGroup.qml b/.config/quickshell/ii/modules/common/widgets/ButtonGroup.qml similarity index 97% rename from .config/quickshell/modules/common/widgets/ButtonGroup.qml rename to .config/quickshell/ii/modules/common/widgets/ButtonGroup.qml index 5356535f4..4b8676f40 100644 --- a/.config/quickshell/modules/common/widgets/ButtonGroup.qml +++ b/.config/quickshell/ii/modules/common/widgets/ButtonGroup.qml @@ -20,6 +20,7 @@ Rectangle { let total = 0; for (let i = 0; i < rowLayout.children.length; ++i) { const child = rowLayout.children[i]; + if (!child.visible) continue; total += child.baseWidth ?? child.implicitWidth ?? child.width; } return total + rowLayout.spacing * (rowLayout.children.length - 1); diff --git a/.config/quickshell/modules/common/widgets/CircularProgress.qml b/.config/quickshell/ii/modules/common/widgets/CircularProgress.qml similarity index 100% rename from .config/quickshell/modules/common/widgets/CircularProgress.qml rename to .config/quickshell/ii/modules/common/widgets/CircularProgress.qml diff --git a/.config/quickshell/modules/common/widgets/CliphistImage.qml b/.config/quickshell/ii/modules/common/widgets/CliphistImage.qml similarity index 100% rename from .config/quickshell/modules/common/widgets/CliphistImage.qml rename to .config/quickshell/ii/modules/common/widgets/CliphistImage.qml diff --git a/.config/quickshell/modules/common/widgets/ConfigRow.qml b/.config/quickshell/ii/modules/common/widgets/ConfigRow.qml similarity index 100% rename from .config/quickshell/modules/common/widgets/ConfigRow.qml rename to .config/quickshell/ii/modules/common/widgets/ConfigRow.qml diff --git a/.config/quickshell/modules/common/widgets/ConfigSelectionArray.qml b/.config/quickshell/ii/modules/common/widgets/ConfigSelectionArray.qml similarity index 100% rename from .config/quickshell/modules/common/widgets/ConfigSelectionArray.qml rename to .config/quickshell/ii/modules/common/widgets/ConfigSelectionArray.qml diff --git a/.config/quickshell/modules/common/widgets/ConfigSpinBox.qml b/.config/quickshell/ii/modules/common/widgets/ConfigSpinBox.qml similarity index 100% rename from .config/quickshell/modules/common/widgets/ConfigSpinBox.qml rename to .config/quickshell/ii/modules/common/widgets/ConfigSpinBox.qml diff --git a/.config/quickshell/modules/common/widgets/ConfigSwitch.qml b/.config/quickshell/ii/modules/common/widgets/ConfigSwitch.qml similarity index 100% rename from .config/quickshell/modules/common/widgets/ConfigSwitch.qml rename to .config/quickshell/ii/modules/common/widgets/ConfigSwitch.qml diff --git a/.config/quickshell/modules/common/widgets/ContentPage.qml b/.config/quickshell/ii/modules/common/widgets/ContentPage.qml similarity index 100% rename from .config/quickshell/modules/common/widgets/ContentPage.qml rename to .config/quickshell/ii/modules/common/widgets/ContentPage.qml diff --git a/.config/quickshell/modules/common/widgets/ContentSection.qml b/.config/quickshell/ii/modules/common/widgets/ContentSection.qml similarity index 100% rename from .config/quickshell/modules/common/widgets/ContentSection.qml rename to .config/quickshell/ii/modules/common/widgets/ContentSection.qml diff --git a/.config/quickshell/modules/common/widgets/ContentSubsection.qml b/.config/quickshell/ii/modules/common/widgets/ContentSubsection.qml similarity index 100% rename from .config/quickshell/modules/common/widgets/ContentSubsection.qml rename to .config/quickshell/ii/modules/common/widgets/ContentSubsection.qml diff --git a/.config/quickshell/modules/common/widgets/ContentSubsectionLabel.qml b/.config/quickshell/ii/modules/common/widgets/ContentSubsectionLabel.qml similarity index 100% rename from .config/quickshell/modules/common/widgets/ContentSubsectionLabel.qml rename to .config/quickshell/ii/modules/common/widgets/ContentSubsectionLabel.qml diff --git a/.config/quickshell/modules/common/widgets/CustomIcon.qml b/.config/quickshell/ii/modules/common/widgets/CustomIcon.qml similarity index 65% rename from .config/quickshell/modules/common/widgets/CustomIcon.qml rename to .config/quickshell/ii/modules/common/widgets/CustomIcon.qml index 8905b0715..285196156 100644 --- a/.config/quickshell/modules/common/widgets/CustomIcon.qml +++ b/.config/quickshell/ii/modules/common/widgets/CustomIcon.qml @@ -1,10 +1,13 @@ import QtQuick import Quickshell import Quickshell.Widgets +import Qt5Compat.GraphicalEffects Item { id: root + property bool colorize: false + property color color property string source: "" property string iconFolder: "root:/assets/icons" // The folder to check first width: 30 @@ -21,4 +24,13 @@ Item { } implicitSize: root.height } + + Loader { + active: root.colorize + anchors.fill: iconImage + sourceComponent: ColorOverlay { + source: iconImage + color: root.color + } + } } diff --git a/.config/quickshell/modules/common/widgets/DialogButton.qml b/.config/quickshell/ii/modules/common/widgets/DialogButton.qml similarity index 100% rename from .config/quickshell/modules/common/widgets/DialogButton.qml rename to .config/quickshell/ii/modules/common/widgets/DialogButton.qml diff --git a/.config/quickshell/modules/common/widgets/DragManager.qml b/.config/quickshell/ii/modules/common/widgets/DragManager.qml similarity index 100% rename from .config/quickshell/modules/common/widgets/DragManager.qml rename to .config/quickshell/ii/modules/common/widgets/DragManager.qml diff --git a/.config/quickshell/modules/common/widgets/Favicon.qml b/.config/quickshell/ii/modules/common/widgets/Favicon.qml similarity index 100% rename from .config/quickshell/modules/common/widgets/Favicon.qml rename to .config/quickshell/ii/modules/common/widgets/Favicon.qml diff --git a/.config/quickshell/modules/common/widgets/FloatingActionButton.qml b/.config/quickshell/ii/modules/common/widgets/FloatingActionButton.qml similarity index 100% rename from .config/quickshell/modules/common/widgets/FloatingActionButton.qml rename to .config/quickshell/ii/modules/common/widgets/FloatingActionButton.qml diff --git a/.config/quickshell/modules/common/widgets/FlowButtonGroup.qml b/.config/quickshell/ii/modules/common/widgets/FlowButtonGroup.qml similarity index 100% rename from .config/quickshell/modules/common/widgets/FlowButtonGroup.qml rename to .config/quickshell/ii/modules/common/widgets/FlowButtonGroup.qml diff --git a/.config/quickshell/modules/common/widgets/GroupButton.qml b/.config/quickshell/ii/modules/common/widgets/GroupButton.qml similarity index 100% rename from .config/quickshell/modules/common/widgets/GroupButton.qml rename to .config/quickshell/ii/modules/common/widgets/GroupButton.qml diff --git a/.config/quickshell/modules/common/widgets/KeyboardKey.qml b/.config/quickshell/ii/modules/common/widgets/KeyboardKey.qml similarity index 100% rename from .config/quickshell/modules/common/widgets/KeyboardKey.qml rename to .config/quickshell/ii/modules/common/widgets/KeyboardKey.qml diff --git a/.config/quickshell/modules/common/widgets/LightDarkPreferenceButton.qml b/.config/quickshell/ii/modules/common/widgets/LightDarkPreferenceButton.qml similarity index 100% rename from .config/quickshell/modules/common/widgets/LightDarkPreferenceButton.qml rename to .config/quickshell/ii/modules/common/widgets/LightDarkPreferenceButton.qml diff --git a/.config/quickshell/modules/common/widgets/MaterialSymbol.qml b/.config/quickshell/ii/modules/common/widgets/MaterialSymbol.qml similarity index 100% rename from .config/quickshell/modules/common/widgets/MaterialSymbol.qml rename to .config/quickshell/ii/modules/common/widgets/MaterialSymbol.qml diff --git a/.config/quickshell/modules/common/widgets/MaterialTextField.qml b/.config/quickshell/ii/modules/common/widgets/MaterialTextField.qml similarity index 100% rename from .config/quickshell/modules/common/widgets/MaterialTextField.qml rename to .config/quickshell/ii/modules/common/widgets/MaterialTextField.qml diff --git a/.config/quickshell/modules/common/widgets/MenuButton.qml b/.config/quickshell/ii/modules/common/widgets/MenuButton.qml similarity index 100% rename from .config/quickshell/modules/common/widgets/MenuButton.qml rename to .config/quickshell/ii/modules/common/widgets/MenuButton.qml diff --git a/.config/quickshell/modules/common/widgets/NavigationRail.qml b/.config/quickshell/ii/modules/common/widgets/NavigationRail.qml similarity index 100% rename from .config/quickshell/modules/common/widgets/NavigationRail.qml rename to .config/quickshell/ii/modules/common/widgets/NavigationRail.qml diff --git a/.config/quickshell/modules/common/widgets/NavigationRailButton.qml b/.config/quickshell/ii/modules/common/widgets/NavigationRailButton.qml similarity index 100% rename from .config/quickshell/modules/common/widgets/NavigationRailButton.qml rename to .config/quickshell/ii/modules/common/widgets/NavigationRailButton.qml diff --git a/.config/quickshell/modules/common/widgets/NavigationRailExpandButton.qml b/.config/quickshell/ii/modules/common/widgets/NavigationRailExpandButton.qml similarity index 100% rename from .config/quickshell/modules/common/widgets/NavigationRailExpandButton.qml rename to .config/quickshell/ii/modules/common/widgets/NavigationRailExpandButton.qml diff --git a/.config/quickshell/modules/common/widgets/NavigationRailTabArray.qml b/.config/quickshell/ii/modules/common/widgets/NavigationRailTabArray.qml similarity index 100% rename from .config/quickshell/modules/common/widgets/NavigationRailTabArray.qml rename to .config/quickshell/ii/modules/common/widgets/NavigationRailTabArray.qml diff --git a/.config/quickshell/modules/common/widgets/NotificationActionButton.qml b/.config/quickshell/ii/modules/common/widgets/NotificationActionButton.qml similarity index 100% rename from .config/quickshell/modules/common/widgets/NotificationActionButton.qml rename to .config/quickshell/ii/modules/common/widgets/NotificationActionButton.qml diff --git a/.config/quickshell/modules/common/widgets/NotificationAppIcon.qml b/.config/quickshell/ii/modules/common/widgets/NotificationAppIcon.qml similarity index 100% rename from .config/quickshell/modules/common/widgets/NotificationAppIcon.qml rename to .config/quickshell/ii/modules/common/widgets/NotificationAppIcon.qml diff --git a/.config/quickshell/modules/common/widgets/NotificationGroup.qml b/.config/quickshell/ii/modules/common/widgets/NotificationGroup.qml similarity index 100% rename from .config/quickshell/modules/common/widgets/NotificationGroup.qml rename to .config/quickshell/ii/modules/common/widgets/NotificationGroup.qml diff --git a/.config/quickshell/modules/common/widgets/NotificationGroupExpandButton.qml b/.config/quickshell/ii/modules/common/widgets/NotificationGroupExpandButton.qml similarity index 100% rename from .config/quickshell/modules/common/widgets/NotificationGroupExpandButton.qml rename to .config/quickshell/ii/modules/common/widgets/NotificationGroupExpandButton.qml diff --git a/.config/quickshell/modules/common/widgets/NotificationItem.qml b/.config/quickshell/ii/modules/common/widgets/NotificationItem.qml similarity index 100% rename from .config/quickshell/modules/common/widgets/NotificationItem.qml rename to .config/quickshell/ii/modules/common/widgets/NotificationItem.qml diff --git a/.config/quickshell/modules/common/widgets/NotificationListView.qml b/.config/quickshell/ii/modules/common/widgets/NotificationListView.qml similarity index 100% rename from .config/quickshell/modules/common/widgets/NotificationListView.qml rename to .config/quickshell/ii/modules/common/widgets/NotificationListView.qml diff --git a/.config/quickshell/modules/common/widgets/PointingHandInteraction.qml b/.config/quickshell/ii/modules/common/widgets/PointingHandInteraction.qml similarity index 100% rename from .config/quickshell/modules/common/widgets/PointingHandInteraction.qml rename to .config/quickshell/ii/modules/common/widgets/PointingHandInteraction.qml diff --git a/.config/quickshell/modules/common/widgets/PointingHandLinkHover.qml b/.config/quickshell/ii/modules/common/widgets/PointingHandLinkHover.qml similarity index 100% rename from .config/quickshell/modules/common/widgets/PointingHandLinkHover.qml rename to .config/quickshell/ii/modules/common/widgets/PointingHandLinkHover.qml diff --git a/.config/quickshell/modules/common/widgets/PrimaryTabBar.qml b/.config/quickshell/ii/modules/common/widgets/PrimaryTabBar.qml similarity index 100% rename from .config/quickshell/modules/common/widgets/PrimaryTabBar.qml rename to .config/quickshell/ii/modules/common/widgets/PrimaryTabBar.qml diff --git a/.config/quickshell/modules/common/widgets/PrimaryTabButton.qml b/.config/quickshell/ii/modules/common/widgets/PrimaryTabButton.qml similarity index 100% rename from .config/quickshell/modules/common/widgets/PrimaryTabButton.qml rename to .config/quickshell/ii/modules/common/widgets/PrimaryTabButton.qml diff --git a/.config/quickshell/modules/common/widgets/Revealer.qml b/.config/quickshell/ii/modules/common/widgets/Revealer.qml similarity index 100% rename from .config/quickshell/modules/common/widgets/Revealer.qml rename to .config/quickshell/ii/modules/common/widgets/Revealer.qml diff --git a/.config/quickshell/modules/common/widgets/RippleButton.qml b/.config/quickshell/ii/modules/common/widgets/RippleButton.qml similarity index 100% rename from .config/quickshell/modules/common/widgets/RippleButton.qml rename to .config/quickshell/ii/modules/common/widgets/RippleButton.qml diff --git a/.config/quickshell/modules/common/widgets/RippleButtonWithIcon.qml b/.config/quickshell/ii/modules/common/widgets/RippleButtonWithIcon.qml similarity index 100% rename from .config/quickshell/modules/common/widgets/RippleButtonWithIcon.qml rename to .config/quickshell/ii/modules/common/widgets/RippleButtonWithIcon.qml diff --git a/.config/quickshell/modules/common/widgets/RoundCorner.qml b/.config/quickshell/ii/modules/common/widgets/RoundCorner.qml similarity index 100% rename from .config/quickshell/modules/common/widgets/RoundCorner.qml rename to .config/quickshell/ii/modules/common/widgets/RoundCorner.qml diff --git a/.config/quickshell/modules/common/widgets/SecondaryTabButton.qml b/.config/quickshell/ii/modules/common/widgets/SecondaryTabButton.qml similarity index 100% rename from .config/quickshell/modules/common/widgets/SecondaryTabButton.qml rename to .config/quickshell/ii/modules/common/widgets/SecondaryTabButton.qml diff --git a/.config/quickshell/modules/common/widgets/SelectionDialog.qml b/.config/quickshell/ii/modules/common/widgets/SelectionDialog.qml similarity index 100% rename from .config/quickshell/modules/common/widgets/SelectionDialog.qml rename to .config/quickshell/ii/modules/common/widgets/SelectionDialog.qml diff --git a/.config/quickshell/modules/common/widgets/SelectionGroupButton.qml b/.config/quickshell/ii/modules/common/widgets/SelectionGroupButton.qml similarity index 100% rename from .config/quickshell/modules/common/widgets/SelectionGroupButton.qml rename to .config/quickshell/ii/modules/common/widgets/SelectionGroupButton.qml diff --git a/.config/quickshell/modules/common/widgets/StyledLabel.qml b/.config/quickshell/ii/modules/common/widgets/StyledLabel.qml similarity index 100% rename from .config/quickshell/modules/common/widgets/StyledLabel.qml rename to .config/quickshell/ii/modules/common/widgets/StyledLabel.qml diff --git a/.config/quickshell/modules/common/widgets/StyledListView.qml b/.config/quickshell/ii/modules/common/widgets/StyledListView.qml similarity index 100% rename from .config/quickshell/modules/common/widgets/StyledListView.qml rename to .config/quickshell/ii/modules/common/widgets/StyledListView.qml diff --git a/.config/quickshell/modules/common/widgets/StyledProgressBar.qml b/.config/quickshell/ii/modules/common/widgets/StyledProgressBar.qml similarity index 100% rename from .config/quickshell/modules/common/widgets/StyledProgressBar.qml rename to .config/quickshell/ii/modules/common/widgets/StyledProgressBar.qml diff --git a/.config/quickshell/modules/common/widgets/StyledRadioButton.qml b/.config/quickshell/ii/modules/common/widgets/StyledRadioButton.qml similarity index 100% rename from .config/quickshell/modules/common/widgets/StyledRadioButton.qml rename to .config/quickshell/ii/modules/common/widgets/StyledRadioButton.qml diff --git a/.config/quickshell/modules/common/widgets/StyledRectangularShadow.qml b/.config/quickshell/ii/modules/common/widgets/StyledRectangularShadow.qml similarity index 100% rename from .config/quickshell/modules/common/widgets/StyledRectangularShadow.qml rename to .config/quickshell/ii/modules/common/widgets/StyledRectangularShadow.qml diff --git a/.config/quickshell/ii/modules/common/widgets/StyledSlider.qml b/.config/quickshell/ii/modules/common/widgets/StyledSlider.qml new file mode 100644 index 000000000..93fe43f33 --- /dev/null +++ b/.config/quickshell/ii/modules/common/widgets/StyledSlider.qml @@ -0,0 +1,155 @@ +import "root:/modules/common" +import "root:/modules/common/widgets" +import "root:/services" +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts +import Quickshell.Widgets + +/** + * 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 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 color dotColor: Appearance.m3colors.m3onSecondaryContainer + property color dotColorHighlighted: Appearance.m3colors.m3onPrimary + property real unsharpenRadius: Appearance.rounding.unsharpen + 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 + + Behavior on value { // This makes the adjusted value (like volume) shift smoothly + SmoothedAnimation { + velocity: Appearance.animation.elementMoveFast.velocity + } + } + + Behavior on handleMargins { + 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) + } + } + + MouseArea { + anchors.fill: parent + onPressed: (mouse) => mouse.accepted = false + cursorShape: root.pressed ? Qt.ClosedHandCursor : Qt.PointingHandCursor + } + + background: Item { + anchors.verticalCenter: parent.verticalCenter + width: parent.width + implicitHeight: trackWidth + + // Fill left + Rectangle { + 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 + topRightRadius: root.unsharpenRadius + bottomRightRadius: root.unsharpenRadius + } + + // Fill right + Rectangle { + 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 + topRightRadius: root.trackRadius + bottomRightRadius: root.trackRadius + topLeftRadius: root.unsharpenRadius + bottomLeftRadius: root.unsharpenRadius + } + + // Stop indicators + Repeater { + model: root.stopIndicatorValues + TrackDot { + required property real modelData + value: modelData + anchors.verticalCenter: parent.verticalCenter + } + } + } + + handle: Rectangle { + id: handle + + 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 + + Behavior on implicitWidth { + animation: Appearance?.animation.elementMoveFast.numberAnimation.createObject(this) + } + + StyledToolTip { + extraVisibleCondition: root.pressed + content: root.tooltipContent + } + } +} \ No newline at end of file diff --git a/.config/quickshell/modules/common/widgets/StyledSpinBox.qml b/.config/quickshell/ii/modules/common/widgets/StyledSpinBox.qml similarity index 100% rename from .config/quickshell/modules/common/widgets/StyledSpinBox.qml rename to .config/quickshell/ii/modules/common/widgets/StyledSpinBox.qml diff --git a/.config/quickshell/modules/common/widgets/StyledSwitch.qml b/.config/quickshell/ii/modules/common/widgets/StyledSwitch.qml similarity index 100% rename from .config/quickshell/modules/common/widgets/StyledSwitch.qml rename to .config/quickshell/ii/modules/common/widgets/StyledSwitch.qml diff --git a/.config/quickshell/modules/common/widgets/StyledText.qml b/.config/quickshell/ii/modules/common/widgets/StyledText.qml similarity index 100% rename from .config/quickshell/modules/common/widgets/StyledText.qml rename to .config/quickshell/ii/modules/common/widgets/StyledText.qml diff --git a/.config/quickshell/modules/common/widgets/StyledTextArea.qml b/.config/quickshell/ii/modules/common/widgets/StyledTextArea.qml similarity index 100% rename from .config/quickshell/modules/common/widgets/StyledTextArea.qml rename to .config/quickshell/ii/modules/common/widgets/StyledTextArea.qml diff --git a/.config/quickshell/modules/common/widgets/StyledTextInput.qml b/.config/quickshell/ii/modules/common/widgets/StyledTextInput.qml similarity index 100% rename from .config/quickshell/modules/common/widgets/StyledTextInput.qml rename to .config/quickshell/ii/modules/common/widgets/StyledTextInput.qml diff --git a/.config/quickshell/modules/common/widgets/StyledToolTip.qml b/.config/quickshell/ii/modules/common/widgets/StyledToolTip.qml similarity index 100% rename from .config/quickshell/modules/common/widgets/StyledToolTip.qml rename to .config/quickshell/ii/modules/common/widgets/StyledToolTip.qml diff --git a/.config/quickshell/modules/common/widgets/VerticalButtonGroup.qml b/.config/quickshell/ii/modules/common/widgets/VerticalButtonGroup.qml similarity index 100% rename from .config/quickshell/modules/common/widgets/VerticalButtonGroup.qml rename to .config/quickshell/ii/modules/common/widgets/VerticalButtonGroup.qml diff --git a/.config/quickshell/modules/common/widgets/WaveVisualizer.qml b/.config/quickshell/ii/modules/common/widgets/WaveVisualizer.qml similarity index 100% rename from .config/quickshell/modules/common/widgets/WaveVisualizer.qml rename to .config/quickshell/ii/modules/common/widgets/WaveVisualizer.qml diff --git a/.config/quickshell/modules/common/widgets/notification_utils.js b/.config/quickshell/ii/modules/common/widgets/notification_utils.js similarity index 100% rename from .config/quickshell/modules/common/widgets/notification_utils.js rename to .config/quickshell/ii/modules/common/widgets/notification_utils.js diff --git a/.config/quickshell/modules/dock/Dock.qml b/.config/quickshell/ii/modules/dock/Dock.qml similarity index 100% rename from .config/quickshell/modules/dock/Dock.qml rename to .config/quickshell/ii/modules/dock/Dock.qml diff --git a/.config/quickshell/modules/dock/DockAppButton.qml b/.config/quickshell/ii/modules/dock/DockAppButton.qml similarity index 100% rename from .config/quickshell/modules/dock/DockAppButton.qml rename to .config/quickshell/ii/modules/dock/DockAppButton.qml diff --git a/.config/quickshell/modules/dock/DockApps.qml b/.config/quickshell/ii/modules/dock/DockApps.qml similarity index 100% rename from .config/quickshell/modules/dock/DockApps.qml rename to .config/quickshell/ii/modules/dock/DockApps.qml diff --git a/.config/quickshell/modules/dock/DockButton.qml b/.config/quickshell/ii/modules/dock/DockButton.qml similarity index 100% rename from .config/quickshell/modules/dock/DockButton.qml rename to .config/quickshell/ii/modules/dock/DockButton.qml diff --git a/.config/quickshell/modules/dock/DockSeparator.qml b/.config/quickshell/ii/modules/dock/DockSeparator.qml similarity index 100% rename from .config/quickshell/modules/dock/DockSeparator.qml rename to .config/quickshell/ii/modules/dock/DockSeparator.qml diff --git a/.config/quickshell/modules/mediaControls/MediaControls.qml b/.config/quickshell/ii/modules/mediaControls/MediaControls.qml similarity index 99% rename from .config/quickshell/modules/mediaControls/MediaControls.qml rename to .config/quickshell/ii/modules/mediaControls/MediaControls.qml index 446fa91c8..0dde4d126 100644 --- a/.config/quickshell/modules/mediaControls/MediaControls.qml +++ b/.config/quickshell/ii/modules/mediaControls/MediaControls.qml @@ -79,7 +79,7 @@ Scope { root.visualizerPoints = []; } } - command: ["cava", "-p", `${FileUtils.trimFileProtocol(Directories.config)}/quickshell/scripts/cava/raw_output_config.txt`] + command: ["cava", "-p", `${FileUtils.trimFileProtocol(Directories.scriptPath)}/cava/raw_output_config.txt`] stdout: SplitParser { onRead: data => { // Parse `;`-separated values into the visualizerPoints array diff --git a/.config/quickshell/modules/mediaControls/PlayerControl.qml b/.config/quickshell/ii/modules/mediaControls/PlayerControl.qml similarity index 98% rename from .config/quickshell/modules/mediaControls/PlayerControl.qml rename to .config/quickshell/ii/modules/mediaControls/PlayerControl.qml index 9cce01112..b58bd7421 100644 --- a/.config/quickshell/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 diff --git a/.config/quickshell/modules/notificationPopup/NotificationPopup.qml b/.config/quickshell/ii/modules/notificationPopup/NotificationPopup.qml similarity index 83% rename from .config/quickshell/modules/notificationPopup/NotificationPopup.qml rename to .config/quickshell/ii/modules/notificationPopup/NotificationPopup.qml index fb046343d..3f10a92f4 100644 --- a/.config/quickshell/modules/notificationPopup/NotificationPopup.qml +++ b/.config/quickshell/ii/modules/notificationPopup/NotificationPopup.qml @@ -36,10 +36,13 @@ Scope { NotificationListView { id: listview - anchors.top: parent.top - anchors.bottom: parent.bottom - anchors.horizontalCenter: parent.horizontalCenter - anchors.topMargin: 5 + anchors { + top: parent.top + bottom: parent.bottom + right: parent.right + rightMargin: 4 + topMargin: 4 + } implicitWidth: parent.width - Appearance.sizes.elevationMargin * 2 popup: true } diff --git a/.config/quickshell/modules/onScreenDisplay/OnScreenDisplayBrightness.qml b/.config/quickshell/ii/modules/onScreenDisplay/OnScreenDisplayBrightness.qml similarity index 100% rename from .config/quickshell/modules/onScreenDisplay/OnScreenDisplayBrightness.qml rename to .config/quickshell/ii/modules/onScreenDisplay/OnScreenDisplayBrightness.qml diff --git a/.config/quickshell/modules/onScreenDisplay/OnScreenDisplayVolume.qml b/.config/quickshell/ii/modules/onScreenDisplay/OnScreenDisplayVolume.qml similarity index 100% rename from .config/quickshell/modules/onScreenDisplay/OnScreenDisplayVolume.qml rename to .config/quickshell/ii/modules/onScreenDisplay/OnScreenDisplayVolume.qml diff --git a/.config/quickshell/modules/onScreenDisplay/OsdValueIndicator.qml b/.config/quickshell/ii/modules/onScreenDisplay/OsdValueIndicator.qml similarity index 100% rename from .config/quickshell/modules/onScreenDisplay/OsdValueIndicator.qml rename to .config/quickshell/ii/modules/onScreenDisplay/OsdValueIndicator.qml diff --git a/.config/quickshell/modules/onScreenKeyboard/OnScreenKeyboard.qml b/.config/quickshell/ii/modules/onScreenKeyboard/OnScreenKeyboard.qml similarity index 100% rename from .config/quickshell/modules/onScreenKeyboard/OnScreenKeyboard.qml rename to .config/quickshell/ii/modules/onScreenKeyboard/OnScreenKeyboard.qml diff --git a/.config/quickshell/modules/onScreenKeyboard/OskContent.qml b/.config/quickshell/ii/modules/onScreenKeyboard/OskContent.qml similarity index 100% rename from .config/quickshell/modules/onScreenKeyboard/OskContent.qml rename to .config/quickshell/ii/modules/onScreenKeyboard/OskContent.qml diff --git a/.config/quickshell/modules/onScreenKeyboard/OskKey.qml b/.config/quickshell/ii/modules/onScreenKeyboard/OskKey.qml similarity index 100% rename from .config/quickshell/modules/onScreenKeyboard/OskKey.qml rename to .config/quickshell/ii/modules/onScreenKeyboard/OskKey.qml diff --git a/.config/quickshell/modules/onScreenKeyboard/layouts.js b/.config/quickshell/ii/modules/onScreenKeyboard/layouts.js similarity index 100% rename from .config/quickshell/modules/onScreenKeyboard/layouts.js rename to .config/quickshell/ii/modules/onScreenKeyboard/layouts.js diff --git a/.config/quickshell/modules/overview/Overview.qml b/.config/quickshell/ii/modules/overview/Overview.qml similarity index 97% rename from .config/quickshell/modules/overview/Overview.qml rename to .config/quickshell/ii/modules/overview/Overview.qml index 0bc3c6c0f..952e5d29a 100644 --- a/.config/quickshell/modules/overview/Overview.qml +++ b/.config/quickshell/ii/modules/overview/Overview.qml @@ -33,9 +33,9 @@ Scope { mask: Region { item: GlobalStates.overviewOpen ? columnLayout : null } - HyprlandWindow.visibleMask: Region { - item: GlobalStates.overviewOpen ? columnLayout : null - } + // HyprlandWindow.visibleMask: Region { // Buggy with scaled monitors + // item: GlobalStates.overviewOpen ? columnLayout : null + // } anchors { diff --git a/.config/quickshell/modules/overview/OverviewWidget.qml b/.config/quickshell/ii/modules/overview/OverviewWidget.qml similarity index 96% rename from .config/quickshell/modules/overview/OverviewWidget.qml rename to .config/quickshell/ii/modules/overview/OverviewWidget.qml index a17cc0453..18e60c2f9 100644 --- a/.config/quickshell/modules/overview/OverviewWidget.qml +++ b/.config/quickshell/ii/modules/overview/OverviewWidget.qml @@ -19,7 +19,7 @@ Item { readonly property var toplevels: ToplevelManager.toplevels readonly property int workspacesShown: Config.options.overview.rows * Config.options.overview.columns readonly property int workspaceGroup: Math.floor((monitor.activeWorkspace?.id - 1) / workspacesShown) - property bool monitorIsFocused: (Hyprland.focusedMonitor?.id == monitor.id) + property bool monitorIsFocused: (Hyprland.focusedMonitor?.name == monitor.name) property var windows: HyprlandData.windowList property var windowByAddress: HyprlandData.windowByAddress property var windowAddresses: HyprlandData.addresses @@ -163,7 +163,7 @@ Item { property var address: `0x${modelData.HyprlandToplevel.address}` windowData: windowByAddress[address] toplevel: modelData - monitorData: root.monitorData + monitorData: HyprlandData.monitors[monitorId] scale: root.scale availableWorkspaceWidth: root.workspaceImplicitWidth availableWorkspaceHeight: root.workspaceImplicitHeight @@ -172,11 +172,12 @@ Item { property var monitor: HyprlandData.monitors[monitorId] property bool atInitPosition: (initX == x && initY == y) - restrictToWorkspace: Drag.active || atInitPosition property int workspaceColIndex: (windowData?.workspace.id - 1) % Config.options.overview.columns property int workspaceRowIndex: Math.floor((windowData?.workspace.id - 1) % root.workspacesShown / Config.options.overview.columns) - xOffset: (root.workspaceImplicitWidth + workspaceSpacing) * workspaceColIndex - (monitor?.x * root.scale) + xOffset: { + return (root.workspaceImplicitWidth + workspaceSpacing) * workspaceColIndex - (monitor?.x * root.scale) + } yOffset: (root.workspaceImplicitHeight + workspaceSpacing) * workspaceRowIndex - (monitor?.y * root.scale) Timer { @@ -187,7 +188,6 @@ Item { onTriggered: { window.x = Math.round(Math.max((windowData?.at[0] - monitorData?.reserved[0]) * root.scale, 0) + xOffset) window.y = Math.round(Math.max((windowData?.at[1] - monitorData?.reserved[1]) * root.scale, 0) + yOffset) - // console.log(`[OverviewWindow] Updated position for window ${windowData?.address} to (${window.x}, ${window.y})`) } } diff --git a/.config/quickshell/modules/overview/OverviewWindow.qml b/.config/quickshell/ii/modules/overview/OverviewWindow.qml similarity index 81% rename from .config/quickshell/modules/overview/OverviewWindow.qml rename to .config/quickshell/ii/modules/overview/OverviewWindow.qml index b749ab160..bf023a09d 100644 --- a/.config/quickshell/modules/overview/OverviewWindow.qml +++ b/.config/quickshell/ii/modules/overview/OverviewWindow.qml @@ -42,8 +42,8 @@ Item { // Window x: initX y: initY - width: Math.round(Math.min(windowData?.size[0] * root.scale, (restrictToWorkspace ? windowData?.size[0] : availableWorkspaceWidth - x + xOffset))) - height: Math.round(Math.min(windowData?.size[1] * root.scale, (restrictToWorkspace ? windowData?.size[1] : availableWorkspaceHeight - y + yOffset))) + width: windowData?.size[0] * root.scale + height: windowData?.size[1] * root.scale layer.enabled: true layer.effect: OpacityMask { @@ -91,7 +91,14 @@ Item { // Window Image { id: windowIcon - property var iconSize: Math.min(targetWindowWidth, targetWindowHeight) * (root.compactMode ? root.iconToWindowRatioCompact : root.iconToWindowRatio) + property var iconSize: { + // console.log("-=-=-", root.toplevel.title, "-=-=-") + // console.log("Target window size:", targetWindowWidth, targetWindowHeight) + // console.log("Icon ratio:", root.compactMode ? root.iconToWindowRatioCompact : root.iconToWindowRatio) + // console.log("Scale:", root.monitorData.scale) + // console.log("Final:", Math.min(targetWindowWidth, targetWindowHeight) * (root.compactMode ? root.iconToWindowRatioCompact : root.iconToWindowRatio) / root.monitorData.scale) + return Math.min(targetWindowWidth, targetWindowHeight) * (root.compactMode ? root.iconToWindowRatioCompact : root.iconToWindowRatio) / root.monitorData.scale; + } // mipmap: true Layout.alignment: Qt.AlignHCenter source: root.iconPath diff --git a/.config/quickshell/modules/overview/SearchItem.qml b/.config/quickshell/ii/modules/overview/SearchItem.qml similarity index 96% rename from .config/quickshell/modules/overview/SearchItem.qml rename to .config/quickshell/ii/modules/overview/SearchItem.qml index d23cb4c09..495ba8f9e 100644 --- a/.config/quickshell/modules/overview/SearchItem.qml +++ b/.config/quickshell/ii/modules/overview/SearchItem.qml @@ -27,6 +27,21 @@ RippleButton { property string bigText: entry?.bigText ?? "" property string materialSymbol: entry?.materialSymbol ?? "" property string cliphistRawString: entry?.cliphistRawString ?? "" + + visible: root.entryShown + property int horizontalMargin: 10 + property int buttonHorizontalPadding: 10 + property int buttonVerticalPadding: 5 + property bool keyboardDown: false + + implicitHeight: rowLayout.implicitHeight + root.buttonVerticalPadding * 2 + implicitWidth: rowLayout.implicitWidth + root.buttonHorizontalPadding * 2 + buttonRadius: Appearance.rounding.normal + colBackground: (root.down || root.keyboardDown) ? Appearance.colors.colSecondaryContainerActive : + ((root.hovered || root.focus) ? Appearance.colors.colSecondaryContainerHover : + ColorUtils.transparentize(Appearance.colors.colSecondaryContainer, 1)) + colBackgroundHover: Appearance.colors.colSecondaryContainerHover + colRipple: Appearance.colors.colSecondaryContainerActive property string highlightPrefix: `` property string highlightSuffix: `` @@ -69,20 +84,7 @@ RippleButton { return matches ? matches : []; } - visible: root.entryShown - property int horizontalMargin: 10 - property int buttonHorizontalPadding: 10 - property int buttonVerticalPadding: 5 - property bool keyboardDown: false - - implicitHeight: rowLayout.implicitHeight + root.buttonVerticalPadding * 2 - implicitWidth: rowLayout.implicitWidth + root.buttonHorizontalPadding * 2 - buttonRadius: Appearance.rounding.normal - colBackground: (root.down || root.keyboardDown) ? Appearance.colors.colLayer1Active : - ((root.hovered || root.focus) ? Appearance.colors.colLayer1Hover : - ColorUtils.transparentize(Appearance.colors.colSurfaceContainerHigh, 1)) - colBackgroundHover: Appearance.colors.colLayer1Hover - colRipple: Appearance.colors.colLayer1Active + PointingHandInteraction {} background { anchors.fill: root @@ -90,7 +92,6 @@ RippleButton { anchors.rightMargin: root.horizontalMargin } - PointingHandInteraction {} onClicked: { root.itemExecute() Hyprland.dispatch("global quickshell:overviewClose") diff --git a/.config/quickshell/modules/overview/SearchWidget.qml b/.config/quickshell/ii/modules/overview/SearchWidget.qml similarity index 74% rename from .config/quickshell/modules/overview/SearchWidget.qml rename to .config/quickshell/ii/modules/overview/SearchWidget.qml index 91998aa9c..2754567ea 100644 --- a/.config/quickshell/modules/overview/SearchWidget.qml +++ b/.config/quickshell/ii/modules/overview/SearchWidget.qml @@ -4,14 +4,11 @@ import "root:/modules/common" import "root:/modules/common/widgets" import "root:/modules/common/functions/string_utils.js" as StringUtils import Qt5Compat.GraphicalEffects -import Qt.labs.platform import QtQuick import QtQuick.Controls -import QtQuick.Effects import QtQuick.Layouts import Quickshell import Quickshell.Io -import Quickshell.Hyprland Item { // Wrapper id: root @@ -29,9 +26,9 @@ Item { // Wrapper } function cancelSearch() { - searchInput.selectAll() - root.searchingText = "" - searchWidthBehavior.enabled = true; + searchInput.selectAll(); + root.searchingText = ""; + searchWidthBehavior.enabled = true; } function setSearchingText(text) { @@ -40,42 +37,47 @@ Item { // Wrapper } property var searchActions: [ - { - action: "img", - execute: () => { - executor.executeCommand(Directories.wallpaperSwitchScriptPath) - } - }, { action: "dark", execute: () => { - executor.executeCommand(`${Directories.wallpaperSwitchScriptPath} --mode dark --noswitch`) + Quickshell.execDetached([Directories.wallpaperSwitchScriptPath, "--mode", "dark", "--noswitch"]); } }, { action: "light", execute: () => { - executor.executeCommand(`${Directories.wallpaperSwitchScriptPath} --mode light --noswitch`) + Quickshell.execDetached([Directories.wallpaperSwitchScriptPath, "--mode", "light", "--noswitch"]); + } + }, + { + action: "wall", + execute: () => { + Quickshell.execDetached([Directories.wallpaperSwitchScriptPath]); + } + }, + { + action: "konachanwall", + execute: () => { + Quickshell.execDetached([Quickshell.configPath("scripts/colors/random_konachan_wall.sh")]); } }, { action: "accentcolor", - execute: (args) => { - executor.executeCommand( - `${Directories.wallpaperSwitchScriptPath} --noswitch --color ${args != '' ? ("'"+args+"'") : ""}` - ) + execute: args => { + Quickshell.execDetached([Directories.wallpaperSwitchScriptPath, "--noswitch", "--color", ...(args != '' ? [`${args}`] : [])]); } }, { action: "todo", - execute: (args) => { - Todo.addTask(args) + execute: args => { + Todo.addTask(args); } }, ] function focusFirstItemIfNeeded() { - if (searchInput.focus) appResults.currentIndex = 0; // Focus the first item + if (searchInput.focus) + appResults.currentIndex = 0; // Focus the first item } Timer { @@ -90,32 +92,22 @@ Item { // Wrapper id: mathProcess property list baseCommand: ["qalc", "-t"] function calculateExpression(expression) { - mathProcess.running = false - mathProcess.command = baseCommand.concat(expression) - mathProcess.running = true + mathProcess.running = false; + mathProcess.command = baseCommand.concat(expression); + mathProcess.running = true; } stdout: SplitParser { onRead: data => { - root.mathResult = data - root.focusFirstItemIfNeeded() + root.mathResult = data; + root.focusFirstItemIfNeeded(); } } } - Process { - id: executor - property list baseCommand: ["bash", "-c"] - function executeCommand(command) { - executor.command = baseCommand.concat( - `${command}` - ) - executor.startDetached() - } - } - - Keys.onPressed: (event) => { + Keys.onPressed: event => { // Prevent Esc and Backspace from registering - if (event.key === Qt.Key_Escape) return; + if (event.key === Qt.Key_Escape) + return; // Handle Backspace: focus and delete character if not focused if (event.key === Qt.Key_Backspace) { @@ -136,8 +128,7 @@ Item { // Wrapper } else { // Delete character before cursor if any if (searchInput.cursorPosition > 0) { - searchInput.text = searchInput.text.slice(0, searchInput.cursorPosition - 1) + - searchInput.text.slice(searchInput.cursorPosition); + searchInput.text = searchInput.text.slice(0, searchInput.cursorPosition - 1) + searchInput.text.slice(searchInput.cursorPosition); searchInput.cursorPosition -= 1; } } @@ -150,19 +141,12 @@ Item { // Wrapper } // Only handle visible printable characters (ignore control chars, arrows, etc.) - if ( - event.text && - event.text.length === 1 && - event.key !== Qt.Key_Enter && - event.key !== Qt.Key_Return && - event.text.charCodeAt(0) >= 0x20 // ignore control chars like Backspace, Tab, etc. - ) { + if (event.text && event.text.length === 1 && event.key !== Qt.Key_Enter && event.key !== Qt.Key_Return && event.text.charCodeAt(0) >= 0x20) // ignore control chars like Backspace, Tab, etc. + { if (!searchInput.activeFocus) { searchInput.forceActiveFocus(); // Insert the character at the cursor position - searchInput.text = searchInput.text.slice(0, searchInput.cursorPosition) + - event.text + - searchInput.text.slice(searchInput.cursorPosition); + searchInput.text = searchInput.text.slice(0, searchInput.cursorPosition) + event.text + searchInput.text.slice(searchInput.cursorPosition); searchInput.cursorPosition += 1; event.accepted = true; } @@ -258,7 +242,8 @@ Item { // Wrapper } } - Rectangle { // Separator + Rectangle { + // Separator visible: root.showResults Layout.fillWidth: true height: 1 @@ -275,10 +260,11 @@ Item { // Wrapper bottomMargin: 10 spacing: 2 KeyNavigation.up: searchBar - highlightMoveDuration : 100 + highlightMoveDuration: 100 onFocusChanged: { - if(focus) appResults.currentIndex = 1; + if (focus) + appResults.currentIndex = 1; } Connections { @@ -291,12 +277,15 @@ Item { // Wrapper model: ScriptModel { id: model - values: { // Search results are handled here + values: { + // Search results are handled here ////////////////// Skip? ////////////////// - if(root.searchingText == "") return []; + if (root.searchingText == "") + return []; ///////////// Special cases /////////////// - if (root.searchingText.startsWith(Config.options.search.prefix.clipboard)) { // Clipboard + if (root.searchingText.startsWith(Config.options.search.prefix.clipboard)) { + // Clipboard const searchString = root.searchingText.slice(Config.options.search.prefix.clipboard.length); return Cliphist.fuzzyQuery(searchString).map(entry => { return { @@ -305,14 +294,13 @@ Item { // Wrapper clickActionName: "", type: `#${entry.match(/^\s*(\S+)/)?.[1] || ""}`, execute: () => { - Quickshell.execDetached( - ["bash", "-c", `echo '${StringUtils.shellSingleQuoteEscape(entry)}' | cliphist decode | wl-copy`] - ); + Quickshell.execDetached(["bash", "-c", `echo '${StringUtils.shellSingleQuoteEscape(entry)}' | cliphist decode | wl-copy`]); } }; }).filter(Boolean); - } - if (root.searchingText.startsWith(Config.options.search.prefix.emojis)) { // Clipboard + } + if (root.searchingText.startsWith(Config.options.search.prefix.emojis)) { + // Clipboard const searchString = root.searchingText.slice(Config.options.search.prefix.emojis.length); return Emojis.fuzzyQuery(searchString).map(entry => { return { @@ -322,12 +310,11 @@ Item { // Wrapper clickActionName: "", type: "Emoji", execute: () => { - Quickshell.clipboardText = entry.match(/^\s*(\S+)/)?.[1] + Quickshell.clipboardText = entry.match(/^\s*(\S+)/)?.[1]; } }; }).filter(Boolean); - } - + } ////////////////// Init /////////////////// nonAppResultsTimer.restart(); @@ -340,7 +327,7 @@ Item { // Wrapper execute: () => { Quickshell.clipboardText = root.mathResult; } - } + }; const commandResultObject = { name: searchingText.replace("file://", ""), clickActionName: qsTr("Run"), @@ -348,38 +335,34 @@ Item { // Wrapper fontType: "monospace", materialSymbol: 'terminal', execute: () => { - executor.executeCommand(searchingText.startsWith('sudo') ? `${Config.options.apps.terminal} fish -C '${root.searchingText.replace("file://", "")}'` : root.searchingText.replace("file://", "")); + const cleanedCommand = root.searchingText.replace("file://", ""); + Quickshell.execDetached(["bash", "-c", searchingText.startsWith('sudo') ? `${Config.options.apps.terminal} fish -C '${cleanedCommand}'` : cleanedCommand]); } - } - const launcherActionObjects = root.searchActions - .map(action => { - const actionString = `${Config.options.search.prefix.action}${action.action}`; - if (actionString.startsWith(root.searchingText) || root.searchingText.startsWith(actionString)) { - return { - name: root.searchingText.startsWith(actionString) ? root.searchingText : actionString, - clickActionName: qsTr("Run"), - type: qsTr("Action"), - materialSymbol: 'settings_suggest', - execute: () => { - action.execute(root.searchingText.split(" ").slice(1).join(" ")) - }, - }; - } - return null; - }) - .filter(Boolean); + }; + const launcherActionObjects = root.searchActions.map(action => { + const actionString = `${Config.options.search.prefix.action}${action.action}`; + if (actionString.startsWith(root.searchingText) || root.searchingText.startsWith(actionString)) { + return { + name: root.searchingText.startsWith(actionString) ? root.searchingText : actionString, + clickActionName: qsTr("Run"), + type: qsTr("Action"), + materialSymbol: 'settings_suggest', + execute: () => { + action.execute(root.searchingText.split(" ").slice(1).join(" ")); + } + }; + } + return null; + }).filter(Boolean); let result = []; //////////////// Apps ////////////////// - result = result.concat( - AppSearch.fuzzyQuery(root.searchingText) - .map((entry) => { - entry.clickActionName = qsTr("Launch"); - entry.type = qsTr("App"); - return entry; - }) - ); + result = result.concat(AppSearch.fuzzyQuery(root.searchingText).map(entry => { + entry.clickActionName = qsTr("Launch"); + entry.type = qsTr("App"); + return entry; + })); ////////// Launcher actions //////////// result = result.concat(launcherActionObjects); @@ -401,7 +384,7 @@ Item { // Wrapper type: qsTr("Search the web"), materialSymbol: 'travel_explore', execute: () => { - let url = Config.options.search.engineBaseUrl + root.searchingText + let url = Config.options.search.engineBaseUrl + root.searchingText; for (let site of Config.options.search.excludedSites) { url += ` -site:${site}`; } @@ -413,17 +396,15 @@ Item { // Wrapper } } - delegate: SearchItem { // The selectable item for each search result + delegate: SearchItem { + // The selectable item for each search result required property var modelData anchors.left: parent?.left anchors.right: parent?.right entry: modelData - query: root.searchingText.startsWith(Config.options.search.prefix.clipboard) ? - root.searchingText.slice(Config.options.search.prefix.clipboard.length) : - root.searchingText; + query: root.searchingText.startsWith(Config.options.search.prefix.clipboard) ? root.searchingText.slice(Config.options.search.prefix.clipboard.length) : root.searchingText } } - } } -} \ No newline at end of file +} diff --git a/.config/quickshell/modules/screenCorners/ScreenCorners.qml b/.config/quickshell/ii/modules/screenCorners/ScreenCorners.qml similarity index 83% rename from .config/quickshell/modules/screenCorners/ScreenCorners.qml rename to .config/quickshell/ii/modules/screenCorners/ScreenCorners.qml index de2130027..0946c03d1 100644 --- a/.config/quickshell/modules/screenCorners/ScreenCorners.qml +++ b/.config/quickshell/ii/modules/screenCorners/ScreenCorners.qml @@ -26,20 +26,20 @@ Scope { mask: Region { item: null } - HyprlandWindow.visibleMask: Region { - Region { - item: topLeftCorner - } - Region { - item: topRightCorner - } - Region { - item: bottomLeftCorner - } - Region { - item: bottomRightCorner - } - } + // HyprlandWindow.visibleMask: Region { + // Region { + // item: topLeftCorner + // } + // Region { + // item: topRightCorner + // } + // Region { + // item: bottomLeftCorner + // } + // Region { + // item: bottomRightCorner + // } + // } WlrLayershell.namespace: "quickshell:screenCorners" WlrLayershell.layer: WlrLayer.Overlay color: "transparent" diff --git a/.config/quickshell/modules/session/Session.qml b/.config/quickshell/ii/modules/session/Session.qml similarity index 100% rename from .config/quickshell/modules/session/Session.qml rename to .config/quickshell/ii/modules/session/Session.qml diff --git a/.config/quickshell/modules/session/SessionActionButton.qml b/.config/quickshell/ii/modules/session/SessionActionButton.qml similarity index 100% rename from .config/quickshell/modules/session/SessionActionButton.qml rename to .config/quickshell/ii/modules/session/SessionActionButton.qml diff --git a/.config/quickshell/modules/settings/About.qml b/.config/quickshell/ii/modules/settings/About.qml similarity index 100% rename from .config/quickshell/modules/settings/About.qml rename to .config/quickshell/ii/modules/settings/About.qml 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/modules/settings/InterfaceConfig.qml b/.config/quickshell/ii/modules/settings/InterfaceConfig.qml similarity index 89% rename from .config/quickshell/modules/settings/InterfaceConfig.qml rename to .config/quickshell/ii/modules/settings/InterfaceConfig.qml index 29fd21d11..2d692442c 100644 --- a/.config/quickshell/modules/settings/InterfaceConfig.qml +++ b/.config/quickshell/ii/modules/settings/InterfaceConfig.qml @@ -212,6 +212,17 @@ ContentPage { } } } + + ContentSubsection { + title: "Weather" + ConfigSwitch { + text: "Enable" + checked: Config.options.bar.weather.enable + onCheckedChanged: { + Config.options.bar.weather.enable = checked; + } + } + } } ContentSection { @@ -295,6 +306,20 @@ ContentPage { } } + ContentSection { + title: "On-screen display" + ConfigSpinBox { + text: "Timeout (ms)" + value: Config.options.osd.timeout + from: 100 + to: 3000 + stepSize: 100 + onValueChanged: { + Config.options.osd.timeout = value; + } + } + } + ContentSection { title: "Overview" ConfigSpinBox { @@ -331,4 +356,19 @@ ContentPage { } } } + + ContentSection { + title: "Screenshot tool" + + ConfigSwitch { + text: 'Show regions of potential interest' + checked: Config.options.screenshotTool.showContentRegions + onCheckedChanged: { + Config.options.screenshotTool.showContentRegions = checked; + } + StyledToolTip { + content: "Such regions could be images or parts of the screen that have some containment.\nMight not always be accurate.\nThis is done with an image processing algorithm run locally and no AI is used." + } + } + } } diff --git a/.config/quickshell/modules/settings/ServicesConfig.qml b/.config/quickshell/ii/modules/settings/ServicesConfig.qml similarity index 58% rename from .config/quickshell/modules/settings/ServicesConfig.qml rename to .config/quickshell/ii/modules/settings/ServicesConfig.qml index 97d80a18a..a9e34512b 100644 --- a/.config/quickshell/modules/settings/ServicesConfig.qml +++ b/.config/quickshell/ii/modules/settings/ServicesConfig.qml @@ -139,12 +139,94 @@ ContentPage { } ContentSection { - title: "Weather" + title: "Search" + ConfigSwitch { - text: "enable" - checked: Config.options.bar.weather.enable + text: "Use Levenshtein distance-based algorithm instead of fuzzy" + checked: Config.options.search.sloppy onCheckedChanged: { - Config.options.bar.weather.enable = checked; + Config.options.search.sloppy = checked; + } + StyledToolTip { + content: "Could be better if you make a ton of typos,\nbut results can be weird and might not work with acronyms\n(e.g. \"GIMP\" might not give you the paint program)" + } + } + + ContentSubsection { + title: "Prefixes" + ConfigRow { + uniform: true + + MaterialTextField { + Layout.fillWidth: true + placeholderText: "Action" + text: Config.options.search.prefix.action + wrapMode: TextEdit.Wrap + onTextChanged: { + Config.options.search.prefix.action = text; + } + } + MaterialTextField { + Layout.fillWidth: true + placeholderText: "Clipboard" + text: Config.options.search.prefix.clipboard + wrapMode: TextEdit.Wrap + onTextChanged: { + Config.options.search.prefix.clipboard = text; + } + } + MaterialTextField { + Layout.fillWidth: true + placeholderText: "Emojis" + text: Config.options.search.prefix.emojis + wrapMode: TextEdit.Wrap + onTextChanged: { + Config.options.search.prefix.emojis = text; + } + } + } + } + ContentSubsection { + title: "Web search" + MaterialTextField { + Layout.fillWidth: true + placeholderText: "Base URL" + text: Config.options.search.engineBaseUrl + wrapMode: TextEdit.Wrap + onTextChanged: { + Config.options.search.engineBaseUrl = text; + } + } + } + } + + ContentSection { + title: "Time" + + ContentSubsection { + title: "Format" + tooltip: "" + + ConfigSelectionArray { + currentValue: Config.options.time.format + configOptionName: "time.format" + onSelected: newValue => { + Config.options.time.format = newValue; + } + options: [ + { + displayName: "24h", + value: "hh:mm" + }, + { + displayName: "12h am/pm", + value: "h:mm ap" + }, + { + displayName: "12h AM/PM", + value: "h:mm AP" + }, + ] } } } diff --git a/.config/quickshell/modules/settings/StyleConfig.qml b/.config/quickshell/ii/modules/settings/StyleConfig.qml similarity index 97% rename from .config/quickshell/modules/settings/StyleConfig.qml rename to .config/quickshell/ii/modules/settings/StyleConfig.qml index b86c0daa2..bc1998c81 100644 --- a/.config/quickshell/modules/settings/StyleConfig.qml +++ b/.config/quickshell/ii/modules/settings/StyleConfig.qml @@ -18,7 +18,7 @@ ContentPage { Process { id: konachanWallProc property string status: "" - command: ["bash", "-c", FileUtils.trimFileProtocol(`${Directories.config}/quickshell/scripts/colors/random_konachan_wall.sh`)] + command: ["bash", "-c", FileUtils.trimFileProtocol(`${Directories.scriptPath}/colors/random_konachan_wall.sh`)] stdout: SplitParser { onRead: data => { console.log(`Konachan wall proc output: ${data}`); @@ -50,6 +50,7 @@ ContentPage { configOptionName: "appearance.palette.type" onSelected: (newValue) => { Config.options.appearance.palette.type = newValue; + Quickshell.execDetached(["bash", "-c", `${Directories.wallpaperSwitchScriptPath} --noswitch`]) } options: [ {"value": "auto", "displayName": "Auto"}, diff --git a/.config/quickshell/modules/sidebarLeft/AiChat.qml b/.config/quickshell/ii/modules/sidebarLeft/AiChat.qml similarity index 85% rename from .config/quickshell/modules/sidebarLeft/AiChat.qml rename to .config/quickshell/ii/modules/sidebarLeft/AiChat.qml index db5d66828..6c4e65f97 100644 --- a/.config/quickshell/modules/sidebarLeft/AiChat.qml +++ b/.config/quickshell/ii/modules/sidebarLeft/AiChat.qml @@ -71,6 +71,30 @@ Item { } } }, + { + name: "save", + description: qsTr("Save chat"), + execute: (args) => { + const joinedArgs = args.join(" ") + if (joinedArgs.trim().length == 0) { + Ai.addMessage(`Usage: ${root.commandPrefix}save CHAT_NAME`, Ai.interfaceRole); + return; + } + Ai.saveChat(joinedArgs) + } + }, + { + name: "load", + description: qsTr("Load chat"), + execute: (args) => { + const joinedArgs = args.join(" ") + if (joinedArgs.trim().length == 0) { + Ai.addMessage(`Usage: ${root.commandPrefix}load CHAT_NAME`, Ai.interfaceRole); + return; + } + Ai.loadChat(joinedArgs) + } + }, { name: "clear", description: qsTr("Clear chat history"), @@ -105,7 +129,7 @@ Mowe uwu wem ipsum! ### Formatting - *Italic*, \`Monospace\`, **Bold**, [Link](https://example.com) -- Arch lincox icon +- Arch lincox icon ### Table @@ -358,11 +382,11 @@ Inline w/ backslash and round brackets \\(e^{i\\pi} + 1 = 0\\) background: null onTextChanged: { // Handle suggestions - if(messageInputField.text.length === 0) { + if (messageInputField.text.length === 0) { root.suggestionQuery = "" root.suggestionList = [] return - } else if(messageInputField.text.startsWith(`${root.commandPrefix}model`)) { + } else if (messageInputField.text.startsWith(`${root.commandPrefix}model`)) { root.suggestionQuery = messageInputField.text.split(" ")[1] ?? "" const modelResults = Fuzzy.go(root.suggestionQuery, Ai.modelList.map(model => { return { @@ -380,7 +404,7 @@ Inline w/ backslash and round brackets \\(e^{i\\pi} + 1 = 0\\) description: `${Ai.models[model.target].description}`, } }) - } else if(messageInputField.text.startsWith(`${root.commandPrefix}prompt`)) { + } else if (messageInputField.text.startsWith(`${root.commandPrefix}prompt`)) { root.suggestionQuery = messageInputField.text.split(" ")[1] ?? "" const promptFileResults = Fuzzy.go(root.suggestionQuery, Ai.promptFiles.map(file => { return { @@ -398,6 +422,44 @@ Inline w/ backslash and round brackets \\(e^{i\\pi} + 1 = 0\\) description: `Load prompt from ${file.target}`, } }) + } else if (messageInputField.text.startsWith(`${root.commandPrefix}save`)) { + root.suggestionQuery = messageInputField.text.split(" ")[1] ?? "" + const promptFileResults = Fuzzy.go(root.suggestionQuery, Ai.savedChats.map(file => { + return { + name: Fuzzy.prepare(file), + obj: file, + } + }), { + all: true, + key: "name" + }) + root.suggestionList = promptFileResults.map(file => { + const chatName = FileUtils.trimFileExt(FileUtils.fileNameForPath(file.target)).trim() + return { + name: `${messageInputField.text.trim().split(" ").length == 1 ? (root.commandPrefix + "save ") : ""}${chatName}`, + displayName: `${chatName}`, + description: `Save chat from ${chatName}`, + } + }) + } else if (messageInputField.text.startsWith(`${root.commandPrefix}load`)) { + root.suggestionQuery = messageInputField.text.split(" ")[1] ?? "" + const promptFileResults = Fuzzy.go(root.suggestionQuery, Ai.savedChats.map(file => { + return { + name: Fuzzy.prepare(file), + obj: file, + } + }), { + all: true, + key: "name" + }) + root.suggestionList = promptFileResults.map(file => { + const chatName = FileUtils.trimFileExt(FileUtils.fileNameForPath(file.target)).trim() + return { + name: `${messageInputField.text.trim().split(" ").length == 1 ? (root.commandPrefix + "load ") : ""}${chatName}`, + displayName: `${chatName}`, + description: `Load chat from ${file.target}`, + } + }) } else if(messageInputField.text.startsWith(root.commandPrefix)) { root.suggestionQuery = messageInputField.text root.suggestionList = root.allCommands.filter(cmd => cmd.name.startsWith(messageInputField.text.substring(1))).map(cmd => { diff --git a/.config/quickshell/modules/sidebarLeft/Anime.qml b/.config/quickshell/ii/modules/sidebarLeft/Anime.qml similarity index 100% rename from .config/quickshell/modules/sidebarLeft/Anime.qml rename to .config/quickshell/ii/modules/sidebarLeft/Anime.qml diff --git a/.config/quickshell/modules/sidebarLeft/ApiCommandButton.qml b/.config/quickshell/ii/modules/sidebarLeft/ApiCommandButton.qml similarity index 100% rename from .config/quickshell/modules/sidebarLeft/ApiCommandButton.qml rename to .config/quickshell/ii/modules/sidebarLeft/ApiCommandButton.qml diff --git a/.config/quickshell/modules/sidebarLeft/DescriptionBox.qml b/.config/quickshell/ii/modules/sidebarLeft/DescriptionBox.qml similarity index 100% rename from .config/quickshell/modules/sidebarLeft/DescriptionBox.qml rename to .config/quickshell/ii/modules/sidebarLeft/DescriptionBox.qml diff --git a/.config/quickshell/modules/sidebarLeft/SidebarLeft.qml b/.config/quickshell/ii/modules/sidebarLeft/SidebarLeft.qml similarity index 100% rename from .config/quickshell/modules/sidebarLeft/SidebarLeft.qml rename to .config/quickshell/ii/modules/sidebarLeft/SidebarLeft.qml diff --git a/.config/quickshell/modules/sidebarLeft/SidebarLeftContent.qml b/.config/quickshell/ii/modules/sidebarLeft/SidebarLeftContent.qml similarity index 100% rename from .config/quickshell/modules/sidebarLeft/SidebarLeftContent.qml rename to .config/quickshell/ii/modules/sidebarLeft/SidebarLeftContent.qml diff --git a/.config/quickshell/modules/sidebarLeft/Translator.qml b/.config/quickshell/ii/modules/sidebarLeft/Translator.qml similarity index 100% rename from .config/quickshell/modules/sidebarLeft/Translator.qml rename to .config/quickshell/ii/modules/sidebarLeft/Translator.qml diff --git a/.config/quickshell/modules/sidebarLeft/aiChat/AiMessage.qml b/.config/quickshell/ii/modules/sidebarLeft/aiChat/AiMessage.qml similarity index 98% rename from .config/quickshell/modules/sidebarLeft/aiChat/AiMessage.qml rename to .config/quickshell/ii/modules/sidebarLeft/aiChat/AiMessage.qml index 3e5b96d3d..a483dd8a8 100644 --- a/.config/quickshell/modules/sidebarLeft/aiChat/AiMessage.qml +++ b/.config/quickshell/ii/modules/sidebarLeft/aiChat/AiMessage.qml @@ -121,11 +121,8 @@ Rectangle { height: Appearance.font.pixelSize.large source: messageData?.role == 'assistant' ? Ai.models[messageData?.model].icon : messageData?.role == 'user' ? 'linux-symbolic' : 'desktop-symbolic' - } - ColorOverlay { - visible: modelIcon.visible - anchors.fill: modelIcon - source: modelIcon + + colorize: true color: Appearance.m3colors.m3onSecondaryContainer } diff --git a/.config/quickshell/modules/sidebarLeft/aiChat/AiMessageControlButton.qml b/.config/quickshell/ii/modules/sidebarLeft/aiChat/AiMessageControlButton.qml similarity index 100% rename from .config/quickshell/modules/sidebarLeft/aiChat/AiMessageControlButton.qml rename to .config/quickshell/ii/modules/sidebarLeft/aiChat/AiMessageControlButton.qml diff --git a/.config/quickshell/modules/sidebarLeft/aiChat/AnnotationSourceButton.qml b/.config/quickshell/ii/modules/sidebarLeft/aiChat/AnnotationSourceButton.qml similarity index 100% rename from .config/quickshell/modules/sidebarLeft/aiChat/AnnotationSourceButton.qml rename to .config/quickshell/ii/modules/sidebarLeft/aiChat/AnnotationSourceButton.qml diff --git a/.config/quickshell/modules/sidebarLeft/aiChat/MessageCodeBlock.qml b/.config/quickshell/ii/modules/sidebarLeft/aiChat/MessageCodeBlock.qml similarity index 100% rename from .config/quickshell/modules/sidebarLeft/aiChat/MessageCodeBlock.qml rename to .config/quickshell/ii/modules/sidebarLeft/aiChat/MessageCodeBlock.qml diff --git a/.config/quickshell/modules/sidebarLeft/aiChat/MessageTextBlock.qml b/.config/quickshell/ii/modules/sidebarLeft/aiChat/MessageTextBlock.qml similarity index 100% rename from .config/quickshell/modules/sidebarLeft/aiChat/MessageTextBlock.qml rename to .config/quickshell/ii/modules/sidebarLeft/aiChat/MessageTextBlock.qml diff --git a/.config/quickshell/modules/sidebarLeft/aiChat/MessageThinkBlock.qml b/.config/quickshell/ii/modules/sidebarLeft/aiChat/MessageThinkBlock.qml similarity index 100% rename from .config/quickshell/modules/sidebarLeft/aiChat/MessageThinkBlock.qml rename to .config/quickshell/ii/modules/sidebarLeft/aiChat/MessageThinkBlock.qml diff --git a/.config/quickshell/modules/sidebarLeft/anime/BooruImage.qml b/.config/quickshell/ii/modules/sidebarLeft/anime/BooruImage.qml similarity index 100% rename from .config/quickshell/modules/sidebarLeft/anime/BooruImage.qml rename to .config/quickshell/ii/modules/sidebarLeft/anime/BooruImage.qml diff --git a/.config/quickshell/modules/sidebarLeft/anime/BooruResponse.qml b/.config/quickshell/ii/modules/sidebarLeft/anime/BooruResponse.qml similarity index 100% rename from .config/quickshell/modules/sidebarLeft/anime/BooruResponse.qml rename to .config/quickshell/ii/modules/sidebarLeft/anime/BooruResponse.qml diff --git a/.config/quickshell/modules/sidebarLeft/translator/LanguageSelectorButton.qml b/.config/quickshell/ii/modules/sidebarLeft/translator/LanguageSelectorButton.qml similarity index 100% rename from .config/quickshell/modules/sidebarLeft/translator/LanguageSelectorButton.qml rename to .config/quickshell/ii/modules/sidebarLeft/translator/LanguageSelectorButton.qml diff --git a/.config/quickshell/modules/sidebarLeft/translator/TextCanvas.qml b/.config/quickshell/ii/modules/sidebarLeft/translator/TextCanvas.qml similarity index 100% rename from .config/quickshell/modules/sidebarLeft/translator/TextCanvas.qml rename to .config/quickshell/ii/modules/sidebarLeft/translator/TextCanvas.qml diff --git a/.config/quickshell/modules/sidebarRight/BottomWidgetGroup.qml b/.config/quickshell/ii/modules/sidebarRight/BottomWidgetGroup.qml similarity index 100% rename from .config/quickshell/modules/sidebarRight/BottomWidgetGroup.qml rename to .config/quickshell/ii/modules/sidebarRight/BottomWidgetGroup.qml diff --git a/.config/quickshell/modules/sidebarRight/CenterWidgetGroup.qml b/.config/quickshell/ii/modules/sidebarRight/CenterWidgetGroup.qml similarity index 100% rename from .config/quickshell/modules/sidebarRight/CenterWidgetGroup.qml rename to .config/quickshell/ii/modules/sidebarRight/CenterWidgetGroup.qml diff --git a/.config/quickshell/modules/sidebarRight/SidebarRight.qml b/.config/quickshell/ii/modules/sidebarRight/SidebarRight.qml similarity index 98% rename from .config/quickshell/modules/sidebarRight/SidebarRight.qml rename to .config/quickshell/ii/modules/sidebarRight/SidebarRight.qml index 376687af3..ead2ff2aa 100644 --- a/.config/quickshell/modules/sidebarRight/SidebarRight.qml +++ b/.config/quickshell/ii/modules/sidebarRight/SidebarRight.qml @@ -20,7 +20,7 @@ Scope { id: root property int sidebarWidth: Appearance.sizes.sidebarWidth property int sidebarPadding: 15 - property string settingsQmlPath: FileUtils.trimFileProtocol(`${Directories.config}/quickshell/settings.qml`) + property string settingsQmlPath: Quickshell.configPath("settings.qml") PanelWindow { id: sidebarRoot @@ -179,6 +179,7 @@ Scope { NightLight {} GameMode {} IdleInhibitor {} + CloudflareWarp {} } // Center widget group diff --git a/.config/quickshell/modules/sidebarRight/calendar/CalendarDayButton.qml b/.config/quickshell/ii/modules/sidebarRight/calendar/CalendarDayButton.qml similarity index 100% rename from .config/quickshell/modules/sidebarRight/calendar/CalendarDayButton.qml rename to .config/quickshell/ii/modules/sidebarRight/calendar/CalendarDayButton.qml diff --git a/.config/quickshell/modules/sidebarRight/calendar/CalendarHeaderButton.qml b/.config/quickshell/ii/modules/sidebarRight/calendar/CalendarHeaderButton.qml similarity index 100% rename from .config/quickshell/modules/sidebarRight/calendar/CalendarHeaderButton.qml rename to .config/quickshell/ii/modules/sidebarRight/calendar/CalendarHeaderButton.qml diff --git a/.config/quickshell/modules/sidebarRight/calendar/CalendarWidget.qml b/.config/quickshell/ii/modules/sidebarRight/calendar/CalendarWidget.qml similarity index 100% rename from .config/quickshell/modules/sidebarRight/calendar/CalendarWidget.qml rename to .config/quickshell/ii/modules/sidebarRight/calendar/CalendarWidget.qml diff --git a/.config/quickshell/modules/sidebarRight/calendar/calendar_layout.js b/.config/quickshell/ii/modules/sidebarRight/calendar/calendar_layout.js similarity index 100% rename from .config/quickshell/modules/sidebarRight/calendar/calendar_layout.js rename to .config/quickshell/ii/modules/sidebarRight/calendar/calendar_layout.js diff --git a/.config/quickshell/modules/sidebarRight/notifications/NotificationList.qml b/.config/quickshell/ii/modules/sidebarRight/notifications/NotificationList.qml similarity index 100% rename from .config/quickshell/modules/sidebarRight/notifications/NotificationList.qml rename to .config/quickshell/ii/modules/sidebarRight/notifications/NotificationList.qml diff --git a/.config/quickshell/modules/sidebarRight/notifications/NotificationStatusButton.qml b/.config/quickshell/ii/modules/sidebarRight/notifications/NotificationStatusButton.qml similarity index 100% rename from .config/quickshell/modules/sidebarRight/notifications/NotificationStatusButton.qml rename to .config/quickshell/ii/modules/sidebarRight/notifications/NotificationStatusButton.qml diff --git a/.config/quickshell/modules/sidebarRight/quickToggles/BluetoothToggle.qml b/.config/quickshell/ii/modules/sidebarRight/quickToggles/BluetoothToggle.qml similarity index 100% rename from .config/quickshell/modules/sidebarRight/quickToggles/BluetoothToggle.qml rename to .config/quickshell/ii/modules/sidebarRight/quickToggles/BluetoothToggle.qml diff --git a/.config/quickshell/ii/modules/sidebarRight/quickToggles/CloudflareWarp.qml b/.config/quickshell/ii/modules/sidebarRight/quickToggles/CloudflareWarp.qml new file mode 100644 index 000000000..cdaf84b76 --- /dev/null +++ b/.config/quickshell/ii/modules/sidebarRight/quickToggles/CloudflareWarp.qml @@ -0,0 +1,85 @@ +import "root:/modules/common" +import "root:/modules/common/widgets" +import "../" +import QtQuick +import Quickshell.Io +import Quickshell +import Quickshell.Hyprland + +QuickToggleButton { + id: root + toggled: false + visible: false + + contentItem: CustomIcon { + id: distroIcon + source: 'cloudflare-dns-symbolic' + + anchors.centerIn: parent + height: 16 + colorize: true + color: root.toggled ? Appearance.m3colors.m3onPrimary : Appearance.colors.colOnLayer1 + + Behavior on color { + animation: Appearance.animation.elementMoveFast.colorAnimation.createObject(this) + } + } + + onClicked: { + if (toggled) { + root.toggled = false + Quickshell.execDetached(["warp-cli", "disconnect"]) + } else { + root.toggled = true + Quickshell.execDetached(["warp-cli", "connect"]) + } + } + + Process { + id: connectProc + command: ["warp-cli", "connect"] + onExited: (exitCode, exitStatus) => { + if (exitCode !== 0) { + Quickshell.execDetached(["notify-send", "Cloudflare WARP", "Connection failed. Please inspect manually with the warp-cli command", "-a", "Shell"]) + } + } + } + + Process { + id: registrationProc + command: ["warp-cli", "registration", "new"] + onExited: (exitCode, exitStatus) => { + console.log("Warp registration exited with code and status:", exitCode, exitStatus) + if (exitCode === 0) { + connectProc.running = true + } else { + Quickshell.execDetached(["notify-send", "Cloudflare WARP", "Registration failed. Please inspect manually with the warp-cli command", "-a", "Shell"]) + } + } + } + + Process { + id: fetchActiveState + running: true + command: ["bash", "-c", "warp-cli status"] + stdout: StdioCollector { + id: warpStatusCollector + onStreamFinished: { + if (warpStatusCollector.text.length > 0) { + console.log("Showing warp") + root.visible = true + } + if (warpStatusCollector.text.includes("Unable")) { + registrationProc.running = true + } else if (warpStatusCollector.text.includes("Connected")) { + root.toggled = true + } else if (warpStatusCollector.text.includes("Disconnected")) { + root.toggled = false + } + } + } + } + StyledToolTip { + content: qsTr("Cloudflare WARP (1.1.1.1)") + } +} diff --git a/.config/quickshell/modules/sidebarRight/quickToggles/GameMode.qml b/.config/quickshell/ii/modules/sidebarRight/quickToggles/GameMode.qml similarity index 100% rename from .config/quickshell/modules/sidebarRight/quickToggles/GameMode.qml rename to .config/quickshell/ii/modules/sidebarRight/quickToggles/GameMode.qml diff --git a/.config/quickshell/modules/sidebarRight/quickToggles/IdleInhibitor.qml b/.config/quickshell/ii/modules/sidebarRight/quickToggles/IdleInhibitor.qml similarity index 75% rename from .config/quickshell/modules/sidebarRight/quickToggles/IdleInhibitor.qml rename to .config/quickshell/ii/modules/sidebarRight/quickToggles/IdleInhibitor.qml index b48d3467f..b4b0401ea 100644 --- a/.config/quickshell/modules/sidebarRight/quickToggles/IdleInhibitor.qml +++ b/.config/quickshell/ii/modules/sidebarRight/quickToggles/IdleInhibitor.qml @@ -12,10 +12,10 @@ QuickToggleButton { onClicked: { if (toggled) { root.toggled = false - Hyprland.dispatch("exec pkill wayland-idle") // pkill doesn't accept too long names + Quickshell.execDetached(["pkill", "wayland-idle"]) // pkill doesn't accept too long names } else { root.toggled = true - Hyprland.dispatch('exec ${XDG_CONFIG_HOME:-$HOME/.config}/quickshell/scripts/wayland-idle-inhibitor.py') + Quickshell.execDetached([`${Directories.scriptPath}/wayland-idle-inhibitor.py`]) } } Process { diff --git a/.config/quickshell/modules/sidebarRight/quickToggles/NetworkToggle.qml b/.config/quickshell/ii/modules/sidebarRight/quickToggles/NetworkToggle.qml similarity index 100% rename from .config/quickshell/modules/sidebarRight/quickToggles/NetworkToggle.qml rename to .config/quickshell/ii/modules/sidebarRight/quickToggles/NetworkToggle.qml diff --git a/.config/quickshell/modules/sidebarRight/quickToggles/NightLight.qml b/.config/quickshell/ii/modules/sidebarRight/quickToggles/NightLight.qml similarity index 100% rename from .config/quickshell/modules/sidebarRight/quickToggles/NightLight.qml rename to .config/quickshell/ii/modules/sidebarRight/quickToggles/NightLight.qml diff --git a/.config/quickshell/modules/sidebarRight/quickToggles/QuickToggleButton.qml b/.config/quickshell/ii/modules/sidebarRight/quickToggles/QuickToggleButton.qml similarity index 100% rename from .config/quickshell/modules/sidebarRight/quickToggles/QuickToggleButton.qml rename to .config/quickshell/ii/modules/sidebarRight/quickToggles/QuickToggleButton.qml diff --git a/.config/quickshell/modules/sidebarRight/todo/TaskList.qml b/.config/quickshell/ii/modules/sidebarRight/todo/TaskList.qml similarity index 100% rename from .config/quickshell/modules/sidebarRight/todo/TaskList.qml rename to .config/quickshell/ii/modules/sidebarRight/todo/TaskList.qml diff --git a/.config/quickshell/modules/sidebarRight/todo/TodoItemActionButton.qml b/.config/quickshell/ii/modules/sidebarRight/todo/TodoItemActionButton.qml similarity index 100% rename from .config/quickshell/modules/sidebarRight/todo/TodoItemActionButton.qml rename to .config/quickshell/ii/modules/sidebarRight/todo/TodoItemActionButton.qml diff --git a/.config/quickshell/modules/sidebarRight/todo/TodoWidget.qml b/.config/quickshell/ii/modules/sidebarRight/todo/TodoWidget.qml similarity index 100% rename from .config/quickshell/modules/sidebarRight/todo/TodoWidget.qml rename to .config/quickshell/ii/modules/sidebarRight/todo/TodoWidget.qml diff --git a/.config/quickshell/modules/sidebarRight/volumeMixer/AudioDeviceSelectorButton.qml b/.config/quickshell/ii/modules/sidebarRight/volumeMixer/AudioDeviceSelectorButton.qml similarity index 100% rename from .config/quickshell/modules/sidebarRight/volumeMixer/AudioDeviceSelectorButton.qml rename to .config/quickshell/ii/modules/sidebarRight/volumeMixer/AudioDeviceSelectorButton.qml diff --git a/.config/quickshell/modules/sidebarRight/volumeMixer/VolumeMixer.qml b/.config/quickshell/ii/modules/sidebarRight/volumeMixer/VolumeMixer.qml similarity index 100% rename from .config/quickshell/modules/sidebarRight/volumeMixer/VolumeMixer.qml rename to .config/quickshell/ii/modules/sidebarRight/volumeMixer/VolumeMixer.qml diff --git a/.config/quickshell/ii/modules/sidebarRight/volumeMixer/VolumeMixerEntry.qml b/.config/quickshell/ii/modules/sidebarRight/volumeMixer/VolumeMixerEntry.qml new file mode 100644 index 000000000..84cb572c8 --- /dev/null +++ b/.config/quickshell/ii/modules/sidebarRight/volumeMixer/VolumeMixerEntry.qml @@ -0,0 +1,66 @@ +import "root:/modules/common" +import "root:/modules/common/widgets" +import "root:/services" +import Qt5Compat.GraphicalEffects +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts +import Quickshell +import Quickshell.Widgets +import Quickshell.Services.Pipewire + +Item { + id: root + required property PwNode node + PwObjectTracker { + objects: [node] + } + + implicitHeight: rowLayout.implicitHeight + + RowLayout { + id: rowLayout + anchors.fill: parent + 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: -4 + + 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; + } + } + + StyledSlider { + id: slider + value: root.node.audio.volume + onValueChanged: root.node.audio.volume = value + } + } + } +} diff --git a/.config/quickshell/screenshot.qml b/.config/quickshell/ii/screenshot.qml similarity index 99% rename from .config/quickshell/screenshot.qml rename to .config/quickshell/ii/screenshot.qml index 3368b6b77..f15558719 100644 --- a/.config/quickshell/screenshot.qml +++ b/.config/quickshell/ii/screenshot.qml @@ -22,7 +22,7 @@ import "./services/" ShellRoot { id: root - property string screenshotDir: "/tmp/quickshell/media/screenshot" + property string screenshotDir: Directories.screenshotTemp property color overlayColor: "#77111111" property color genericContentColor: Qt.alpha(root.overlayColor, 0.9) property color genericContentForeground: "#ddffffff" @@ -81,6 +81,7 @@ ShellRoot { Loader { id: regionIconLoader active: regionRect.showIcon + visible: active sourceComponent: IconImage { implicitSize: Appearance.font.pixelSize.larger source: Quickshell.iconPath(AppSearch.guessIcon(regionRect.text), "image-missing") @@ -517,7 +518,7 @@ ShellRoot { // Image regions Repeater { model: ScriptModel { - values: panelWindow.imageRegions + values: Config.options.screenshotTool.showContentRegions ? panelWindow.imageRegions : [] } delegate: TargetRegion { z: 4 diff --git a/.config/quickshell/scripts/ai/show-installed-ollama-models.sh b/.config/quickshell/ii/scripts/ai/show-installed-ollama-models.sh similarity index 100% rename from .config/quickshell/scripts/ai/show-installed-ollama-models.sh rename to .config/quickshell/ii/scripts/ai/show-installed-ollama-models.sh diff --git a/.config/quickshell/scripts/cava/raw_output_config.txt b/.config/quickshell/ii/scripts/cava/raw_output_config.txt similarity index 100% rename from .config/quickshell/scripts/cava/raw_output_config.txt rename to .config/quickshell/ii/scripts/cava/raw_output_config.txt diff --git a/.config/quickshell/scripts/colors/applycolor.sh b/.config/quickshell/ii/scripts/colors/applycolor.sh similarity index 71% rename from .config/quickshell/scripts/colors/applycolor.sh rename to .config/quickshell/ii/scripts/colors/applycolor.sh index b36fc4d25..ddb93bd20 100755 --- a/.config/quickshell/scripts/colors/applycolor.sh +++ b/.config/quickshell/ii/scripts/colors/applycolor.sh @@ -1,9 +1,10 @@ #!/usr/bin/env bash +QUICKSHELL_CONFIG_NAME="ii" XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}" XDG_CACHE_HOME="${XDG_CACHE_HOME:-$HOME/.cache}" XDG_STATE_HOME="${XDG_STATE_HOME:-$HOME/.local/state}" -CONFIG_DIR="$XDG_CONFIG_HOME/quickshell" +CONFIG_DIR="$XDG_CONFIG_HOME/quickshell/$QUICKSHELL_CONFIG_NAME" CACHE_DIR="$XDG_CACHE_HOME/quickshell" STATE_DIR="$XDG_STATE_HOME/quickshell" SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" @@ -28,13 +29,13 @@ colorvalues=($colorstrings) # Array of color values apply_term() { # Check if terminal escape sequence template exists - if [ ! -f "$CONFIG_DIR"/scripts/terminal/sequences.txt ]; then + if [ ! -f "$SCRIPT_DIR/terminal/sequences.txt" ]; then echo "Template file not found for Terminal. Skipping that." return fi # Copy template mkdir -p "$STATE_DIR"/user/generated/terminal - cp "$CONFIG_DIR"/scripts/terminal/sequences.txt "$STATE_DIR"/user/generated/terminal/sequences.txt + cp "$SCRIPT_DIR/terminal/sequences.txt" "$STATE_DIR"/user/generated/terminal/sequences.txt # Apply colors for i in "${!colorlist[@]}"; do sed -i "s/${colorlist[$i]} #/${colorvalues[$i]#\#}/g" "$STATE_DIR"/user/generated/terminal/sequences.txt @@ -56,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/scripts/colors/generate_colors_material.py b/.config/quickshell/ii/scripts/colors/generate_colors_material.py similarity index 100% rename from .config/quickshell/scripts/colors/generate_colors_material.py rename to .config/quickshell/ii/scripts/colors/generate_colors_material.py diff --git a/.config/quickshell/ii/scripts/colors/random_konachan_wall.sh b/.config/quickshell/ii/scripts/colors/random_konachan_wall.sh new file mode 100755 index 000000000..079cad96e --- /dev/null +++ b/.config/quickshell/ii/scripts/colors/random_konachan_wall.sh @@ -0,0 +1,19 @@ +#!/usr/bin/env bash + +QUICKSHELL_CONFIG_NAME="ii" +XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}" +XDG_CACHE_HOME="${XDG_CACHE_HOME:-$HOME/.cache}" +XDG_STATE_HOME="${XDG_STATE_HOME:-$HOME/.local/state}" +CONFIG_DIR="$XDG_CONFIG_HOME/quickshell/$QUICKSHELL_CONFIG_NAME" +CACHE_DIR="$XDG_CACHE_HOME/quickshell" +STATE_DIR="$XDG_STATE_HOME/quickshell" +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" + +mkdir -p ~/Pictures/Wallpapers +page=$((1 + RANDOM % 1000)); +response=$(curl "https://konachan.com/post.json?tags=rating%3Asafe&limit=1&page=$page") +link=$(echo "$response" | jq '.[0].file_url' -r); +ext=$(echo "$link" | awk -F. '{print $NF}') +downloadPath="$HOME/Pictures/Wallpapers/konachan_random_image.$ext" +curl "$link" -o "$downloadPath" +"$SCRIPT_DIR/switchwall.sh" --image "$downloadPath" diff --git a/.config/quickshell/scripts/colors/scheme_for_image.py b/.config/quickshell/ii/scripts/colors/scheme_for_image.py similarity index 100% rename from .config/quickshell/scripts/colors/scheme_for_image.py rename to .config/quickshell/ii/scripts/colors/scheme_for_image.py diff --git a/.config/quickshell/scripts/colors/switchwall.sh b/.config/quickshell/ii/scripts/colors/switchwall.sh similarity index 93% rename from .config/quickshell/scripts/colors/switchwall.sh rename to .config/quickshell/ii/scripts/colors/switchwall.sh index 560a8cfc7..0d9ffadbf 100755 --- a/.config/quickshell/scripts/colors/switchwall.sh +++ b/.config/quickshell/ii/scripts/colors/switchwall.sh @@ -1,16 +1,26 @@ #!/usr/bin/env bash +QUICKSHELL_CONFIG_NAME="ii" XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}" XDG_CACHE_HOME="${XDG_CACHE_HOME:-$HOME/.cache}" XDG_STATE_HOME="${XDG_STATE_HOME:-$HOME/.local/state}" -CONFIG_DIR="$XDG_CONFIG_HOME/quickshell" +CONFIG_DIR="$XDG_CONFIG_HOME/quickshell/$QUICKSHELL_CONFIG_NAME" CACHE_DIR="$XDG_CACHE_HOME/quickshell" STATE_DIR="$XDG_STATE_HOME/quickshell" SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" MATUGEN_DIR="$XDG_CONFIG_HOME/matugen" -terminalscheme="$XDG_CONFIG_HOME/quickshell/scripts/terminal/scheme-base.json" +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 @@ -45,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 @@ -241,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[@]}" \ @@ -297,7 +318,7 @@ main() { ;; --noswitch) noswitch_flag="1" - imgpath=$(swww query | awk -F 'image: ' '{print $2}') + imgpath=$(swww query | head -1 | awk -F 'image: ' '{print $2}') shift ;; *) diff --git a/.config/quickshell/scripts/terminal/scheme-base.json b/.config/quickshell/ii/scripts/colors/terminal/scheme-base.json similarity index 100% rename from .config/quickshell/scripts/terminal/scheme-base.json rename to .config/quickshell/ii/scripts/colors/terminal/scheme-base.json diff --git a/.config/quickshell/scripts/terminal/sequences.txt b/.config/quickshell/ii/scripts/colors/terminal/sequences.txt similarity index 100% rename from .config/quickshell/scripts/terminal/sequences.txt rename to .config/quickshell/ii/scripts/colors/terminal/sequences.txt diff --git a/.config/quickshell/scripts/hyprland/get_keybinds.py b/.config/quickshell/ii/scripts/hyprland/get_keybinds.py similarity index 100% rename from .config/quickshell/scripts/hyprland/get_keybinds.py rename to .config/quickshell/ii/scripts/hyprland/get_keybinds.py diff --git a/.config/quickshell/scripts/images/find_regions.py b/.config/quickshell/ii/scripts/images/find_regions.py similarity index 100% rename from .config/quickshell/scripts/images/find_regions.py rename to .config/quickshell/ii/scripts/images/find_regions.py diff --git a/.config/quickshell/scripts/kvantum/adwsvg.py b/.config/quickshell/ii/scripts/kvantum/adwsvg.py similarity index 100% rename from .config/quickshell/scripts/kvantum/adwsvg.py rename to .config/quickshell/ii/scripts/kvantum/adwsvg.py diff --git a/.config/quickshell/scripts/kvantum/adwsvgDark.py b/.config/quickshell/ii/scripts/kvantum/adwsvgDark.py similarity index 100% rename from .config/quickshell/scripts/kvantum/adwsvgDark.py rename to .config/quickshell/ii/scripts/kvantum/adwsvgDark.py diff --git a/.config/quickshell/scripts/kvantum/changeAdwColors.py b/.config/quickshell/ii/scripts/kvantum/changeAdwColors.py similarity index 100% rename from .config/quickshell/scripts/kvantum/changeAdwColors.py rename to .config/quickshell/ii/scripts/kvantum/changeAdwColors.py diff --git a/.config/quickshell/scripts/kvantum/materialQT.sh b/.config/quickshell/ii/scripts/kvantum/materialQT.sh similarity index 89% rename from .config/quickshell/scripts/kvantum/materialQT.sh rename to .config/quickshell/ii/scripts/kvantum/materialQT.sh index 3d1f8a7bf..a049c5536 100755 --- a/.config/quickshell/scripts/kvantum/materialQT.sh +++ b/.config/quickshell/ii/scripts/kvantum/materialQT.sh @@ -1,11 +1,13 @@ #!/usr/bin/env bash +QUICKSHELL_CONFIG_NAME="ii" XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}" XDG_CACHE_HOME="${XDG_CACHE_HOME:-$HOME/.cache}" XDG_STATE_HOME="${XDG_STATE_HOME:-$HOME/.local/state}" -CONFIG_DIR="$XDG_CONFIG_HOME/quickshell" +CONFIG_DIR="$XDG_CONFIG_HOME/quickshell/$QUICKSHELL_CONFIG_NAME" CACHE_DIR="$XDG_CACHE_HOME/quickshell" STATE_DIR="$XDG_STATE_HOME/quickshell" +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" get_light_dark() { current_mode=$(gsettings get org.gnome.desktop.interface color-scheme 2>/dev/null | tr -d "'") diff --git a/.config/quickshell/scripts/wayland-idle-inhibitor.py b/.config/quickshell/ii/scripts/wayland-idle-inhibitor.py similarity index 100% rename from .config/quickshell/scripts/wayland-idle-inhibitor.py rename to .config/quickshell/ii/scripts/wayland-idle-inhibitor.py diff --git a/.config/quickshell/services/Ai.qml b/.config/quickshell/ii/services/Ai.qml similarity index 87% rename from .config/quickshell/services/Ai.qml rename to .config/quickshell/ii/services/Ai.qml index c97ba2b50..fe1b4b83e 100644 --- a/.config/quickshell/services/Ai.qml +++ b/.config/quickshell/ii/services/Ai.qml @@ -19,7 +19,7 @@ Singleton { readonly property string apiKeyEnvVarName: "API_KEY" property Component aiMessageComponent: AiMessageData {} property string systemPrompt: Config.options?.ai?.systemPrompt ?? "" - property var messages: [] + // property var messages: [] property var messageIDs: [] property var messageByID: ({}) readonly property var apiKeys: KeyringStorage.keyringData?.apiKeys ?? {} @@ -39,6 +39,7 @@ Singleton { property list defaultPrompts: [] property list userPrompts: [] property list promptFiles: [...defaultPrompts, ...userPrompts] + property list savedChats: [] // Model properties: // - name: Name of the model @@ -236,7 +237,7 @@ Singleton { Process { id: getOllamaModels running: true - command: ["bash", "-c", `${Directories.config}/quickshell/scripts/ai/show-installed-ollama-models.sh`.replace(/file:\/\//, "")] + command: ["bash", "-c", `${Directories.scriptPath}/ai/show-installed-ollama-models.sh`.replace(/file:\/\//, "")] stdout: SplitParser { onRead: data => { try { @@ -292,6 +293,20 @@ Singleton { } } + Process { + id: getSavedChats + running: true + command: ["ls", "-1", Directories.aiChats] + stdout: StdioCollector { + onStreamFinished: { + if (text.length === 0) return; + root.savedChats = text.split("\n") + .filter(fileName => fileName.endsWith(".json")) + .map(fileName => `${Directories.aiChats}/${fileName}`) + } + } + } + FileView { id: promptLoader watchChanges: false; @@ -317,6 +332,7 @@ Singleton { const aiMessage = aiMessageComponent.createObject(root, { "role": role, "content": message, + "rawContent": message, "thinking": false, "done": true, }); @@ -445,6 +461,7 @@ Singleton { root.postResponseHook(); root.postResponseHook = null; // Reset hook after use } + root.saveChat("lastSession") } function buildGeminiRequestData(model, messages) { @@ -476,7 +493,7 @@ Singleton { return { "role": geminiApiRoleName, "parts": [{ - text: message.content, + text: message.rawContent, }] } }), @@ -501,7 +518,7 @@ Singleton { ...messages.filter(message => (message.role != Ai.interfaceRole)).map(message => { return { "role": message.role, - "content": message.content, + "content": message.rawContent, } }), ], @@ -533,6 +550,7 @@ Singleton { "role": "assistant", "model": currentModelId, "content": "", + "rawContent": "", "thinking": true, "done": false, }); @@ -577,12 +595,15 @@ Singleton { const functionCall = dataJson.candidates[0]?.content?.parts[0]?.functionCall; requester.message.functionName = functionCall.name; requester.message.functionCall = functionCall.name; - requester.message.content += `\n\n[[ Function: ${functionCall.name}(${JSON.stringify(functionCall.args, null, 2)}) ]]\n`; + const newContent = `\n\n[[ Function: ${functionCall.name}(${JSON.stringify(functionCall.args, null, 2)}) ]]\n` + requester.message.rawContent += newContent; + requester.message.content += newContent; root.handleGeminiFunctionCall(functionCall.name, functionCall.args); return } // Normal text response const responseContent = dataJson.candidates[0]?.content?.parts[0]?.text + requester.message.rawContent += responseContent; requester.message.content += responseContent; const annotationSources = dataJson.candidates[0]?.groundingMetadata?.groundingChunks?.map(chunk => { return { @@ -606,6 +627,7 @@ Singleton { // console.log(JSON.stringify(requester.message, null, 2)); } catch (e) { console.log("[AI] Could not parse response from stream: ", e); + requester.message.rawContent += requester.geminiBuffer; requester.message.content += requester.geminiBuffer } finally { requester.geminiBuffer = ""; @@ -647,15 +669,19 @@ Singleton { if (responseContent && responseContent.length > 0) { if (requester.isReasoning) { requester.isReasoning = false; - requester.message.content += "\n\n\n\n"; + const endBlock = "\n\n\n\n"; + requester.message.content += endBlock; + requester.message.rawContent += endBlock; } newContent = dataJson.choices[0]?.delta?.content || dataJson.message.content; } else if (responseReasoning && responseReasoning.length > 0) { // console.log("Reasoning content: ", dataJson.choices[0].delta.reasoning); if (!requester.isReasoning) { requester.isReasoning = true; - requester.message.content += "\n\n\n\n"; - } + const startBlock = "\n\n\n\n"; + requester.message.rawContent += startBlock; + requester.message.content += startBlock; + } newContent = dataJson.choices[0].delta.reasoning || dataJson.choices[0].delta.reasoning_content; } @@ -682,10 +708,12 @@ Singleton { } else { console.log("Unknown API format: ", requester.apiFormat); + requester.message.rawContent += data; requester.message.content += data; } } catch (e) { console.log("[AI] Could not parse response from stream: ", e); + requester.message.rawContent += data; requester.message.content += data; } } @@ -697,8 +725,9 @@ Singleton { try { // to parse full response into json for error handling // console.log("Full response: ", requester.message.content + "]"); - const parsedResponse = JSON.parse(requester.message.content + "]"); - requester.message.content = `\`\`\`json\n${JSON.stringify(parsedResponse, null, 2)}\n\`\`\``; + const parsedResponse = JSON.parse(requester.message.rawContent + "]"); + requester.message.rawContent = `\`\`\`json\n${JSON.stringify(parsedResponse, null, 2)}\n\`\`\``; + requester.message.content = requester.message.rawContent; } catch (e) { // console.log("[AI] Could not parse response on exit: ", e); } @@ -719,6 +748,7 @@ Singleton { const aiMessage = aiMessageComponent.createObject(root, { "role": "user", "content": `[[ Output of ${name} ]]`, + "rawContent": `[[ Output of ${name} ]]`, "functionName": name, "functionResponse": output, "thinking": false, @@ -771,4 +801,80 @@ Singleton { else root.addMessage(qsTr("Unknown function call: {0}"), "assistant"); } + function chatToJson() { + return root.messageIDs.map(id => { + const message = root.messageByID[id] + return ({ + "role": message.role, + "rawContent": message.rawContent, + "model": message.model, + "thinking": false, + "done": true, + "annotations": message.annotations, + "annotationSources": message.annotationSources, + "functionName": message.functionName, + "functionCall": message.functionCall, + "functionResponse": message.functionResponse, + "visibleToUser": message.visibleToUser, + }) + }) + } + + FileView { + id: chatSaveFile + property string chatName: "chat" + path: `${Directories.aiChats}/${chatName}.json` + blockLoading: true + } + + /** + * Saves chat to a JSON list of message objects. + * @param chatName name of the chat + */ + function saveChat(chatName) { + chatSaveFile.chatName = chatName.trim() + const saveContent = JSON.stringify(root.chatToJson()) + chatSaveFile.setText(saveContent) + getSavedChats.running = true; + } + + /** + * Loads chat from a JSON list of message objects. + * @param chatName name of the chat + */ + function loadChat(chatName) { + try { + chatSaveFile.chatName = chatName.trim() + chatSaveFile.reload() + const saveContent = chatSaveFile.text() + // console.log(saveContent) + const saveData = JSON.parse(saveContent) + root.clearMessages() + root.messageIDs = saveData.map((_, i) => { + return i + }) + console.log(JSON.stringify(messageIDs)) + for (let i = 0; i < saveData.length; i++) { + const message = saveData[i]; + root.messageByID[i] = root.aiMessageComponent.createObject(root, { + "role": message.role, + "rawContent": message.rawContent, + "content": message.rawContent, + "model": message.model, + "thinking": message.thinking, + "done": message.done, + "annotations": message.annotations, + "annotationSources": message.annotationSources, + "functionName": message.functionName, + "functionCall": message.functionCall, + "functionResponse": message.functionResponse, + "visibleToUser": message.visibleToUser, + }); + } + } catch (e) { + console.log("[AI] Could not load chat: ", e); + } finally { + getSavedChats.running = true; + } + } } diff --git a/.config/quickshell/services/AiMessageData.qml b/.config/quickshell/ii/services/AiMessageData.qml similarity index 94% rename from .config/quickshell/services/AiMessageData.qml rename to .config/quickshell/ii/services/AiMessageData.qml index b5f208548..dc8b80fdb 100644 --- a/.config/quickshell/services/AiMessageData.qml +++ b/.config/quickshell/ii/services/AiMessageData.qml @@ -7,6 +7,7 @@ import QtQuick; QtObject { property string role property string content + property string rawContent property string model property bool thinking: true property bool done: false diff --git a/.config/quickshell/services/AppSearch.qml b/.config/quickshell/ii/services/AppSearch.qml similarity index 100% rename from .config/quickshell/services/AppSearch.qml rename to .config/quickshell/ii/services/AppSearch.qml diff --git a/.config/quickshell/services/Audio.qml b/.config/quickshell/ii/services/Audio.qml similarity index 100% rename from .config/quickshell/services/Audio.qml rename to .config/quickshell/ii/services/Audio.qml diff --git a/.config/quickshell/services/Battery.qml b/.config/quickshell/ii/services/Battery.qml similarity index 100% rename from .config/quickshell/services/Battery.qml rename to .config/quickshell/ii/services/Battery.qml diff --git a/.config/quickshell/services/Bluetooth.qml b/.config/quickshell/ii/services/Bluetooth.qml similarity index 100% rename from .config/quickshell/services/Bluetooth.qml rename to .config/quickshell/ii/services/Bluetooth.qml diff --git a/.config/quickshell/services/Booru.qml b/.config/quickshell/ii/services/Booru.qml similarity index 100% rename from .config/quickshell/services/Booru.qml rename to .config/quickshell/ii/services/Booru.qml diff --git a/.config/quickshell/services/BooruResponseData.qml b/.config/quickshell/ii/services/BooruResponseData.qml similarity index 100% rename from .config/quickshell/services/BooruResponseData.qml rename to .config/quickshell/ii/services/BooruResponseData.qml diff --git a/.config/quickshell/services/Brightness.qml b/.config/quickshell/ii/services/Brightness.qml similarity index 100% rename from .config/quickshell/services/Brightness.qml rename to .config/quickshell/ii/services/Brightness.qml diff --git a/.config/quickshell/services/Cliphist.qml b/.config/quickshell/ii/services/Cliphist.qml similarity index 100% rename from .config/quickshell/services/Cliphist.qml rename to .config/quickshell/ii/services/Cliphist.qml diff --git a/.config/quickshell/services/DateTime.qml b/.config/quickshell/ii/services/DateTime.qml similarity index 100% rename from .config/quickshell/services/DateTime.qml rename to .config/quickshell/ii/services/DateTime.qml diff --git a/.config/quickshell/services/Emojis.qml b/.config/quickshell/ii/services/Emojis.qml similarity index 100% rename from .config/quickshell/services/Emojis.qml rename to .config/quickshell/ii/services/Emojis.qml diff --git a/.config/quickshell/services/FirstRunExperience.qml b/.config/quickshell/ii/services/FirstRunExperience.qml similarity index 88% rename from .config/quickshell/services/FirstRunExperience.qml rename to .config/quickshell/ii/services/FirstRunExperience.qml index 4b1f034cd..5bdae4551 100644 --- a/.config/quickshell/services/FirstRunExperience.qml +++ b/.config/quickshell/ii/services/FirstRunExperience.qml @@ -12,8 +12,8 @@ Singleton { property string firstRunFileContent: "This file is just here to confirm you've been greeted :>" property string firstRunNotifSummary: "Welcome!" property string firstRunNotifBody: "Hit Super+/ for a list of keybinds" - property string defaultWallpaperPath: FileUtils.trimFileProtocol(`${Directories.config}/quickshell/assets/images/default_wallpaper.png`) - property string welcomeQmlPath: FileUtils.trimFileProtocol(`${Directories.config}/quickshell/welcome.qml`) + property string defaultWallpaperPath: FileUtils.trimFileProtocol(`${Directories.assetsPath}/images/default_wallpaper.png`) + property string welcomeQmlPath: FileUtils.trimFileProtocol(Quickshell.configPath("welcome.qml")) function load() { firstRunFileView.reload() diff --git a/.config/quickshell/ii/services/HyprlandData.qml b/.config/quickshell/ii/services/HyprlandData.qml new file mode 100644 index 000000000..fb3600704 --- /dev/null +++ b/.config/quickshell/ii/services/HyprlandData.qml @@ -0,0 +1,134 @@ +pragma Singleton +pragma ComponentBehavior: Bound + +import QtQuick +import Quickshell +import Quickshell.Io +import Quickshell.Wayland +import Quickshell.Hyprland + +/** + * Provides access to some Hyprland data not available in Quickshell.Hyprland. + */ +Singleton { + id: root + property var windowList: [] + property var addresses: [] + property var windowByAddress: ({}) + property var workspaces: [] + property var workspaceIds: [] + property var workspaceById: ({}) + property var activeWorkspace: null + property var monitors: [] + property var layers: ({}) + + function updateWindowList() { + getClients.running = true; + } + + function updateLayers() { + getLayers.running = true; + } + + function updateMonitors() { + getMonitors.running = true; + } + + function updateWorkspaces() { + getWorkspaces.running = true; + getActiveWorkspace.running = true; + } + + function updateAll() { + updateWindowList(); + updateMonitors(); + updateLayers(); + updateWorkspaces(); + } + + function biggestWindowForWorkspace(workspaceId) { + const windowsInThisWorkspace = HyprlandData.windowList.filter(w => w.workspace.id == workspaceId); + return windowsInThisWorkspace.reduce((maxWin, win) => { + const maxArea = (maxWin?.size?.[0] ?? 0) * (maxWin?.size?.[1] ?? 0); + const winArea = (win?.size?.[0] ?? 0) * (win?.size?.[1] ?? 0); + return winArea > maxArea ? win : maxWin; + }, null); + } + + Component.onCompleted: { + updateAll(); + } + + Connections { + target: Hyprland + + function onRawEvent(event) { + // console.log("Hyprland raw event:", event.name); + updateAll() + } + } + + Process { + id: getClients + command: ["bash", "-c", "hyprctl clients -j | jq -c"] + stdout: SplitParser { + onRead: data => { + root.windowList = JSON.parse(data); + let tempWinByAddress = {}; + for (var i = 0; i < root.windowList.length; ++i) { + var win = root.windowList[i]; + tempWinByAddress[win.address] = win; + } + root.windowByAddress = tempWinByAddress; + root.addresses = root.windowList.map(win => win.address); + } + } + } + + Process { + id: getMonitors + command: ["bash", "-c", "hyprctl monitors -j | jq -c"] + stdout: SplitParser { + onRead: data => { + root.monitors = JSON.parse(data); + } + } + } + + Process { + id: getLayers + command: ["bash", "-c", "hyprctl layers -j | jq -c"] + stdout: SplitParser { + onRead: data => { + root.layers = JSON.parse(data); + } + } + } + + Process { + id: getWorkspaces + command: ["bash", "-c", "hyprctl workspaces -j | jq -c"] + stdout: SplitParser { + onRead: data => { + root.workspaces = JSON.parse(data); + let tempWorkspaceById = {}; + for (var i = 0; i < root.workspaces.length; ++i) { + var ws = root.workspaces[i]; + tempWorkspaceById[ws.id] = ws; + } + root.workspaceById = tempWorkspaceById; + root.workspaceIds = root.workspaces.map(ws => ws.id); + } + } + } + + Process { + id: getActiveWorkspace + command: ["bash", "-c", "hyprctl activeworkspace -j | jq -c"] + stdout: SplitParser { + onRead: data => { + root.activeWorkspace = JSON.parse(data); + } + } + } +} diff --git a/.config/quickshell/services/HyprlandKeybinds.qml b/.config/quickshell/ii/services/HyprlandKeybinds.qml similarity index 96% rename from .config/quickshell/services/HyprlandKeybinds.qml rename to .config/quickshell/ii/services/HyprlandKeybinds.qml index 189ba76d5..a313ffc47 100644 --- a/.config/quickshell/services/HyprlandKeybinds.qml +++ b/.config/quickshell/ii/services/HyprlandKeybinds.qml @@ -15,7 +15,7 @@ import Quickshell.Hyprland */ Singleton { id: root - property string keybindParserPath: FileUtils.trimFileProtocol(`${Directories.config}/quickshell/scripts/hyprland/get_keybinds.py`) + property string keybindParserPath: FileUtils.trimFileProtocol(`${Directories.scriptPath}/hyprland/get_keybinds.py`) property string defaultKeybindConfigPath: FileUtils.trimFileProtocol(`${Directories.config}/hypr/hyprland/keybinds.conf`) property string userKeybindConfigPath: FileUtils.trimFileProtocol(`${Directories.config}/hypr/custom/keybinds.conf`) property var defaultKeybinds: {"children": []} diff --git a/.config/quickshell/services/KeyringStorage.qml b/.config/quickshell/ii/services/KeyringStorage.qml similarity index 100% rename from .config/quickshell/services/KeyringStorage.qml rename to .config/quickshell/ii/services/KeyringStorage.qml diff --git a/.config/quickshell/services/LatexRenderer.qml b/.config/quickshell/ii/services/LatexRenderer.qml similarity index 100% rename from .config/quickshell/services/LatexRenderer.qml rename to .config/quickshell/ii/services/LatexRenderer.qml diff --git a/.config/quickshell/services/MaterialThemeLoader.qml b/.config/quickshell/ii/services/MaterialThemeLoader.qml similarity index 100% rename from .config/quickshell/services/MaterialThemeLoader.qml rename to .config/quickshell/ii/services/MaterialThemeLoader.qml diff --git a/.config/quickshell/services/MprisController.qml b/.config/quickshell/ii/services/MprisController.qml similarity index 100% rename from .config/quickshell/services/MprisController.qml rename to .config/quickshell/ii/services/MprisController.qml diff --git a/.config/quickshell/services/Network.qml b/.config/quickshell/ii/services/Network.qml similarity index 100% rename from .config/quickshell/services/Network.qml rename to .config/quickshell/ii/services/Network.qml diff --git a/.config/quickshell/services/Notifications.qml b/.config/quickshell/ii/services/Notifications.qml similarity index 100% rename from .config/quickshell/services/Notifications.qml rename to .config/quickshell/ii/services/Notifications.qml diff --git a/.config/quickshell/services/ResourceUsage.qml b/.config/quickshell/ii/services/ResourceUsage.qml similarity index 100% rename from .config/quickshell/services/ResourceUsage.qml rename to .config/quickshell/ii/services/ResourceUsage.qml diff --git a/.config/quickshell/services/SystemInfo.qml b/.config/quickshell/ii/services/SystemInfo.qml similarity index 100% rename from .config/quickshell/services/SystemInfo.qml rename to .config/quickshell/ii/services/SystemInfo.qml diff --git a/.config/quickshell/services/Todo.qml b/.config/quickshell/ii/services/Todo.qml similarity index 100% rename from .config/quickshell/services/Todo.qml rename to .config/quickshell/ii/services/Todo.qml diff --git a/.config/quickshell/services/Weather.qml b/.config/quickshell/ii/services/Weather.qml similarity index 100% rename from .config/quickshell/services/Weather.qml rename to .config/quickshell/ii/services/Weather.qml diff --git a/.config/quickshell/services/Ydotool.qml b/.config/quickshell/ii/services/Ydotool.qml similarity index 100% rename from .config/quickshell/services/Ydotool.qml rename to .config/quickshell/ii/services/Ydotool.qml diff --git a/.config/quickshell/settings.qml b/.config/quickshell/ii/settings.qml similarity index 98% rename from .config/quickshell/settings.qml rename to .config/quickshell/ii/settings.qml index 0e181e0b9..e76f8dcb6 100644 --- a/.config/quickshell/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", diff --git a/.config/quickshell/shell.qml b/.config/quickshell/ii/shell.qml similarity index 100% rename from .config/quickshell/shell.qml rename to .config/quickshell/ii/shell.qml diff --git a/.config/quickshell/welcome.qml b/.config/quickshell/ii/welcome.qml similarity index 99% rename from .config/quickshell/welcome.qml rename to .config/quickshell/ii/welcome.qml index d9e0770d6..7c1dff4a2 100644 --- a/.config/quickshell/welcome.qml +++ b/.config/quickshell/ii/welcome.qml @@ -42,7 +42,7 @@ ApplicationWindow { Process { id: konachanWallProc property string status: "" - command: ["bash", "-c", FileUtils.trimFileProtocol(`${Directories.config}/quickshell/scripts/colors/random_konachan_wall.sh`)] + command: ["bash", "-c", Quickshell.configPath("scripts/colors/random_konachan_wall.sh")] stdout: SplitParser { onRead: data => { console.log(`Konachan wall proc output: ${data}`); diff --git a/.config/quickshell/modules/bar/Bar.qml b/.config/quickshell/modules/bar/Bar.qml deleted file mode 100644 index 27b188d02..000000000 --- a/.config/quickshell/modules/bar/Bar.qml +++ /dev/null @@ -1,570 +0,0 @@ -import "root:/" -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/bar/weather" -import QtQuick -import QtQuick.Controls -import QtQuick.Layouts -import Qt5Compat.GraphicalEffects -import Quickshell -import Quickshell.Wayland -import Quickshell.Hyprland -import Quickshell.Services.UPower - -Scope { - id: bar - - readonly property int osdHideMouseMoveThreshold: 20 - property bool showBarBackground: Config.options.bar.showBackground - - component VerticalBarSeparator: Rectangle { - Layout.topMargin: Appearance.sizes.baseBarHeight / 3 - Layout.bottomMargin: Appearance.sizes.baseBarHeight / 3 - Layout.fillHeight: true - implicitWidth: 1 - color: Appearance.colors.colOutlineVariant - } - - Variants { - // For each monitor - model: { - const screens = Quickshell.screens; - const list = Config.options.bar.screenList; - if (!list || list.length === 0) - return screens; - return screens.filter(screen => list.includes(screen.name)); - } - - PanelWindow { // Bar window - id: barRoot - required property ShellScreen modelData - screen: modelData - - property var brightnessMonitor: Brightness.getMonitorForScreen(modelData) - property real useShortenedForm: (Appearance.sizes.barHellaShortenScreenWidthThreshold >= screen.width) ? 2 : (Appearance.sizes.barShortenScreenWidthThreshold >= screen.width) ? 1 : 0 - readonly property int centerSideModuleWidth: (useShortenedForm == 2) ? Appearance.sizes.barCenterSideModuleWidthHellaShortened : (useShortenedForm == 1) ? Appearance.sizes.barCenterSideModuleWidthShortened : Appearance.sizes.barCenterSideModuleWidth - - WlrLayershell.namespace: "quickshell:bar" - implicitHeight: Appearance.sizes.barHeight + Appearance.rounding.screenRounding - exclusiveZone: Appearance.sizes.baseBarHeight + (Config.options.bar.cornerStyle === 1 ? Appearance.sizes.hyprlandGapsOut : 0) - mask: Region { - item: barContent - } - color: "transparent" - - anchors { - top: !Config.options.bar.bottom - bottom: Config.options.bar.bottom - left: true - right: true - } - - Item { // Bar content region - id: barContent - anchors { - right: parent.right - left: parent.left - top: parent.top - bottom: undefined - } - implicitHeight: Appearance.sizes.barHeight - height: Appearance.sizes.barHeight - - states: State { - name: "bottom" - when: Config.options.bar.bottom - AnchorChanges { - target: barContent - anchors { - right: parent.right - left: parent.left - top: undefined - bottom: parent.bottom - } - } - } - - // Background shadow - Loader { - active: showBarBackground && Config.options.bar.cornerStyle === 1 - anchors.fill: barBackground - sourceComponent: StyledRectangularShadow { - anchors.fill: undefined // The loader's anchors act on this, and this should not have any anchor - target: barBackground - } - } - // Background - Rectangle { - id: barBackground - anchors { - fill: parent - margins: Config.options.bar.cornerStyle === 1 ? (Appearance.sizes.hyprlandGapsOut) : 0 // idk why but +1 is needed - } - color: showBarBackground ? Appearance.colors.colLayer0 : "transparent" - radius: Config.options.bar.cornerStyle === 1 ? Appearance.rounding.windowRounding : 0 - } - - MouseArea { // Left side | scroll to change brightness - id: barLeftSideMouseArea - anchors.left: parent.left - implicitHeight: Appearance.sizes.baseBarHeight - height: Appearance.sizes.barHeight - width: (barRoot.width - middleSection.width) / 2 - property bool hovered: false - property real lastScrollX: 0 - property real lastScrollY: 0 - property bool trackingScroll: false - acceptedButtons: Qt.LeftButton - hoverEnabled: true - propagateComposedEvents: true - onEntered: event => { - barLeftSideMouseArea.hovered = true; - } - onExited: event => { - barLeftSideMouseArea.hovered = false; - barLeftSideMouseArea.trackingScroll = false; - } - onPressed: event => { - if (event.button === Qt.LeftButton) { - Hyprland.dispatch('global quickshell:sidebarLeftOpen'); - } - } - // Scroll to change brightness - WheelHandler { - onWheel: event => { - if (event.angleDelta.y < 0) - barRoot.brightnessMonitor.setBrightness(barRoot.brightnessMonitor.brightness - 0.05); - else if (event.angleDelta.y > 0) - barRoot.brightnessMonitor.setBrightness(barRoot.brightnessMonitor.brightness + 0.05); - // Store the mouse position and start tracking - barLeftSideMouseArea.lastScrollX = event.x; - barLeftSideMouseArea.lastScrollY = event.y; - barLeftSideMouseArea.trackingScroll = true; - } - acceptedDevices: PointerDevice.Mouse | PointerDevice.TouchPad - } - onPositionChanged: mouse => { - if (barLeftSideMouseArea.trackingScroll) { - const dx = mouse.x - barLeftSideMouseArea.lastScrollX; - const dy = mouse.y - barLeftSideMouseArea.lastScrollY; - if (Math.sqrt(dx * dx + dy * dy) > osdHideMouseMoveThreshold) { - Hyprland.dispatch('global quickshell:osdBrightnessHide'); - barLeftSideMouseArea.trackingScroll = false; - } - } - } - Item { - // Left section - anchors.fill: parent - implicitHeight: leftSectionRowLayout.implicitHeight - implicitWidth: leftSectionRowLayout.implicitWidth - - ScrollHint { - reveal: barLeftSideMouseArea.hovered - icon: "light_mode" - tooltipText: qsTr("Scroll to change brightness") - side: "left" - anchors.left: parent.left - anchors.verticalCenter: parent.verticalCenter - } - - RowLayout { // Content - id: leftSectionRowLayout - anchors.fill: parent - spacing: 10 - - RippleButton { - // Left sidebar button - Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter - Layout.leftMargin: Appearance.rounding.screenRounding - Layout.fillWidth: false - property real buttonPadding: 5 - implicitWidth: distroIcon.width + buttonPadding * 2 - implicitHeight: distroIcon.height + buttonPadding * 2 - - buttonRadius: Appearance.rounding.full - colBackground: barLeftSideMouseArea.hovered ? Appearance.colors.colLayer1Hover : ColorUtils.transparentize(Appearance.colors.colLayer1Hover, 1) - colBackgroundHover: Appearance.colors.colLayer1Hover - colRipple: Appearance.colors.colLayer1Active - colBackgroundToggled: Appearance.colors.colSecondaryContainer - colBackgroundToggledHover: Appearance.colors.colSecondaryContainerHover - colRippleToggled: Appearance.colors.colSecondaryContainerActive - toggled: GlobalStates.sidebarLeftOpen - property color colText: toggled ? Appearance.m3colors.m3onSecondaryContainer : Appearance.colors.colOnLayer0 - - onPressed: { - Hyprland.dispatch('global quickshell:sidebarLeftToggle'); - } - - CustomIcon { - id: distroIcon - anchors.centerIn: parent - width: 19.5 - height: 19.5 - source: Config.options.bar.topLeftIcon == 'distro' ? SystemInfo.distroIcon : "spark-symbolic" - } - - ColorOverlay { - anchors.fill: distroIcon - source: distroIcon - color: Appearance.colors.colOnLayer0 - } - } - - ActiveWindow { - visible: barRoot.useShortenedForm === 0 - Layout.rightMargin: Appearance.rounding.screenRounding - Layout.fillWidth: true - Layout.fillHeight: true - bar: barRoot - } - } - } - } - - RowLayout { // Middle section - id: middleSection - anchors.centerIn: parent - spacing: Config.options?.bar.borderless ? 4 : 8 - - BarGroup { - id: leftCenterGroup - Layout.preferredWidth: barRoot.centerSideModuleWidth - Layout.fillHeight: true - - Resources { - alwaysShowAllResources: barRoot.useShortenedForm === 2 - Layout.fillWidth: barRoot.useShortenedForm === 2 - } - - Media { - visible: barRoot.useShortenedForm < 2 - Layout.fillWidth: true - } - } - - VerticalBarSeparator { - visible: Config.options?.bar.borderless - } - - BarGroup { - id: middleCenterGroup - padding: workspacesWidget.widgetPadding - Layout.fillHeight: true - - Workspaces { - id: workspacesWidget - bar: barRoot - Layout.fillHeight: true - MouseArea { - // Right-click to toggle overview - anchors.fill: parent - acceptedButtons: Qt.RightButton - - onPressed: event => { - if (event.button === Qt.RightButton) { - Hyprland.dispatch('global quickshell:overviewToggle'); - } - } - } - } - } - - VerticalBarSeparator { - visible: Config.options?.bar.borderless - } - - MouseArea { - id: rightCenterGroup - implicitWidth: rightCenterGroupContent.implicitWidth - implicitHeight: rightCenterGroupContent.implicitHeight - Layout.preferredWidth: barRoot.centerSideModuleWidth - Layout.fillHeight: true - - onPressed: { - Hyprland.dispatch('global quickshell:sidebarRightToggle'); - } - - BarGroup { - id: rightCenterGroupContent - anchors.fill: parent - - ClockWidget { - showDate: (Config.options.bar.verbose && barRoot.useShortenedForm < 2) - Layout.alignment: Qt.AlignVCenter - Layout.fillWidth: true - } - - UtilButtons { - visible: (Config.options.bar.verbose && barRoot.useShortenedForm === 0) - Layout.alignment: Qt.AlignVCenter - } - - BatteryIndicator { - visible: (barRoot.useShortenedForm < 2 && UPower.displayDevice.isLaptopBattery) - Layout.alignment: Qt.AlignVCenter - } - } - } - - VerticalBarSeparator { - visible: Config.options.bar.borderless && Config.options.bar.weather.enable - } - } - - MouseArea { // Right side | scroll to change volume - id: barRightSideMouseArea - - anchors.right: parent.right - implicitHeight: Appearance.sizes.baseBarHeight - height: Appearance.sizes.barHeight - width: (barRoot.width - middleSection.width) / 2 - - property bool hovered: false - property real lastScrollX: 0 - property real lastScrollY: 0 - property bool trackingScroll: false - - acceptedButtons: Qt.LeftButton - hoverEnabled: true - propagateComposedEvents: true - onEntered: event => { - barRightSideMouseArea.hovered = true; - } - onExited: event => { - barRightSideMouseArea.hovered = false; - barRightSideMouseArea.trackingScroll = false; - } - onPressed: event => { - if (event.button === Qt.LeftButton) { - Hyprland.dispatch('global quickshell:sidebarRightOpen'); - } else if (event.button === Qt.RightButton) { - MprisController.activePlayer.next(); - } - } - // Scroll to change volume - WheelHandler { - onWheel: event => { - const currentVolume = Audio.value; - const step = currentVolume < 0.1 ? 0.01 : 0.02 || 0.2; - if (event.angleDelta.y < 0) - Audio.sink.audio.volume -= step; - else if (event.angleDelta.y > 0) - Audio.sink.audio.volume = Math.min(1, Audio.sink.audio.volume + step); - // Store the mouse position and start tracking - barRightSideMouseArea.lastScrollX = event.x; - barRightSideMouseArea.lastScrollY = event.y; - barRightSideMouseArea.trackingScroll = true; - } - acceptedDevices: PointerDevice.Mouse | PointerDevice.TouchPad - } - onPositionChanged: mouse => { - if (barRightSideMouseArea.trackingScroll) { - const dx = mouse.x - barRightSideMouseArea.lastScrollX; - const dy = mouse.y - barRightSideMouseArea.lastScrollY; - if (Math.sqrt(dx * dx + dy * dy) > osdHideMouseMoveThreshold) { - Hyprland.dispatch('global quickshell:osdVolumeHide'); - barRightSideMouseArea.trackingScroll = false; - } - } - } - - Item { - anchors.fill: parent - implicitHeight: rightSectionRowLayout.implicitHeight - implicitWidth: rightSectionRowLayout.implicitWidth - - ScrollHint { - reveal: barRightSideMouseArea.hovered - icon: "volume_up" - tooltipText: qsTr("Scroll to change volume") - side: "right" - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - } - - RowLayout { - id: rightSectionRowLayout - anchors.fill: parent - spacing: 5 - layoutDirection: Qt.RightToLeft - - RippleButton { // Right sidebar button - id: rightSidebarButton - - Layout.alignment: Qt.AlignRight | Qt.AlignVCenter - Layout.rightMargin: Appearance.rounding.screenRounding - Layout.fillWidth: false - - implicitWidth: indicatorsRowLayout.implicitWidth + 10 * 2 - implicitHeight: indicatorsRowLayout.implicitHeight + 5 * 2 - - buttonRadius: Appearance.rounding.full - colBackground: barRightSideMouseArea.hovered ? Appearance.colors.colLayer1Hover : ColorUtils.transparentize(Appearance.colors.colLayer1Hover, 1) - colBackgroundHover: Appearance.colors.colLayer1Hover - colRipple: Appearance.colors.colLayer1Active - colBackgroundToggled: Appearance.colors.colSecondaryContainer - colBackgroundToggledHover: Appearance.colors.colSecondaryContainerHover - colRippleToggled: Appearance.colors.colSecondaryContainerActive - toggled: GlobalStates.sidebarRightOpen - property color colText: toggled ? Appearance.m3colors.m3onSecondaryContainer : Appearance.colors.colOnLayer0 - - Behavior on colText { - animation: Appearance.animation.elementMoveFast.colorAnimation.createObject(this) - } - - onPressed: { - Hyprland.dispatch('global quickshell:sidebarRightToggle'); - } - - RowLayout { - id: indicatorsRowLayout - anchors.centerIn: parent - property real realSpacing: 15 - spacing: 0 - - Revealer { - reveal: Audio.sink?.audio?.muted ?? false - Layout.fillHeight: true - Layout.rightMargin: reveal ? indicatorsRowLayout.realSpacing : 0 - Behavior on Layout.rightMargin { - NumberAnimation { - duration: Appearance.animation.elementMoveFast.duration - easing.type: Appearance.animation.elementMoveFast.type - easing.bezierCurve: Appearance.animation.elementMoveFast.bezierCurve - } - } - MaterialSymbol { - text: "volume_off" - iconSize: Appearance.font.pixelSize.larger - color: rightSidebarButton.colText - } - } - Revealer { - reveal: Audio.source?.audio?.muted ?? false - Layout.fillHeight: true - Layout.rightMargin: reveal ? indicatorsRowLayout.realSpacing : 0 - Behavior on Layout.rightMargin { - NumberAnimation { - duration: Appearance.animation.elementMoveFast.duration - easing.type: Appearance.animation.elementMoveFast.type - easing.bezierCurve: Appearance.animation.elementMoveFast.bezierCurve - } - } - MaterialSymbol { - text: "mic_off" - iconSize: Appearance.font.pixelSize.larger - color: rightSidebarButton.colText - } - } - MaterialSymbol { - Layout.rightMargin: indicatorsRowLayout.realSpacing - text: Network.materialSymbol - iconSize: Appearance.font.pixelSize.larger - color: rightSidebarButton.colText - } - MaterialSymbol { - text: Bluetooth.bluetoothConnected ? "bluetooth_connected" : Bluetooth.bluetoothEnabled ? "bluetooth" : "bluetooth_disabled" - iconSize: Appearance.font.pixelSize.larger - color: rightSidebarButton.colText - } - } - } - - SysTray { - bar: barRoot - visible: barRoot.useShortenedForm === 0 - Layout.fillWidth: false - Layout.fillHeight: true - } - - Item { - Layout.fillWidth: true - Layout.fillHeight: true - } - - // Weather - Loader { - Layout.leftMargin: 8 - Layout.fillHeight: true - active: Config.options.bar.weather.enable - sourceComponent: BarGroup { - implicitHeight: Appearance.sizes.baseBarHeight - WeatherBar {} - } - } - } - } - } - } - - // Round decorators - Loader { - id: roundDecorators - anchors { - left: parent.left - right: parent.right - } - y: Appearance.sizes.barHeight - width: parent.width - height: Appearance.rounding.screenRounding - active: showBarBackground && Config.options.bar.cornerStyle === 0 // Hug - - states: State { - name: "bottom" - when: Config.options.bar.bottom - PropertyChanges { - roundDecorators.y: 0 - } - } - - sourceComponent: Item { - implicitHeight: Appearance.rounding.screenRounding - RoundCorner { - id: leftCorner - anchors { - top: parent.top - bottom: parent.bottom - left: parent.left - } - - size: Appearance.rounding.screenRounding - color: showBarBackground ? Appearance.colors.colLayer0 : "transparent" - opacity: 1.0 - Appearance.transparency - - corner: RoundCorner.CornerEnum.TopLeft - states: State { - name: "bottom" - when: Config.options.bar.bottom - PropertyChanges { - leftCorner.corner: RoundCorner.CornerEnum.BottomLeft - } - } - } - RoundCorner { - id: rightCorner - anchors { - right: parent.right - top: !Config.options.bar.bottom ? parent.top : undefined - bottom: Config.options.bar.bottom ? parent.bottom : undefined - } - size: Appearance.rounding.screenRounding - color: showBarBackground ? Appearance.colors.colLayer0 : "transparent" - opacity: 1.0 - Appearance.transparency - - corner: RoundCorner.CornerEnum.TopRight - states: State { - name: "bottom" - when: Config.options.bar.bottom - PropertyChanges { - rightCorner.corner: RoundCorner.CornerEnum.BottomRight - } - } - } - } - } - } - } -} diff --git a/.config/quickshell/modules/common/widgets/StyledSlider.qml b/.config/quickshell/modules/common/widgets/StyledSlider.qml deleted file mode 100644 index ca0980030..000000000 --- a/.config/quickshell/modules/common/widgets/StyledSlider.qml +++ /dev/null @@ -1,113 +0,0 @@ -import "root:/modules/common" -import "root:/modules/common/widgets" -import "root:/services" -import QtQuick -import QtQuick.Controls -import QtQuick.Layouts -import Quickshell.Widgets - -// Material 3 slider. See https://m3.material.io/components/sliders/overview -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 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 real unsharpenRadius: Appearance.rounding.unsharpen - - property real limitedHandleRangeWidth: (root.availableWidth - handleWidth - root.handleLimit * 2) - property string tooltipContent: `${Math.round(value * 100)}%` - Layout.fillWidth: true - from: 0 - to: 1 - - Behavior on value { // This makes the adjusted value (like volume) shift smoothly - SmoothedAnimation { - velocity: Appearance.animation.elementMoveFast.velocity - } - } - - Behavior on handleMargins { - NumberAnimation { - duration: Appearance.animation.elementMoveFast.duration - easing.type: Appearance.animation.elementMoveFast.type - easing.bezierCurve: Appearance.animation.elementMoveFast.bezierCurve - } - } - - MouseArea { - anchors.fill: parent - onPressed: (mouse) => mouse.accepted = false - cursorShape: root.pressed ? Qt.ClosedHandCursor : Qt.PointingHandCursor - } - - background: Item { - anchors.verticalCenter: parent.verticalCenter - implicitHeight: trackHeight - - // 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 - color: root.highlightColor - topLeftRadius: root.trackRadius - bottomLeftRadius: root.trackRadius - topRightRadius: root.unsharpenRadius - bottomRightRadius: root.unsharpenRadius - } - - // 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 - color: root.trackColor - topLeftRadius: root.unsharpenRadius - bottomLeftRadius: root.unsharpenRadius - topRightRadius: root.trackRadius - bottomRightRadius: root.trackRadius - } - - // 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 - } - } - - 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 - radius: Appearance.rounding.full - color: root.handleColor - - Behavior on implicitWidth { - animation: Appearance?.animation.elementMoveFast.numberAnimation.createObject(this) - } - - StyledToolTip { - extraVisibleCondition: root.pressed - content: root.tooltipContent - } - } -} \ No newline at end of file diff --git a/.config/quickshell/modules/sidebarRight/volumeMixer/VolumeMixerEntry.qml b/.config/quickshell/modules/sidebarRight/volumeMixer/VolumeMixerEntry.qml deleted file mode 100644 index c4600c7b8..000000000 --- a/.config/quickshell/modules/sidebarRight/volumeMixer/VolumeMixerEntry.qml +++ /dev/null @@ -1,65 +0,0 @@ -import "root:/modules/common" -import "root:/modules/common/widgets" -import "root:/services" -import Qt5Compat.GraphicalEffects -import QtQuick -import QtQuick.Controls -import QtQuick.Layouts -import Quickshell -import Quickshell.Widgets -import Quickshell.Services.Pipewire - -Item { - id: root - required property PwNode node; - PwObjectTracker { objects: [ node ] } - - implicitHeight: rowLayout.implicitHeight - - RowLayout { - id: rowLayout - anchors.fill: parent - spacing: 10 - - ColumnLayout { - Layout.fillWidth: true - spacing: 0 - - 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; - } - } - } - - 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 - } - } - } - } -} \ No newline at end of file diff --git a/.config/quickshell/scripts/colors/random_konachan_wall.sh b/.config/quickshell/scripts/colors/random_konachan_wall.sh deleted file mode 100755 index 52853d090..000000000 --- a/.config/quickshell/scripts/colors/random_konachan_wall.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash - -mkdir -p ~/Pictures/Wallpapers -page=$((1 + RANDOM % 1000)); -response=$(curl "https://konachan.com/post.json?tags=rating%3Asafe&limit=1&page=$page") -link=$(echo "$response" | jq '.[0].file_url' -r); -ext=$(echo "$link" | awk -F. '{print $NF}') -downloadPath="$HOME/Pictures/Wallpapers/konachan_random_image.$ext" -curl "$link" -o "$downloadPath" -~/.config/quickshell/scripts/colors/switchwall.sh --image "$downloadPath" diff --git a/.config/quickshell/services/HyprlandData.qml b/.config/quickshell/services/HyprlandData.qml deleted file mode 100644 index edd4e8eaa..000000000 --- a/.config/quickshell/services/HyprlandData.qml +++ /dev/null @@ -1,86 +0,0 @@ -pragma Singleton -pragma ComponentBehavior: Bound - -import QtQuick -import Quickshell -import Quickshell.Io -import Quickshell.Wayland -import Quickshell.Hyprland - -/** - * Provides access to some Hyprland data not available in Quickshell.Hyprland. - */ -Singleton { - id: root - property var windowList: [] - property var addresses: [] - property var windowByAddress: ({}) - property var monitors: [] - property var layers: ({}) - - function updateWindowList() { - getClients.running = true - getMonitors.running = true - } - - function updateLayers() { - getLayers.running = true - } - - Component.onCompleted: { - updateWindowList() - updateLayers() - } - - Connections { - target: Hyprland - - function onRawEvent(event) { - // Filter out redundant old v1 events for the same thing - if(event.name in [ - "activewindow", "focusedmon", "monitoradded", - "createworkspace", "destroyworkspace", "moveworkspace", - "activespecial", "movewindow", "windowtitle" - ]) return ; - updateWindowList() - } - } - - Process { - id: getClients - command: ["bash", "-c", "hyprctl clients -j | jq -c"] - stdout: SplitParser { - onRead: (data) => { - root.windowList = JSON.parse(data) - let tempWinByAddress = {} - for (var i = 0; i < root.windowList.length; ++i) { - var win = root.windowList[i] - tempWinByAddress[win.address] = win - } - root.windowByAddress = tempWinByAddress - root.addresses = root.windowList.map((win) => win.address) - } - } - } - - Process { - id: getMonitors - command: ["bash", "-c", "hyprctl monitors -j | jq -c"] - stdout: SplitParser { - onRead: (data) => { - root.monitors = JSON.parse(data) - } - } - } - - Process { - id: getLayers - command: ["bash", "-c", "hyprctl layers -j | jq -c"] - stdout: SplitParser { - onRead: (data) => { - root.layers = JSON.parse(data) - } - } - } -} - diff --git a/README.md b/README.md index 04aa5ca3a..28fdb28e7 100644 --- a/README.md +++ b/README.md @@ -5,11 +5,10 @@
-![](https://img.shields.io/github/last-commit/end-4/dots-hyprland?&style=for-the-badge&color=FFB1C8&logoColor=D9E0EE&labelColor=292324) -![](https://img.shields.io/github/stars/end-4/dots-hyprland?style=for-the-badge&logo=andela&color=FFB686&logoColor=D9E0EE&labelColor=292324) -[![](https://img.shields.io/github/repo-size/end-4/dots-hyprland?color=CAC992&label=SIZE&logo=googledrive&style=for-the-badge&logoColor=D9E0EE&labelColor=292324)](https://github.com/end-4/hyprland) -![](https://img.shields.io/badge/issues-skill-green?style=for-the-badge&color=CCE8E9&logoColor=D9E0EE&labelColor=292324) - +![](https://img.shields.io/github/last-commit/end-4/dots-hyprland?&style=for-the-badge&color=8ad7eb&logo=git&logoColor=D9E0EE&labelColor=1E202B) +![](https://img.shields.io/github/stars/end-4/dots-hyprland?style=for-the-badge&logo=andela&color=86dbd7&logoColor=D9E0EE&labelColor=1E202B) +![](https://img.shields.io/github/repo-size/end-4/dots-hyprland?color=86dbce&label=SIZE&logo=protondrive&style=for-the-badge&logoColor=D9E0EE&labelColor=26230e) + Dynamic JSON Badge
@@ -18,7 +17,6 @@

-
Notable features @@ -64,6 +62,12 @@ - For a more comprehensive list of dependencies, see [scriptdata/dependencies.conf](https://github.com/end-4/dots-hyprland/blob/main/scriptdata/dependencies.conf)
+
+ Discord + Server link | I hope this provides a friendlier environment for support without needing me to personally accept every friend request/DM. For real issues, prefer GitHub + +
+

• screenshots •

@@ -78,6 +82,10 @@ _latest and only style that I actively use. Other past styles are still there fo ### illogical-impulseQuickshell +Widget system: Quickshell | Support: Yes + +[Showcase video](https://www.youtube.com/watch?v=RPwovTInagE) + | AI, settings app | Some widgets | |:---|:---------------| | ![image](https://github.com/user-attachments/assets/4d45e860-ae60-418a-a564-309b4939f5c4) | ![image](https://github.com/user-attachments/assets/4fcd63d9-0943-4b21-8737-4bed97b71961) | @@ -86,33 +94,47 @@ _latest and only style that I actively use. Other past styles are still there fo ### illogical-impulseAGS (Deprecated) +Widget system: AGS | Support: Limited, no new features + | AI | Common widgets | |:---|:---------------| | ![image](https://github.com/user-attachments/assets/9d7af13f-89ef-470d-ba78-d2288b79cf60) | ![image](https://github.com/end-4/dots-hyprland/assets/97237370/406b72b6-fa38-4f0d-a6c4-4d7d5d5ddcb7) | | Window management | Weeb power | | ![image](https://github.com/user-attachments/assets/02983b9b-79ba-4c25-8717-90bef2357ae5) | ![image](https://github.com/user-attachments/assets/bbb332ec-962a-4e88-a95b-486d0bd8ce76) | -### Unsupported stuff +### Very old stuff - Source code not likely to work but still available in the [`archive`](https://github.com/end-4/dots-hyprland/tree/archive) branch. Extremely spaghetti. - Click image for a presentation video #### m3ww + + Widget system: EWW | Support: No, dead + Material Eww! #### NovelKnock + + Widget system: EWW | Support: No, dead + Desktop Preview #### Hybrid + + Widget system: EWW | Support: No, dead + click the circles! #### Windoes + + Widget system: EWW | Support: No, dead + Desktop Preview