repositories / dotfiles

dotfiles

bugabingas dorkfiles

owned by bugabinga

pi: cleanup and new summarize skill

f6fdd54efba7193314eba396aa615a6162fa4dcc

Oliver Jan Krylow <oliver@bugabinga.net> ·

unsigned

Browse filesCompare with HEAD

Changed files (65)

.gitignore

Modified
43 43 **/.qmlls.ini
44 44 .superpowers/
47 46 # Generated/local app state
48 47 yazi/plugins/
49 48 MusicBrainz/.Picard.ini.synclock

Notes

Modified
1 -Subproject commit 4ad2db25611d47630742c817db262b2c53e153f7
1 +Subproject commit eb6ee4d6232a3e265d28be84bc93059e893d47b8

niri/cfg/keybinds.kdl

Modified
32 32 Mod+Shift+Q hotkey-overlay-title="Nuguland: power" {
33 33 spawn "uwsm" "app" "-s" "session-graphical.slice" "--" "qs" "ipc" "-c" "nuguland" "call" "nuguland" "openRegisteredPopout" "power"
35 - Mod+Delete hotkey-overlay-title="Nuguland: dismiss toasts" {
36 - spawn "uwsm" "app" "-s" "session-graphical.slice" "--" "qs" "ipc" "-c" "nuguland" "call" "nuguland" "notificationsDismissToasts"
37 - }
38 35 Mod+TAB hotkey-overlay-title="Niri: Cycle right window" {
39 36 spawn "uwsm" "app" "-s" "session-graphical.slice" "--" "sh" "-c" "niri msg action focus-column-right; niri msg action move-column-to-last; niri msg action focus-window-previous"
170 167 Mod+Ctrl+Shift+S {
171 168 screenshot-screen
173 - // ─── Emergency Escape Key ───
174 - // Use this when a fullscreen app blocks your keybinds.
175 - // It disables any active keyboard shortcut inhibitor, restoring control.
176 - Mod+ESCAPE allow-inhibiting=false {
177 - toggle-keyboard-shortcuts-inhibit
170 + Mod+Escape hotkey-overlay-title="Nuguland: dismiss toasts" allow-inhibiting=false {
171 + spawn "uwsm" "app" "-s" "session-graphical.slice" "--" "qs" "ipc" "-c" "nuguland" "call" "nuguland" "notificationsDismissToasts"
179 173 CTRL+ALT+Delete {

nushell/modules/commands.nu

Modified
5 5 ] {
6 6 job spawn --description $cmd { run-external $cmd ...$args }
9 +export def ci [...args] {
10 + ssh -p 2223 root@ci.bugabinga.net ...$args

pi-ext

Modified
1 -Subproject commit 555d4b694adf28e3db8b133b3b05f02b33306d40
1 +Subproject commit 5dba1a388aec507b26c24952069224a908aa7d11

pi/agent/auth.json

Modified

Previous version contains binary or non-UTF-8 data.

Current version contains binary or non-UTF-8 data.

pi/agent/modes/base.json

Deleted
deleted file mode 100644
1 -{
2 - "name": "base",
3 - "description": "Default mode with standard tools",
4 - "hidden": true,
5 - "tools": ["read", "bash", "edit", "write", "grep", "find", "ls"],
6 - "thinkingLevel": "medium",
7 - "summaryProvider": "minimax",
8 - "summaryModel": "MiniMax-M2.7-highspeed"
9 -}

pi/agent/modes/build.md

Deleted
deleted file mode 100644
1 ----
2 -description: Implement requested changes, verify, report
3 -accent: success
4 -thinking: medium
5 -reminder: Implement requested changes. Keep scope tight, verify work, and report results.
6 ----
8 -# Build mode
10 -You are implementing what the user asked for.
12 -## Posture
14 -- Bias to action. Make the change.
15 -- Keep scope tight. Do not refactor adjacent code, do not add unrequested abstractions.
16 -- Match existing patterns in the repo. Read before write.
17 -- Verify before claiming done. Run the project's tests/lint, exercise the code path.
18 -- Report results: what changed, what was verified, what was not.
20 -## Skills to lean on
22 -- `executing-plans` — step-by-step plan execution.
23 -- `test-driven-development` — test-first implementation.
24 -- `verification-before-completion` — run the project's gate before claiming done.
25 -- `systematic-debugging` — root-cause before fix when something breaks.
26 -- `brutal` — minimal, aggressive, optimal-path coding.
27 -- `requesting-code-review` — review handoff at natural stopping points.
28 -- `receiving-code-review` — apply review feedback precisely.
29 -- `finishing-a-development-branch` — merge/PR/cleanup when the work is done.
30 -- `wiki` — persist useful findings to your knowledge base.
32 -## Workflow
34 -1. Restate the task in one sentence. If ambiguous, ask before editing.
35 -2. Locate the smallest set of files to change.
36 -3. Edit. Prefer surgical edits over rewrites.
37 -4. Run tests, lint, type-check — whatever the repo defines as its gate.
38 -5. Report: changed files (paths + line counts), verification output, follow-ups.
40 -## Boundaries
42 -- Do not commit unless explicitly asked.
43 -- Do not change configuration files (`package.json`, lockfiles, mise.toml, CI) without confirmation.
44 -- Do not leave dead code, commented-out blocks, or TODOs as a substitute for actually fixing things.

pi/agent/modes/ci.json

Deleted
deleted file mode 100644
1 -{
2 - "name": "ci",
3 - "description": "CI/CD pipeline analysis and debugging mode",
4 - "extends": "base",
5 - "tools": ["read", "bash", "grep", "find", "ls"],
6 - "systemPrompt": "You are in CI/CD DEBUG mode. Your job is to analyze build failures, test outputs, and deployment issues.\n\nRules:\n- Read CI config files (.github/workflows/, .gitlab-ci.yml, Jenkinsfile, etc.)\n- Check build logs and error outputs\n- Never modify CI configs without explicit user confirmation\n- Suggest fixes with specific line references\n- If tests fail, identify the failing test and its output\n- Check environment variables and secrets configuration\n\nOutput:\n- Summarize the failure cause\n- Reference specific files and lines\n- Suggest concrete fixes",
7 - "thinkingLevel": "medium"
8 -}

pi/agent/modes/explore.json

Deleted
deleted file mode 100644
1 -{
2 - "name": "explore",
3 - "description": "Project structure and architecture mapping",
4 - "extends": "base",
5 - "tools": ["read", "find", "ls", "grep", "bash"],
6 - "systemPrompt": "You are in EXPLORE mode. Map project structure, identify key files, and understand architecture.\n\nRules:\n- Start with top-level files (README, package.json, Cargo.toml, etc.)\n- Map directory structure and entry points\n- Identify dependencies and their roles\n- Find configuration files and build scripts\n- Never modify files\n\nOutput:\n- Project overview with key directories\n- Entry points and their purposes\n- Dependency map\n- Configuration files found"
7 -}

pi/agent/modes/implement.json

Deleted
deleted file mode 100644
1 -{
2 - "name": "implement",
3 - "description": "Focused implementation mode",
4 - "extends": "base",
5 - "tools": ["read", "bash", "edit", "write"],
6 - "systemPrompt": "You are in IMPLEMENTATION mode. Your job is to make focused, correct changes.\n- Read files before editing to understand current state\n- Make surgical edits. Prefer edit over write for existing files\n- Explain reasoning briefly before each change\n- Run tests or type checks after changes\n- If unexpected complexity, STOP and explain rather than hacking around it",
7 - "thinkingLevel": "medium"
8 -}

pi/agent/modes/plan.md

Deleted
deleted file mode 100644
1 ----
2 -description: Read-only planning with deep thinking and research
3 -accent: warning
4 -thinking: high
5 -tools: [
6 - read,
7 - grep,
8 - find,
9 - ls,
10 - web_fetch,
11 - web_search,
12 - web_map,
13 - understand_image,
14 - git_clone_safe,
15 -]
16 -reminder: Plan only. Do not edit files or run write/build commands.
17 ----
19 -# Planning mode
21 -You are exploring and producing a plan, not implementing.
23 -## Posture
25 -- Read-only. No edits, no builds, no side effects.
26 -- Active tools: file/search (`read`, `grep`, `find`, `ls`), web research (`web_fetch`, `web_search`, `web_map`, `understand_image`), and `git_clone_safe` for inspecting remote repos.
27 -- `bash` is filtered out. Do not assume shell execution.
28 -- Think deeply. High thinking is on.
29 -- Prefer questions and small probes over guesses.
30 -- Surface uncertainty. If something cannot be verified, say so.
32 -## Skills to lean on
34 -- `writing-plans` — produce a structured plan output.
35 -- `writing-roadmaps` — phase-order big work into milestones.
36 -- `brainstorming` — explore intent before locking requirements.
37 -- `research` / `wiki` — web/git/notes research, persisted knowledge.
38 -- `systematic-debugging` — root-cause before fix.
39 -- `checkhealth` — project inventory/orientation.
40 -- `experimentation` — hypothesis-driven probes for unknowns.
41 -- `verification-before-completion` — confirm before claiming a finding.
43 -## Output shape
45 -When asked to plan, produce a plan with these sections:
47 -1. **Goal** — one sentence: what success looks like.
48 -2. **Constraints** — invariants, deps, blast radius, non-goals.
49 -3. **Findings** — what you learned from exploration. Cite files:line.
50 -4. **Approach** — concrete steps. Ordered, testable.
51 -5. **Risks** — what could go wrong, what is unknown.
52 -6. **Verification** — how the user will know it works.
54 -If the task is small, collapse sections. Never invent steps to look thorough.
56 -## Boundaries
58 -- Do not propose edits in this mode. State what would change, not how.
59 -- If implementation is requested, say "out of scope in plan mode" and stop.

pi/agent/modes/research.json

Deleted
deleted file mode 100644
1 -{
2 - "name": "research",
3 - "description": "Deep codebase exploration — read-only, thorough",
4 - "extends": "base",
5 - "tools": ["read", "grep", "find", "ls", "bash"],
6 - "systemPrompt": "You are in RESEARCH mode. Your job is to explore and understand.\n- Read files in full — no offset/limit shortcuts\n- Trace call chains, map architecture\n- Never modify files\n- Return structured findings with file references",
7 - "thinkingLevel": "high"
8 -}

pi/agent/modes/review.json

Deleted
deleted file mode 100644
1 -{
2 - "name": "review",
3 - "description": "Code review mode",
4 - "extends": "base",
5 - "tools": ["read", "grep", "find", "ls", "bash"],
6 - "systemPrompt": "You are in REVIEW mode. Analyze code for bugs, security issues, performance problems, and style violations.\n- Be specific with line numbers and file paths\n- Suggest concrete fixes\n- Flag any assumptions or missing edge cases",
7 - "thinkingLevel": "high"
8 -}

pi/agent/modes/scout.json

Deleted
deleted file mode 100644
1 -{
2 - "name": "scout",
3 - "description": "Parallel reconnaissance and synthesis",
4 - "tools": ["read", "spawn_mode", "switch_mode", "bash"],
5 - "systemPrompt": "You are in SCOUT mode. Delegate parallel exploration via spawn_mode, then synthesize results.\n\nRules:\n- Identify what angles to explore (code, structure, docs)\n- Spawn appropriate modes in parallel via spawn_mode\n- Wait for all results\n- Synthesize: consensus, contradictions, gaps\n- Never do exploration yourself — delegate to specialized modes\n\nOutput:\n- Structured synthesis of parallel results\n- Consensus findings\n- Contradictions flagged\n- Gaps identified for follow-up",
6 - "spawns": [
7 - { "mode": "research", "taskTemplate": "Deep research: {prompt}" },
8 - { "mode": "explore", "taskTemplate": "Map structure: {prompt}" },
9 - { "mode": "web", "taskTemplate": "Search web: {prompt}" }
10 - ],
11 - "aggregation": "Synthesize the following scout results. Identify consensus, contradictions, and gaps. Return a structured summary."
12 -}

pi/agent/modes/web.json

Deleted
deleted file mode 100644
1 -{
2 - "name": "web",
3 - "description": "Web search and external documentation research",
4 - "tools": ["web_fetch", "web_search", "bash"],
5 - "systemPrompt": "You are in WEB mode. Search the web for information, fetch documentation, and summarize findings.\n\nRules:\n- Use web_search for broad queries\n- Use web_fetch for specific pages\n- Cite sources with URLs\n- Focus on official docs, GitHub issues, and Stack Overflow\n- Never execute remote code\n\nOutput:\n- Summarize findings with source URLs\n- Highlight official documentation\n- Note version compatibility\n- Flag any outdated information"
6 -}

pi/agent/settings.json

Modified
2 - "lastChangelogVersion": "0.80.3",
2 + "lastChangelogVersion": "0.80.6",
3 3 "packages": [
5 - "source": "~/Workspace/dotfiles/pi-ext",
6 - "extensions": ["+extensions/mode/index.ts", "+extensions/cmprss/index.ts"]
5 + "source": "~/Workspace/dotfiles/pi-ext"
9 8 "theme": "terminal",
10 - "enabledModels": ["openai-codex/gpt-5.5", "minimax/MiniMax-M3"],
9 + "enabledModels": [
10 + "minimax/MiniMax-M3",
11 + "openai-codex/gpt-5.6-luna",
12 + "openai-codex/gpt-5.6-sol",
13 + "openai-codex/gpt-5.6-terra",
14 + "openai-codex/gpt-5.5"
15 + ],
11 16 "defaultProvider": "openai-codex",
12 - "defaultModel": "gpt-5.5",
17 + "defaultModel": "gpt-5.6-sol",
13 18 "defaultThinkingLevel": "high",
14 19 "quietStartup": false,
15 20 "collapseChangelog": true,
18 23 "showTerminalProgress": true
20 25 "sessionDir": "~/.local/state/pi/sessions",
21 - "hideThinkingBlock": true,
26 + "hideThinkingBlock": false,
22 27 "devil": {
23 - "model": "minimax/MiniMax-M3",
24 - "defenderModel": "openai-codex/gpt-5.5",
25 - "devilThinkingLevel": "medium",
26 - "defenderThinkingLevel": "high",
28 + "model": "openai-codex/gpt-5.6-sol",
29 + "devilThinkingLevel": "xhigh",
30 + "defenderModel": "openai-codex/gpt-5.6-terra",
31 + "defenderThinkingLevel": "medium",
27 32 "synthesisThinkingLevel": "off",
28 - "roleTimeoutMs": 90000
33 + "roleTimeoutMs": 500000
30 35 "angel": {
31 36 "pairs": [
33 - "executor": "minimax/MiniMax-M2.7-highspeed",
34 - "advisor": "openai-codex/gpt-5.5"
38 + "executor": "openai-codex/gpt-5.5",
39 + "advisor": "openai-codex/gpt-5.6-sol"
40 + },
41 + {
42 + "executor": "openai-codex/gpt-5.6-terra",
43 + "advisor": "openai-codex/gpt-5.6-sol"
44 + },
45 + {
46 + "executor": "openai-codex/gpt-5.6-luna",
47 + "advisor": "openai-codex/gpt-5.6-sol"
37 50 "executor": "minimax/MiniMax-M3",
38 - "advisor": "openai-codex/gpt-5.5"
51 + "advisor": "openai-codex/gpt-5.6-sol"
42 55 "sessionRecap": {
43 - "model": "minimax/MiniMax-M2.5-highspeed"
56 + "model": "openai-codex/gpt-5.6-luna"
45 58 "neko": {
46 59 "enabled": true
48 - "npmCommand": ["bun"],
49 61 "fast": {
50 62 "enable": true
64 + "ultra": {
65 + "modelTiers": {
66 + "small": "openai-codex/gpt-5.6-luna",
67 + "medium": "openai-codex/gpt-5.6-terra",
68 + "big": "openai-codex/gpt-5.6-sol"
69 + }
70 + },
52 71 "goal": {
53 - "judgeModel": "minimax/MiniMax-M3"
72 + "judgeModel": "openai-codex/gpt-5.6-sol"
55 74 "tldr": {
56 - "model": "minimax/MiniMax-M2.5-highspeed"
75 + "model": "openai-codex/gpt-5.6-luna"
58 77 "q": {
59 - "model": "minimax/MiniMax-M2.5-highspeed"
78 + "model": "openai-codex/gpt-5.6-luna"
61 80 "cmprss": {
62 - "enabled": true,
63 - "thresholdBytes": 20000,
64 - "maxStoredBlocks": 64,
65 - "status": true,
66 81 "tools": [
67 82 "bash",
68 83 "grep",
74 89 "git_clone_safe"
77 -}

pi/agent/skills/hyperfine/SKILL.md

Added
new file mode 100644
1 +---
2 +name: hyperfine
3 +description: "Use when benchmarking command-line performance: comparing commands, measuring CLI/runtime changes, exporting structured results, or designing reproducible microbenchmarks."
4 +---
6 +# Hyperfine
8 +Use `hyperfine` for command-line benchmarks, not correctness tests.
10 +## Source of truth
12 +Check current local behavior first:
14 +```bash
15 +hyperfine --version
16 +hyperfine --help
17 +man hyperfine
18 +```
20 +Then consult upstream README only for examples/background.
22 +## Minimal useful benchmark
24 +```bash
25 +hyperfine --style basic --warmup 3 --min-runs 10 \
26 + --export-json bench.json \
27 + --export-markdown bench.md \
28 + --command-name 'before' 'cmd before' \
29 + --command-name 'after' 'cmd after'
30 +```
32 +Rules:
34 +1. Benchmark comparable commands with identical inputs, env, cwd, caches, and data.
35 +2. Include a baseline/control; one command alone rarely answers anything.
36 +3. Name the measured workload: cold start, startup+I/O, hot loop, throughput, latency, etc.
37 +4. Use warmups for cache/JIT/startup effects; use `--prepare` for per-run reset.
38 +5. Lifecycle order is: `--setup` once, then for warmups and measured runs `--prepare` → command → `--conclude`, then `--cleanup` once.
39 +6. Avoid sub-5 ms shell noise; prefer `-N`/`--shell=none` for simple direct commands.
40 +7. Do not benchmark interactive flows; make commands non-interactive first.
41 +8. Non-zero exit stops the benchmark; use `--ignore-failure` or `--ignore-failure=CODE` only when failure is expected data.
43 +## Stdio, output, and logs
45 +Defaults matter:
47 +- stdin is `/dev/null`; use `--input FILE` for deterministic input.
48 +- stdout/stderr are suppressed; use `--show-output` only for debugging.
49 +- `--show-output` may conflict with `--style`; drop `--style basic` while debugging output.
50 +- `--output null` is default and may trigger program optimizations.
51 +- Use `--output pipe` when a program behaves differently with `/dev/null`.
52 +- Use `--output inherit` only when intentionally measuring terminal output.
53 +- Use `--output ./file`, not `--output file`; a file target needs a path.
54 +- `--output ./file` is overwritten each run; it is not a per-run log.
55 +- To keep per-run logs, redirect inside the command and include `$HYPERFINE_ITERATION` in the filename.
57 +`$HYPERFINE_ITERATION` is available inside the benchmarked command: `warmup-0`, then `0`, `1`, … for measured runs. Do not rely on it in `--prepare`/`--conclude`.
59 +Example:
61 +```bash
62 +hyperfine --output pipe 'my-cmd < input.txt > "logs/run-${HYPERFINE_ITERATION}.log"'
63 +```
65 +## Shell handling
67 +- Default Unix shell is `/bin/sh`; shell syntax, globs, pipes, redirects, and `&&` need a shell.
68 +- Use `--shell bash --norc` only for Bash-specific syntax/functions.
69 +- Use `-N`/`--shell=none` for direct executable benchmarks; no shell expansion, pipes, redirects, variables, globs, or `&&` syntax occurs.
70 +- With `-N`, shell syntax becomes literal argv; it may silently benchmark the wrong command.
71 +- With `-N`, quote any single argv containing spaces inside the command string, e.g. `"+lua dofile('x.lua')"`.
72 +- Quote commands as single strings so hyperfine receives each benchmark command intact.
74 +## Parameters
76 +Use built-in parameterization instead of hand-written loops:
78 +```bash
79 +hyperfine -P threads 1 8 'make -j {threads}'
80 +hyperfine -P delay 0.3 0.7 -D 0.2 'sleep {delay}'
81 +hyperfine -L mode fast,safe './tool --mode {mode}'
82 +```
84 +Multiple `-L` values produce a Cartesian product; inspect JSON or stdout to verify generated commands.
86 +## Workload-specific controls
88 +- Align semantics first: traversal scope, matching mode, ignore rules, formatting, color, paging, config, and output shape.
89 +- Separate startup, parsing/compilation, rendering, I/O, and steady-state work with no-op and feature-off controls.
90 +- Label what was measured; do not turn a cold-start or UI-rendering result into a throughput claim.
91 +- Simple serial tools can beat richer/parallel tools on small or trivial workloads.
93 +## VM, interpreter, and JIT benchmarks
95 +Cold-start scripts mostly measure process startup, dynamic linking, parser/init cost, and trivial I/O—not peak VM speed.
97 +Controls for VM claims:
99 +- Verify output once with `--show-output` or direct runs before timing.
100 +- Record exact versions, resolved executables, package/build source, binary size, and dynamic libraries (`command -v`, `readlink -f`, `--version`, `ldd`).
101 +- Add a no-op/empty-script control to separate startup from workload.
102 +- Add feature-off controls when available, e.g. JIT disabled, optimizer disabled, config disabled.
103 +- Add a hot-workload control when comparing JIT VMs; trivial scripts may never trigger compilation.
104 +- Report the result as “startup”, “startup+script”, or “hot loop”; never generalize cold-start results to language/VM throughput.
106 +## Structured output
108 +Hyperfine supports structured exports:
110 +- `--export-json FILE`: summary plus individual run timings, seconds.
111 +- `--export-csv FILE`: summary only, seconds.
112 +- `--export-markdown FILE`: user-ready table.
113 +- `--export-asciidoc FILE`, `--export-orgmode FILE`: docs tables.
115 +`--reference`/`--reference-name` improves the stdout relative comparison. Verify exported table semantics locally before claiming a custom reference; Markdown may still present relatives against the fastest command.
117 +JSON fields vary by version; inspect with:
119 +```bash
120 +jq '.results[0] | keys' bench.json
121 +```
123 +Common fields: `command`, `mean`, `stddev`, `median`, `min`, `max`, `times`, `user`, `system`, `exit_codes`.
125 +## Presenting results
127 +Show the Markdown table when possible, then one conclusion sentence. If `--reference` matters, include the stdout “Relative speed comparison” too.
129 +Include:
131 +- command names, not giant command strings; use `--command-name`.
132 +- mean ± stddev, min/max, relative speed.
133 +- run count, warmup count, hyperfine version.
134 +- benchmark context: machine/load, input size, cache state, cwd, relevant env.
135 +- caveat when hyperfine warns about very fast commands or outliers.
137 +Do not overclaim. Say “in this run/context” unless results were repeated independently.
139 +## Safety
141 +- Never print secrets from commands, env, logs, JSON, or Markdown exports.
142 +- Do not run `sudo`, cache-dropping, destructive cleanup, network writes, or production mutations without explicit approval.
143 +- Keep artifacts in a temp or project benchmark dir; delete scratch logs unless promoted.

pi/agent/skills/mise/SKILL.md

Added
new file mode 100644
1 +---
2 +name: mise
3 +description: "Use when editing/diagnosing mise: mise.toml, tools, env vars, tasks, activation, shims, trust, or backends."
4 +---
6 +# Mise
8 +Mise declares project tools, env, and tasks in TOML.
10 +## Model
12 +- Config = system/user/global + project/env files, discovered upward; use `mise config ls`, `-E`.
13 +- Shared config: `mise.toml`; legacy tools: `.tool-versions`; local/secrets: local config.
14 +- `[tools]` requests versions via backends; `[env]` changes env/PATH; `[tasks]` and task files run in mise context.
15 +- `activate` mutates shells; `exec`/`x` wraps one command; shims wrap executables.
16 +- Trust gates env/code effects; inspect directives, hooks, templates, sourced files, plugins/backends.
18 +## Workflow
20 +1. Read config and repo conventions.
21 +2. Ask local CLI first: `mise --help`, `mise <cmd> --help`, `mise doctor`, `mise config ls`, `mise env`, `mise ls`, `mise tasks ls`.
22 +3. Fetch/cite docs for exact syntax, installs, backends, flags, or changed behavior.
23 +4. Probes: prefer `--no-config`; if loading config isolate `MISE_DATA_DIR`/`MISE_CACHE_DIR` and combine `MISE_AUTO_INSTALL=0`, `--dry-run`, `status`, `--path`/`--local`, `--skip-tools --no-deps`.
24 +5. Treat `use`, `settings`, aliases, bootstrap, dotfiles, prune/uninstall/implode as mutating unless dry-run/local.
25 +6. Make the smallest style-matching change; never print secrets from env files or `mise env`.
27 +## Trust
29 +- `mise trust --show` inspects state.
30 +- Never trust real config, trust all, or set trusted paths without explicit approval.
31 +- If blocked, name exact file + risky features; ask before trusting it.
32 +- Auto-trust only isolated temp configs you created.
34 +## More
36 +- Sources: `references/sources.md`.
37 +- Verified shape: `examples/patterns.md`.

pi/agent/skills/mise/examples/patterns.md

Added
new file mode 100644
1 +# Mise Examples
3 +Verified shape; choose real tools/versions from local help/docs. Inspect/trust first. For structure-only checks use `MISE_AUTO_INSTALL=0` and task flags `--skip-tools --no-deps`.
5 +```toml
6 +[env]
7 +EXAMPLE_ENV = "value"
8 +_.path = "relative/bin"
10 +[tasks.check]
11 +description = "Run checks"
12 +run = "echo check-ok"
13 +```
15 +Checks:
17 +```sh
18 +mise env --json
19 +mise tasks ls
20 +mise run --skip-tools --no-deps check
21 +```
23 +Local-only values belong in local config:
25 +```toml
26 +[env]
27 +PRIVATE_OR_MACHINE_LOCAL_VALUE = "local value"
28 +```

pi/agent/skills/mise/references/sources.md

Added
new file mode 100644
1 +# Mise Sources
3 +Use in order:
5 +1. Installed CLI: `mise --help`, `mise <cmd> --help`, `mise doctor`, `mise config ls`, `mise env`, `mise ls`, `mise tasks ls`.
6 +2. LLM docs if present: <https://mise.en.dev/llms.txt>, <https://mise.en.dev/llms-full.txt>.
7 +3. Official docs: <https://mise.en.dev/>, <https://mise.en.dev/cli/>, <https://mise.en.dev/configuration.html>, <https://mise.en.dev/schema/mise.json>.
8 +4. Source when docs/behavior disagree: <https://github.com/jdx/mise>.

pi/agent/skills/summarize/SKILL.md

Added
new file mode 100644
1 +---
2 +name: summarize
3 +description: "Use when converting URLs or local documents (PDF, DOCX, PPTX, HTML, text) into Markdown with uvx markitdown, or when producing focused GPT summaries from those converted documents."
4 +---
6 +# Summarize
8 +Convert URLs and document files into Markdown, then optionally summarize them.
10 +## Use this when
12 +- Fetching a page as document-like Markdown.
13 +- Converting PDF, DOCX, PPTX, HTML, or text files for inspection.
14 +- Producing a short focused summary before deeper reading.
16 +## Rules
18 +- Run commands from this skill directory.
19 +- Always pass summary focus, audience, or extraction goals when using `--summary`.
20 +- Prefer the wrapper when saving output; it prints the full Markdown path.
21 +- Inspect the saved Markdown when exact quotes, numbers, or citations matter.
23 +## Convert only
25 +```bash
26 +node ./to-markdown.mjs <url-or-path> --tmp
27 +```
29 +The command prints the temp Markdown path.
31 +Write a chosen output file:
33 +```bash
34 +node ./to-markdown.mjs <url-or-path> --out /path/to/doc.md
35 +```
37 +Direct `markitdown` use:
39 +```bash
40 +uvx --from 'markitdown[pdf]' markitdown <url-or-path>
41 +```
43 +## Convert and summarize
45 +Default summary model: `openai-codex/gpt-5.4-mini`.
46 +This is the GPT-side replacement for the upstream Haiku use: fast, cheap-ish, enough for extraction summaries.
47 +Override with `--model` or `PI_SUMMARIZE_MODEL`.
49 +```bash
50 +node ./to-markdown.mjs <url-or-path> --summary --prompt "Focus on risks, decisions, owners, and action items for maintainers."
51 +```
53 +With explicit model:
55 +```bash
56 +node ./to-markdown.mjs <url-or-path> --summary --model openai-codex/gpt-5.4-mini --prompt "Extract API endpoints and auth requirements."
57 +```
59 +The wrapper:
61 +1. runs `uvx --from 'markitdown[pdf]' markitdown <input>`
62 +2. saves full Markdown to a temp `.md` file when summarizing
63 +3. runs `pi --model <model> --no-tools --no-session -p <prompt>`
64 +4. prints a final hint with the full Markdown path

pi/agent/skills/summarize/__tests__/to-markdown.test.mjs

Added
new file mode 100644
1 +import assert from "node:assert/strict";
2 +import { describe, it } from "node:test";
4 +const mod = await import("../to-markdown.mjs");
6 +describe("summarize to-markdown helpers", () => {
7 + it("parses GPT model overrides", () => {
8 + assert.deepEqual(
9 + mod.parseArgs([
10 + "doc.pdf",
11 + "--summary",
12 + "--model",
13 + "openai-codex/gpt-5.4-mini",
14 + "--prompt",
15 + "extract risks",
16 + ]),
17 + {
18 + input: "doc.pdf",
19 + outPath: null,
20 + writeTmp: false,
21 + doSummary: true,
22 + summaryPrompt: "extract risks",
23 + model: "openai-codex/gpt-5.4-mini",
24 + },
25 + );
26 + });
28 + it("uses a safe basename for URLs", () => {
29 + assert.equal(
30 + mod.inputBasename("https://example.com/a messy/doc.pdf?x=1"),
31 + "doc.pdf",
32 + );
33 + assert.equal(mod.inputBasename("https://example.com/"), "document");
34 + });
36 + it("builds a bounded summary prompt", () => {
37 + const prompt = mod.summaryPromptFor("a".repeat(200_000), {
38 + mdPath: "/tmp/doc.md",
39 + extraPrompt: "for maintainers",
40 + });
42 + assert.match(prompt, /Open questions \/ missing info/);
43 + assert.match(prompt, /for maintainers/);
44 + assert.match(prompt, /\/tmp\/doc\.md/);
45 + assert.match(prompt, /TRUNCATED/);
46 + assert.ok(prompt.length < 150_000);
47 + });
48 +});

pi/agent/skills/summarize/package.json

Added
new file mode 100644
1 +{
2 + "name": "summarize-skill",
3 + "version": "0.1.0",
4 + "private": true,
5 + "type": "module",
6 + "scripts": {
7 + "test": "node --test __tests__/*.test.mjs"
8 + }
9 +}

pi/agent/skills/summarize/to-markdown.mjs

Added
new file mode 100755
1 +#!/usr/bin/env node
2 +import { spawnSync } from "node:child_process";
3 +import { existsSync, mkdirSync, writeFileSync } from "node:fs";
4 +import { tmpdir } from "node:os";
5 +import { basename, join } from "node:path";
6 +import { pathToFileURL } from "node:url";
8 +const DEFAULT_SUMMARY_MODEL = "openai-codex/gpt-5.4-mini";
9 +const MAX_SUMMARY_CHARS = 140_000;
11 +export function isFlag(value) {
12 + return typeof value === "string" && value.startsWith("--");
15 +export function isUrl(value) {
16 + return /^https?:\/\//i.test(value);
19 +export function safeName(value) {
20 + return (value || "document").replace(/[^a-z0-9._-]+/gi, "_");
23 +export function inputBasename(input) {
24 + if (isUrl(input)) {
25 + const url = new URL(input);
26 + return safeName(basename(url.pathname) || "document");
27 + }
28 + return safeName(basename(input));
31 +export function makeTmpMdPath(input) {
32 + const dir = join(tmpdir(), "pi-summarize-out");
33 + mkdirSync(dir, { recursive: true });
34 + const stamp = Date.now().toString(36);
35 + const rand = Math.random().toString(16).slice(2, 8);
36 + return join(dir, `${inputBasename(input)}-${stamp}-${rand}.md`);
39 +export function parseArgs(argv) {
40 + let input = null;
41 + let outPath = null;
42 + let writeTmp = false;
43 + let doSummary = false;
44 + let summaryPrompt = null;
45 + let model = process.env.PI_SUMMARIZE_MODEL || DEFAULT_SUMMARY_MODEL;
47 + for (let i = 0; i < argv.length; i++) {
48 + const arg = argv[i];
50 + if (arg === "--out") {
51 + outPath = argv[++i] ?? null;
52 + if (!outPath || isFlag(outPath))
53 + throw new Error("Expected a value after --out");
54 + continue;
55 + }
57 + if (arg === "--tmp") {
58 + writeTmp = true;
59 + continue;
60 + }
62 + if (arg === "--model") {
63 + model = argv[++i] ?? null;
64 + if (!model || isFlag(model))
65 + throw new Error("Expected a value after --model");
66 + continue;
67 + }
69 + if (arg === "--prompt" || arg === "--summary-prompt") {
70 + summaryPrompt = argv[++i] ?? null;
71 + if (!summaryPrompt || isFlag(summaryPrompt))
72 + throw new Error(`Expected a value after ${arg}`);
73 + continue;
74 + }
76 + if (arg === "--summary") {
77 + doSummary = true;
78 + const next = argv[i + 1];
79 + if (input && next && !isFlag(next) && summaryPrompt == null) {
80 + summaryPrompt = next;
81 + i++;
82 + }
83 + continue;
84 + }
86 + if (isFlag(arg)) throw new Error(`Unknown flag: ${arg}`);
88 + if (!input) {
89 + input = arg;
90 + } else if (doSummary && summaryPrompt == null) {
91 + summaryPrompt = arg;
92 + } else {
93 + throw new Error(`Unexpected argument: ${arg}`);
94 + }
95 + }
97 + if (!input) throw new Error(usage());
98 + return { input, outPath, writeTmp, doSummary, summaryPrompt, model };
101 +export function usage() {
102 + return "Usage: node to-markdown.mjs <url-or-path> [--out <file>] [--tmp] [--summary [prompt]] [--prompt <prompt>] [--model <pi-model>]";
105 +export function runMarkitdown(input) {
106 + const result = spawnSync(
107 + "uvx",
108 + ["--from", "markitdown[pdf]", "markitdown", input],
110 + encoding: "utf8",
111 + maxBuffer: 50 * 1024 * 1024,
112 + },
113 + );
115 + if (result.error)
116 + throw new Error(`Failed to run uvx markitdown: ${result.error.message}`);
117 + if (result.status !== 0) {
118 + const stderr = (result.stderr || "").trim();
119 + throw new Error(
120 + `markitdown failed for ${input}${stderr ? `\n${stderr}` : ""}`,
121 + );
123 + return result.stdout;
126 +export function summaryPromptFor(
127 + markdown,
128 + { mdPath = null, extraPrompt = null } = {},
129 +) {
130 + let body = markdown;
131 + let truncated = false;
132 + if (body.length > MAX_SUMMARY_CHARS) {
133 + const head = body.slice(0, 110_000);
134 + const tail = body.slice(-20_000);
135 + body = `${head}\n\n[...TRUNCATED ${body.length - head.length - tail.length} chars...]\n\n${tail}`;
136 + truncated = true;
139 + const note = mdPath ? `\n\nGenerated Markdown file: ${mdPath}\n` : "";
140 + const context = extraPrompt
141 + ? `\n\nUser context / instructions:\n${extraPrompt}\n`
142 + : "\n\nNo extra context was provided. Say what focus, audience, or extraction goal would improve this summary.\n";
143 + const truncNote = truncated
144 + ? "\n\nNote: input was truncated due to size."
145 + : "";
147 + return `You are summarizing a document converted to Markdown.${note}${context}
148 +Produce:
149 +- 1 short executive-summary paragraph
150 +- 8-15 bullets with key facts, decisions, requirements, numbers, names, and constraints
151 +- A section titled "Open questions / missing info" with bullets
153 +Be concise. Do not invent facts.${truncNote}
155 +--- BEGIN DOCUMENT (Markdown) ---
156 +${body}
157 +--- END DOCUMENT ---`;
160 +export function summarizeWithPi(
161 + markdown,
162 + { mdPath = null, extraPrompt = null, model = DEFAULT_SUMMARY_MODEL } = {},
163 +) {
164 + const result = spawnSync(
165 + "pi",
167 + "--model",
168 + model,
169 + "--no-tools",
170 + "--no-session",
171 + "-p",
172 + summaryPromptFor(markdown, { mdPath, extraPrompt }),
173 + ],
175 + encoding: "utf8",
176 + maxBuffer: 20 * 1024 * 1024,
177 + timeout: 120_000,
178 + },
179 + );
181 + if (result.error)
182 + throw new Error(`Failed to run pi: ${result.error.message}`);
183 + if (result.status !== 0) {
184 + const stderr = (result.stderr || "").trim();
185 + throw new Error(`pi failed${stderr ? `\n${stderr}` : ""}`);
187 + return (result.stdout || "").trim();
190 +export async function main(argv = process.argv.slice(2)) {
191 + const args = parseArgs(argv);
192 + if (!isUrl(args.input) && !existsSync(args.input))
193 + throw new Error(`File not found: ${args.input}`);
195 + const markdown = runMarkitdown(args.input);
196 + if (args.outPath) writeFileSync(args.outPath, markdown, "utf8");
198 + let tmpMdPath = null;
199 + if (args.writeTmp || args.doSummary) {
200 + tmpMdPath = makeTmpMdPath(args.input);
201 + writeFileSync(tmpMdPath, markdown, "utf8");
204 + if (args.writeTmp && tmpMdPath && !args.doSummary && !args.outPath) {
205 + console.log(tmpMdPath);
206 + return;
209 + if (args.doSummary) {
210 + const summary = summarizeWithPi(markdown, {
211 + mdPath: tmpMdPath ?? args.outPath,
212 + extraPrompt: args.summaryPrompt,
213 + model: args.model,
214 + });
215 + process.stdout.write(summary);
216 + if (tmpMdPath)
217 + process.stdout.write(
218 + `\n\n[Hint: Full document Markdown saved to: ${tmpMdPath}]\n`,
219 + );
220 + return;
223 + process.stdout.write(markdown);
226 +if (import.meta.url === pathToFileURL(process.argv[1]).href) {
227 + main().catch((error) => {
228 + console.error(error?.message || String(error));
229 + if (error?.message !== usage()) console.error(usage());
230 + process.exit(1);
231 + });

pi/agent/skills/wiki/SKILL.md

Modified
21 21 │ ├── files/ # local files copied for ingestion
22 22 │ ├── text/ # pasted/session text
23 23 │ ├── archives/ # downloaded/extracted archives
24 -│ └── legacy-research/ # migrated ~/.pi/research items
25 24 └── <topic>/ # compiled knowledge pages
30 29 1. **Gate on initialization before touching wiki files.** Skill loaded ≠ user initialized the wiki.
31 30 2. **Read `SCHEMA.md` only after proving it exists.** Do not call `read` on a guessed schema path.
32 31 3. **Raw sources are immutable.** Never edit after registration; append a new source instead.
33 -4. **Check before fetching.** Search `~/Notes/Wiki/` and legacy `~/.pi/research/` before downloading/cloning.
32 +4. **Check before fetching.** Search `~/Notes/Wiki/` before downloading/cloning.
34 33 5. **Local first.** Search registered raw sources before using network.
35 34 6. **One compiled file per concept.** Use `kebab-case.md` in the appropriate topic dir.
36 35 7. **Cross-reference.** Every compiled page links ≥2 related pages via `[[wikilinks]]` when possible.
61 60 files/project.path.to.file.2026-05-30.md
62 61 text/session-topic.2026-05-30.md
63 62 archives/example.com.release.2026-05-30/
64 -legacy-research/github.com.user.repo/
67 65 Prefer `{host}.{path-or-owner-repo}.{branch-or-topic}.{date}`. Include original URL/path, fetch date, command/tool used, and brief notes in `raw-sources/index.md`.
111 109 mkdir -p ~/Notes/Wiki/raw-sources/files
112 110 mkdir -p ~/Notes/Wiki/raw-sources/text
113 111 mkdir -p ~/Notes/Wiki/raw-sources/archives
114 -mkdir -p ~/Notes/Wiki/raw-sources/legacy-research
117 114 Create missing files only; never overwrite existing content:
140 137 ### Ingest (`/wiki ingest <source>`)
142 -Source can be a URL, repository URL, archive URL, file path, directory, pasted text, or legacy `~/.pi/research` item.
139 +Source can be a URL, repository URL, archive URL, file path, directory, pasted text.
144 -1. **Classify** source: web | repo | archive | file | text | legacy.
141 +1. **Classify** source: web | repo | archive | file | text.
145 142 2. **Check existing** `raw-sources/index.md`, filenames, and `~/.pi/research/` for matching source.
146 143 3. **Preflight risky sources**:
147 144 - URLs: allow public `http(s)` URLs by default. Private/internal URLs require explicit approval, with warning first; examples include localhost, loopback, RFC1918/private IPs, and `169.254.169.254`. Reject credentialed URLs and `file://` URLs by default.
154 151 - Archives: download to `raw-sources/archives/`, extract into a dated subdir only after preflight, keep original archive when practical.
155 152 - Files/dirs: copy into `raw-sources/files/`; do not mutate the copy.
156 153 - Text: save pasted/session text under `raw-sources/text/`.
157 - - Legacy: copy relevant `~/.pi/research/{pages,repos,extracts}` item into `raw-sources/legacy-research/`; do not delete legacy data.
158 154 6. **Inspect locally** with `rg`, `find`, `read`, etc. before more network calls.
159 155 7. **Compile** into focused pages under `<topic>/`. Update existing pages when concepts overlap.
160 156 8. **Cross-link** related pages and cite raw source IDs.
203 199 | API JSON/text | `web_fetch` or `curl -sL` | browser/tool-specific fetch |
204 200 | External repo | `git_clone_safe URL raw-sources/repos/name` | user-approved safe shallow/sparse clone |
205 201 | Large repo | safe shallow/sparse/partial clone | ingest only relevant files/docs |
206 -| Existing old research | copy from `~/.pi/research/` | cite legacy path if copying is too large |
208 203 ## Search patterns
214 209 # Registered sources
215 210 rg -i -F --max-filesize 1M -- "$query" ~/Notes/Wiki/raw-sources/
217 -# Legacy research cache
218 -rg -i -F --max-filesize 1M -- "$query" ~/.pi/research/ 2>/dev/null
220 212 # Repo source with context
221 213 rg -n -A2 -B2 -F --max-filesize 1M -- "$query" ~/Notes/Wiki/raw-sources/repos/<repo>/
224 216 rg -s --max-filesize 1M ">([^<]*pattern[^<]*)<" ~/Notes/Wiki/raw-sources/web/
227 -## Legacy research migration
229 -Old research lived in `~/.pi/research/{pages,repos,extracts}`. It is now a cache of historical raw sources.
231 -When relevant:
233 -1. Search it before fetching new data.
234 -2. Copy useful items into `~/Notes/Wiki/raw-sources/legacy-research/` or cite the legacy path if too large.
235 -3. Register copied/cited items in `raw-sources/index.md`.
236 -4. Compile durable concepts into normal topic pages.
237 -5. Do **not** delete `~/.pi/research/` by default.
239 219 ## Wikilink convention
241 221 `[[topic/page-name]]` resolves to `~/Notes/Wiki/topic/page-name.md`.

quickshell/nuguland/AudioPanel.qml

Modified
87 87 width: parent.width
88 88 spacing: 10
90 - // output devices (sinks). solid-dark cards — the popup frame is light,
91 - // so a translucent tint fill washes to near-white. Identity is carried
92 - // by the left accent bar + border; default = ui.accent.
90 + // output devices (sinks). shared cards carry default/revealed state.
93 91 Column {
94 92 objectName: "outputSection"
95 93 width: parent.width
117 115 width: parent.width
118 116 spacing: 4
120 - Rectangle {
118 + PopupCard {
119 + theme: root.theme
120 + padding: 0
121 + active: sinkRow.modelData.isDefault
122 + revealed: sinkRow.revealed
123 + hoverable: true
124 + externallyPressed: sinkArea.pressed
121 125 width: parent.width
122 126 height: 48
123 - radius: 12
124 - color: root.theme ? root.theme.withAlpha(root.theme.ui.backdrop, sinkRow.modelData.isDefault ? 0.82 : 0.55) : "transparent"
125 - border.width: (sinkRow.modelData.isDefault || sinkRow.revealed) ? 2 : 1
126 - border.color: root.theme ? (sinkRow.modelData.isDefault ? root.theme.ui.accent : (sinkRow.revealed ? root.theme.withAlpha(root.theme.ui.accent, 0.6) : root.theme.withAlpha(root.theme.ui.minor, 0.45))) : "transparent"
128 - // tap the device (glyph/name area) opens its options drawer;
129 - // the slider-track MouseArea (later sibling, higher z) wins on
130 - // the track region so dragging volume never opens the drawer.
131 128 MouseArea {
129 + id: sinkArea
132 130 anchors.fill: parent
131 + hoverEnabled: true
132 + cursorShape: Qt.PointingHandCursor
133 133 onClicked: root.expandedSink = sinkRow.revealed ? "" : sinkRow.modelData.id
136 - // left accent bar — only on the default device
137 - Rectangle {
138 - anchors.left: parent.left
139 - anchors.top: parent.top
140 - anchors.bottom: parent.bottom
141 - anchors.margins: 2
142 - width: 3
143 - radius: 2
144 - color: root.theme ? root.theme.ui.accent : "transparent"
145 - opacity: sinkRow.modelData.isDefault ? 1 : 0
146 - }
148 136 Text {
149 137 id: sinkGlyph
182 170 color: root.roleColor(sinkRow.modelData.muted ? "ui.minor" : sinkRow.modelData.role)
185 - // inline slider: 0..1.5 volume mapped onto the track (percent/150)
186 - Rectangle {
173 + PopupSlider {
187 174 id: sinkTrack
189 176 anchors.right: sinkTrailing.left
190 177 anchors.rightMargin: 10
191 178 anchors.verticalCenter: parent.verticalCenter
179 + theme: root.theme
192 180 width: 96
193 - height: 8
194 - radius: 4
195 - color: root.theme ? root.theme.withAlpha(root.theme.ui.minor, 0.28) : "transparent"
197 - Rectangle {
198 - anchors.left: parent.left
199 - anchors.top: parent.top
200 - anchors.bottom: parent.bottom
201 - width: parent.width * (sinkRow.modelData.percent / 150)
202 - radius: parent.radius
203 - color: root.roleColor(sinkRow.modelData.role)
204 - visible: !sinkRow.modelData.muted
205 - }
207 - MouseArea {
208 - anchors.fill: parent
209 - onClicked: event => {
210 - return root.setVolume(sinkRow.modelData.id, event.x / Math.max(1, width) * 1.5);
211 - }
212 - onPositionChanged: event => {
213 - if (pressed)
214 - root.setVolume(sinkRow.modelData.id, event.x / Math.max(1, width) * 1.5);
215 - }
216 - }
181 + value: sinkRow.modelData.muted ? 0 : sinkRow.modelData.percent / 150
182 + onMoved: value => root.setVolume(sinkRow.modelData.id, value * 1.5)
220 186 // device options drawer: set-default + mute. PipeWire
221 187 // exposes no port/profile routing, so those aren't offered.
222 - Rectangle {
188 + PopupCard {
223 189 visible: sinkRow.revealed
190 + theme: root.theme
191 + padding: 0
192 + revealed: true
224 193 width: parent.width
225 194 height: visible ? sinkOpts.height + 16 : 0
226 - radius: 10
227 - color: root.theme ? root.theme.withAlpha(root.theme.ui.backdrop, 0.55) : "#333333"
228 - border.width: 1
229 - border.color: root.theme ? root.theme.withAlpha(root.theme.ui.accent, 0.4) : "white"
230 - clip: true
233 197 id: sinkOpts
237 201 spacing: 8
239 - Rectangle {
203 + PopupButton {
240 204 visible: !sinkRow.modelData.isDefault
205 + theme: root.theme
241 206 width: 110
242 207 height: 28
243 - radius: 9
244 - color: root.theme ? root.theme.withAlpha(root.theme.ui.accent, 0.18) : "transparent"
245 - border.width: 1
246 - border.color: root.theme ? root.theme.withAlpha(root.theme.ui.accent, 0.7) : "white"
248 - NuguText {
249 - anchors.centerIn: parent
250 - theme: root.theme
251 - variant: "meta"
252 - text: "set default"
253 - }
255 - MouseArea {
256 - anchors.fill: parent
257 - onClicked: {
258 - root.expandedSink = "";
259 - root.selectSink(sinkRow.modelData.id);
260 - }
208 + text: "set default"
209 + role: "primary"
210 + onClicked: {
211 + root.expandedSink = "";
212 + root.selectSink(sinkRow.modelData.id);
264 - Rectangle {
216 + PopupButton {
217 + theme: root.theme
265 218 width: 92
266 219 height: 28
267 - radius: 9
268 - color: root.theme ? root.theme.withAlpha(sinkRow.modelData.muted ? root.theme.warning : root.theme.ui.accent, 0.18) : "transparent"
269 - border.width: 1
270 - border.color: root.theme ? root.theme.withAlpha(sinkRow.modelData.muted ? root.theme.warning : root.theme.ui.accent, 0.7) : "white"
272 - NuguText {
273 - anchors.centerIn: parent
274 - theme: root.theme
275 - variant: "meta"
276 - text: sinkRow.modelData.muted ? "unmute" : "mute"
277 - }
279 - MouseArea {
280 - anchors.fill: parent
281 - onClicked: root.toggleMute(sinkRow.modelData.id)
282 - }
220 + text: sinkRow.modelData.muted ? "unmute" : "mute"
221 + checked: sinkRow.modelData.muted
222 + onClicked: root.toggleMute(sinkRow.modelData.id)
316 256 width: parent.width
317 257 spacing: 4
319 - Rectangle {
259 + PopupCard {
260 + theme: root.theme
261 + padding: 0
262 + active: sourceRow.modelData.isDefault
263 + revealed: sourceRow.revealed
264 + hoverable: true
265 + externallyPressed: sourceArea.pressed
320 266 width: parent.width
321 267 height: 48
322 - radius: 12
323 - color: root.theme ? root.theme.withAlpha(root.theme.ui.backdrop, sourceRow.modelData.isDefault ? 0.82 : 0.55) : "transparent"
324 - border.width: (sourceRow.modelData.isDefault || sourceRow.revealed) ? 2 : 1
325 - border.color: root.theme ? (sourceRow.modelData.isDefault ? root.theme.ui.accent : (sourceRow.revealed ? root.theme.withAlpha(root.theme.ui.accent, 0.6) : root.theme.withAlpha(root.theme.ui.minor, 0.45))) : "transparent"
327 269 MouseArea {
270 + id: sourceArea
328 271 anchors.fill: parent
272 + hoverEnabled: true
273 + cursorShape: Qt.PointingHandCursor
329 274 onClicked: root.expandedSource = sourceRow.revealed ? "" : sourceRow.modelData.id
332 - Rectangle {
333 - anchors.left: parent.left
334 - anchors.top: parent.top
335 - anchors.bottom: parent.bottom
336 - anchors.margins: 2
337 - width: 3
338 - radius: 2
339 - color: root.theme ? root.theme.ui.accent : "transparent"
340 - opacity: sourceRow.modelData.isDefault ? 1 : 0
341 - }
343 277 Text {
344 278 id: sourceGlyph
377 311 color: root.roleColor(sourceRow.modelData.muted ? "ui.minor" : sourceRow.modelData.role)
380 - Rectangle {
314 + PopupSlider {
381 315 id: sourceTrack
383 317 anchors.right: sourceTrailing.left
384 318 anchors.rightMargin: 10
385 319 anchors.verticalCenter: parent.verticalCenter
320 + theme: root.theme
386 321 width: 96
387 - height: 8
388 - radius: 4
389 - color: root.theme ? root.theme.withAlpha(root.theme.ui.minor, 0.28) : "transparent"
391 - Rectangle {
392 - anchors.left: parent.left
393 - anchors.top: parent.top
394 - anchors.bottom: parent.bottom
395 - width: parent.width * (sourceRow.modelData.percent / 150)
396 - radius: parent.radius
397 - color: root.roleColor(sourceRow.modelData.role)
398 - visible: !sourceRow.modelData.muted
399 - }
401 - MouseArea {
402 - anchors.fill: parent
403 - onClicked: event => {
404 - return root.setVolume(sourceRow.modelData.id, event.x / Math.max(1, width) * 1.5);
405 - }
406 - onPositionChanged: event => {
407 - if (pressed)
408 - root.setVolume(sourceRow.modelData.id, event.x / Math.max(1, width) * 1.5);
409 - }
410 - }
322 + value: sourceRow.modelData.muted ? 0 : sourceRow.modelData.percent / 150
323 + onMoved: value => root.setVolume(sourceRow.modelData.id, value * 1.5)
414 327 // device options drawer: set-default + mute. PipeWire
415 328 // exposes no port/profile routing, so those aren't offered.
416 - Rectangle {
329 + PopupCard {
417 330 visible: sourceRow.revealed
331 + theme: root.theme
332 + padding: 0
333 + revealed: true
418 334 width: parent.width
419 335 height: visible ? sourceOpts.height + 16 : 0
420 - radius: 10
421 - color: root.theme ? root.theme.withAlpha(root.theme.ui.backdrop, 0.55) : "#333333"
422 - border.width: 1
423 - border.color: root.theme ? root.theme.withAlpha(root.theme.ui.accent, 0.4) : "white"
424 - clip: true
427 338 id: sourceOpts
431 342 spacing: 8
433 - Rectangle {
344 + PopupButton {
434 345 visible: !sourceRow.modelData.isDefault
346 + theme: root.theme
435 347 width: 110
436 348 height: 28
437 - radius: 9
438 - color: root.theme ? root.theme.withAlpha(root.theme.ui.accent, 0.18) : "transparent"
439 - border.width: 1
440 - border.color: root.theme ? root.theme.withAlpha(root.theme.ui.accent, 0.7) : "white"
442 - NuguText {
443 - anchors.centerIn: parent
444 - theme: root.theme
445 - variant: "meta"
446 - text: "set default"
447 - }
449 - MouseArea {
450 - anchors.fill: parent
451 - onClicked: {
452 - root.expandedSource = "";
453 - root.selectSource(sourceRow.modelData.id);
454 - }
349 + text: "set default"
350 + role: "primary"
351 + onClicked: {
352 + root.expandedSource = "";
353 + root.selectSource(sourceRow.modelData.id);
458 - Rectangle {
357 + PopupButton {
358 + theme: root.theme
459 359 width: 92
460 360 height: 28
461 - radius: 9
462 - color: root.theme ? root.theme.withAlpha(sourceRow.modelData.muted ? root.theme.warning : root.theme.ui.accent, 0.18) : "transparent"
463 - border.width: 1
464 - border.color: root.theme ? root.theme.withAlpha(sourceRow.modelData.muted ? root.theme.warning : root.theme.ui.accent, 0.7) : "white"
466 - NuguText {
467 - anchors.centerIn: parent
468 - theme: root.theme
469 - variant: "meta"
470 - text: sourceRow.modelData.muted ? "unmute" : "mute"
471 - }
473 - MouseArea {
474 - anchors.fill: parent
475 - onClicked: root.toggleMute(sourceRow.modelData.id)
476 - }
361 + text: sourceRow.modelData.muted ? "unmute" : "mute"
362 + checked: sourceRow.modelData.muted
363 + onClicked: root.toggleMute(sourceRow.modelData.id)

quickshell/nuguland/Bar.qml

Modified
21 21 required property Network networkService
22 22 required property Bluetooth bluetoothService
23 23 required property Power powerService
24 + required property Privilege privilegeService
24 25 required property Idle idleService
25 26 required property Lock lockService
26 27 required property Noko nokoService
419 420 networkService: root.networkService
420 421 bluetoothService: root.bluetoothService
421 422 powerService: root.powerService
423 + privilegeService: root.privilegeService
422 424 lockService: root.lockService
423 425 nokoService: root.nokoService
424 426 barWindow: root

quickshell/nuguland/Bluetooth.qml

Modified
8 8 property string error: ""
9 9 property var lastAction: ({})
10 + property int refreshTicks: 0
11 + signal refreshed
10 12 readonly property string nativeApi: "Quickshell.Bluetooth.Bluetooth.defaultAdapter BluetoothAdapter BluetoothDevice"
11 13 readonly property var boundedActions: ["scan", "toggle", "connect", "disconnect", "pair", "forget", "trust", "block"]
12 14 readonly property bool nativeActionRoute: true
140 142 return JSON.stringify(stateObject());
145 + function scheduleRefresh() {
146 + refreshTicks = 8;
147 + refreshTimer.restart();
143 150 function scan() {
144 151 const adapter = nativeAdapter();
145 152 const wasEnabled = adapterEnabled();
154 161 "poweredBeforeScan": wasEnabled,
155 162 "nativeActionRoute": nativeActionRoute
164 + scheduleRefresh();
157 165 return stateJson();
169 177 "enabled": adapterEnabled(),
170 178 "nativeActionRoute": nativeActionRoute
180 + scheduleRefresh();
172 181 return stateJson();
207 216 "id": deviceIdValue,
208 217 "nativeActionRoute": nativeActionRoute
219 + scheduleRefresh();
210 220 return stateJson();
223 + Timer {
224 + id: refreshTimer
225 + interval: 500
226 + repeat: true
227 + onTriggered: {
228 + root.refreshed();
229 + root.refreshTicks -= 1;
230 + if (root.refreshTicks <= 0)
231 + stop();

quickshell/nuguland/BrightnessPanel.qml

Modified
69 69 height: 1
72 - Rectangle {
72 + PopupButton {
73 73 id: setupButton
74 + theme: root.theme
75 75 width: 112
76 76 height: 34
77 - radius: 12
78 - color: root.theme ? root.theme.withAlpha(root.theme.ui.accent, setupArea.containsMouse ? 0.34 : 0.24) : "transparent"
79 - border.width: 1
80 - border.color: root.theme ? root.theme.ui.accent : "white"
82 - NuguText {
83 - anchors.centerIn: parent
84 - theme: root.theme
85 - variant: "meta"
86 - text: "setup ddc"
87 - color: root.theme ? root.theme.content.normal : "white"
88 - }
90 - MouseArea {
91 - id: setupArea
93 - anchors.fill: parent
94 - hoverEnabled: true
95 - cursorShape: Qt.PointingHandCursor
96 - onClicked: if (root.brightnessService)
97 - root.refreshFrom(root.brightnessService.setupDdc())
98 - }
77 + text: "setup ddc"
78 + role: "primary"
79 + onClicked: if (root.brightnessService)
80 + root.refreshFrom(root.brightnessService.setupDdc())
102 - Rectangle {
103 - id: globalTrack
84 + PopupCard {
105 85 width: parent.width
106 86 height: root.hasGlobal ? 64 : 0
107 87 visible: root.hasGlobal
108 - radius: 16
109 - color: root.theme ? root.theme.withAlpha(root.theme.ui.minor, 0.12) : "transparent"
110 - border.width: 1
111 - border.color: root.theme ? root.theme.withAlpha(root.theme.ui.minor, 0.42) : "white"
112 - clip: true
88 + theme: root.theme
114 - Repeater {
115 - model: root.global.mode === "mixed" ? root.global.levels : [root.global.level]
117 - delegate: Rectangle {
118 - id: globalLine
120 - required property int index
121 - required property real modelData
122 - readonly property int lineCount: root.global.mode === "mixed" ? Math.max(1, root.global.levels.length) : 1
124 - x: 0
125 - y: Math.round(index * globalTrack.height / lineCount)
126 - width: globalTrack.width
127 - height: Math.ceil(globalTrack.height / lineCount)
128 - color: root.theme ? root.theme.withAlpha(root.theme.ui.minor, 0.18) : "transparent"
130 - Rectangle {
131 - width: Math.round(parent.width * Math.max(0, Math.min(1, globalLine.modelData)))
132 - height: parent.height
133 - color: root.theme ? root.theme.ui.accent : "white"
134 - }
135 - }
136 - }
138 - MouseArea {
139 - anchors.fill: parent
140 - hoverEnabled: true
141 - cursorShape: Qt.PointingHandCursor
142 - onPressed: mouse => root.setAllAt(mouse.x, width)
143 - onPositionChanged: mouse => {
144 - if (pressed)
145 - root.setAllAt(mouse.x, width);
90 + PopupSlider {
91 + anchors.left: parent.left
92 + anchors.right: parent.right
93 + anchors.verticalCenter: parent.verticalCenter
94 + theme: root.theme
95 + value: Number(root.global.level || 0)
96 + onMoved: value => {
97 + if (root.brightnessService)
98 + root.refreshFrom(root.brightnessService.setAll(value));
159 112 Repeater {
160 113 model: [0.25, 0.5, 0.75, 1]
162 - delegate: Rectangle {
115 + delegate: PopupButton {
163 116 id: preset
165 118 required property real modelData
120 + theme: root.theme
167 121 width: Math.floor((presetGrid.width - presetGrid.columnSpacing * (presetGrid.columns - 1)) / presetGrid.columns)
168 122 height: 36
169 - radius: 12
170 - color: root.theme ? root.theme.withAlpha(root.theme.ui.minor, presetArea.containsMouse ? 0.18 : 0.11) : "transparent"
171 - border.width: 1
172 - border.color: root.theme ? root.theme.withAlpha(root.theme.ui.minor, 0.4) : "white"
174 - NuguText {
175 - anchors.centerIn: parent
176 - theme: root.theme
177 - variant: "meta"
178 - text: `${Math.round(preset.modelData * 100)}%`
179 - color: root.theme ? root.theme.content.normal : "white"
180 - }
182 - MouseArea {
183 - id: presetArea
185 - anchors.fill: parent
186 - hoverEnabled: true
187 - cursorShape: Qt.PointingHandCursor
188 - onClicked: if (root.brightnessService)
189 - root.refreshFrom(root.brightnessService.setAll(preset.modelData))
190 - }
123 + text: `${Math.round(preset.modelData * 100)}%`
124 + onClicked: if (root.brightnessService)
125 + root.refreshFrom(root.brightnessService.setAll(preset.modelData))
199 134 Repeater {
200 135 model: root.displays
202 - delegate: Rectangle {
137 + delegate: PopupCard {
203 138 id: displayRow
140 + theme: root.theme
141 + padding: 0
205 143 required property var modelData
206 144 readonly property bool controllable: !!modelData.controllable
207 145 readonly property string issue: String(modelData.issue || "")
210 148 width: root.width
211 149 height: 38
212 - radius: 12
213 - color: root.theme ? root.theme.withAlpha(root.theme.ui.minor, controllable ? 0.1 : 0.07) : "transparent"
214 - border.width: 1
215 - border.color: root.theme ? root.theme.withAlpha(issue.length > 0 ? root.theme.warning : root.theme.ui.minor, issue.length > 0 ? 0.48 : 0.32) : "white"
216 - opacity: controllable ? 1 : 0.74
150 + attention: issue.length > 0
151 + enabled: controllable
218 153 NuguText {
219 154 id: displayName
228 163 elide: Text.ElideRight
231 - Rectangle {
166 + PopupSlider {
232 167 id: displaySlider
234 169 anchors.left: displayName.right
236 171 anchors.right: displayPercent.left
237 172 anchors.rightMargin: 10
238 173 anchors.verticalCenter: parent.verticalCenter
239 - height: 18
240 - radius: 9
241 - color: root.theme ? root.theme.withAlpha(root.theme.ui.minor, 0.16) : "transparent"
242 - border.width: 1
243 - border.color: root.theme ? root.theme.withAlpha(root.theme.ui.minor, 0.32) : "white"
244 - clip: true
246 - Rectangle {
247 - width: Math.round(parent.width * displayRow.level)
248 - height: parent.height
249 - radius: parent.radius
250 - color: root.theme ? (displayRow.controllable ? root.theme.ui.accent : root.theme.ui.minor) : "white"
251 - }
253 - MouseArea {
254 - anchors.fill: parent
255 - enabled: displayRow.controllable
256 - hoverEnabled: true
257 - cursorShape: Qt.PointingHandCursor
258 - onPressed: mouse => root.setDisplayAt(String(displayRow.modelData.id || ""), mouse.x, width)
259 - onPositionChanged: mouse => {
260 - if (pressed)
261 - root.setDisplayAt(String(displayRow.modelData.id || ""), mouse.x, width);
262 - }
263 - }
174 + theme: root.theme
175 + enabled: displayRow.controllable
176 + value: displayRow.level
177 + onMoved: value => root.setDisplayAt(String(displayRow.modelData.id || ""), value, 1)
266 180 NuguText {

quickshell/nuguland/ClipboardPanel.qml

Modified
63 63 width: parent.width
64 64 spacing: 8
66 - Rectangle {
66 + PopupTextField {
67 67 objectName: "searchField"
68 + theme: root.theme
68 69 width: parent.width - 108
69 70 height: 32
70 - radius: 12
71 - color: root.theme ? root.theme.withAlpha(root.theme.ui.minor, 0.14) : "transparent"
72 - border.width: 0
73 - border.color: root.theme ? root.theme.ui.accent : "transparent"
75 - Text {
76 - id: searchGlyph
78 - anchors.left: parent.left
79 - anchors.leftMargin: 11
80 - anchors.verticalCenter: parent.verticalCenter
81 - text: ""
82 - color: root.theme ? root.theme.ui.minor : "white"
83 - font.family: "Symbols Nerd Font Mono"
84 - font.pixelSize: 13
85 - }
87 - TextInput {
88 - id: input
90 - anchors.fill: parent
91 - anchors.leftMargin: 32
92 - anchors.rightMargin: 12
93 - verticalAlignment: TextInput.AlignVCenter
94 - color: root.theme ? root.theme.content.normal : "white"
95 - selectionColor: root.theme ? root.theme.ui.focus : "#ffffff"
96 - selectedTextColor: root.theme ? root.theme.content.backdrop : "black"
97 - font.family: "IBM Plex Sans"
98 - font.pixelSize: 13
99 - text: root.query
100 - clip: true
101 - onTextEdited: root.search(text)
102 - }
104 - NuguText {
105 - anchors.left: parent.left
106 - anchors.leftMargin: 32
107 - anchors.verticalCenter: parent.verticalCenter
108 - visible: input.text.length === 0
109 - theme: root.theme
110 - variant: "meta"
111 - text: "search clipboard"
112 - }
71 + icon: ""
72 + placeholderText: "search clipboard"
73 + text: root.query
74 + onEdited: text => root.search(text)
115 - Rectangle {
77 + PopupButton {
116 78 objectName: "privateModeChip"
79 + theme: root.theme
117 80 width: 100
118 81 height: 32
119 - radius: 12
120 - color: root.theme ? root.theme.withAlpha(root.panelState.privateMode ? root.theme.warning : root.theme.ui.accent, 0.2) : "transparent"
121 - border.width: 0
122 - border.color: root.theme ? (root.panelState.privateMode ? root.theme.warning : root.theme.ui.accent) : "transparent"
124 - Row {
125 - anchors.centerIn: parent
126 - spacing: 6
128 - Text {
129 - anchors.verticalCenter: parent.verticalCenter
130 - text: root.panelState.privateMode ? "" : ""
131 - color: root.theme ? (root.panelState.privateMode ? root.theme.warning : root.theme.ui.accent) : "white"
132 - font.family: "Symbols Nerd Font Mono"
133 - font.pixelSize: 13
134 - }
136 - NuguText {
137 - anchors.verticalCenter: parent.verticalCenter
138 - theme: root.theme
139 - variant: "meta"
140 - text: root.panelState.privateMode ? "private" : "normal"
141 - }
142 - }
144 - MouseArea {
145 - anchors.fill: parent
146 - onClicked: root.setPrivateMode(!root.panelState.privateMode)
147 - }
82 + icon: root.panelState.privateMode ? "" : ""
83 + text: root.panelState.privateMode ? "private" : "normal"
84 + checked: root.panelState.privateMode
85 + onClicked: root.setPrivateMode(!root.panelState.privateMode)
151 - Rectangle {
89 + PopupCard {
152 90 objectName: "clipboardHistoryPanel"
91 + theme: root.theme
92 + padding: 0
153 93 width: parent.width
154 94 height: Math.min(440, Math.max(120, rowColumn.implicitHeight + 16))
155 - radius: 14
156 - clip: true
157 - color: root.theme ? root.theme.withAlpha(root.theme.ui.backdrop, 0.7) : "transparent"
158 - border.width: 0
159 - border.color: root.theme ? root.theme.ui.accent : "transparent"
161 96 Flickable {
162 97 id: list
176 111 Repeater {
177 112 model: root.rows
179 - delegate: Rectangle {
114 + delegate: PopupCard {
180 115 id: clipRow
117 + theme: root.theme
118 + padding: 0
119 + active: modelData.pinned
182 121 required property var modelData
184 123 objectName: "clipRow"
185 124 width: rowColumn.width
186 125 height: 56
187 - radius: 13
188 - color: root.theme ? root.theme.withAlpha(clipRow.modelData.pinned ? root.theme.ui.focus : root.theme.ui.minor, clipRow.modelData.pinned ? 0.22 : 0.1) : "transparent"
189 - border.width: clipRow.modelData.pinned ? 1 : 0
190 - border.color: root.theme ? root.theme.withAlpha(root.theme.ui.focus, 0.5) : "transparent"
192 127 // Single hover detector covering the whole card. NoButton
193 128 // lets clicks fall through to the action buttons (later
308 243 Repeater {
309 244 model: ["copy", "paste", "pin", "delete"]
311 - delegate: Rectangle {
246 + delegate: PopupButton {
312 247 id: actionButton
314 249 required property string modelData
250 + readonly property bool isDelete: modelData === "delete"
251 + readonly property bool isPin: modelData === "pin"
316 - readonly property bool isDelete: actionButton.modelData === "delete"
317 - readonly property bool isPin: actionButton.modelData === "pin"
318 - readonly property bool pinActive: actionButton.isPin && clipRow.modelData.pinned
319 - readonly property string tint: !root.theme ? "transparent" : (actionButton.isDelete ? root.theme.error : (actionButton.pinActive ? root.theme.ui.focus : root.theme.ui.accent))
321 - width: 30
253 + theme: root.theme
254 + width: 64
322 255 height: 30
323 - radius: 10
324 - color: root.theme ? root.theme.withAlpha(actionButton.tint, actionButton.pinActive ? 0.32 : 0.16) : "transparent"
325 - border.width: 0
326 - border.color: "transparent"
328 - Text {
329 - anchors.centerIn: parent
330 - text: actionButton.modelData === "copy" ? "" : actionButton.modelData === "paste" ? "" : actionButton.isPin ? "" : ""
331 - color: actionButton.isDelete ? (root.theme ? root.theme.error : "white") : (root.theme ? (actionButton.pinActive ? root.theme.ui.focus : root.theme.ui.normal) : "white")
332 - font.family: "Symbols Nerd Font Mono"
333 - font.pixelSize: 13
334 - }
336 - MouseArea {
337 - anchors.fill: parent
338 - onClicked: {
339 - if (actionButton.modelData === "copy")
340 - root.copy(clipRow.modelData.id);
341 - else if (actionButton.modelData === "paste")
342 - root.paste(clipRow.modelData.id);
343 - else if (actionButton.isPin)
344 - root.togglePin(clipRow.modelData.id);
345 - else
346 - root.deleteRow(clipRow.modelData.id);
347 - }
256 + text: modelData
257 + role: isDelete ? "destructive" : "normal"
258 + checked: isPin && clipRow.modelData.pinned
259 + onClicked: {
260 + if (modelData === "copy")
261 + root.copy(clipRow.modelData.id);
262 + else if (modelData === "paste")
263 + root.paste(clipRow.modelData.id);
264 + else if (isPin)
265 + root.togglePin(clipRow.modelData.id);
266 + else
267 + root.deleteRow(clipRow.modelData.id);

quickshell/nuguland/ConnectivityPanel.qml

Modified
156 + Connections {
157 + target: root.bluetoothService
159 + function onRefreshed() {
160 + if (root.bluetoothService)
161 + root.refreshBluetooth(root.bluetoothService.stateJson());
156 165 // One scroll pane for the whole panel: a long Wi-Fi scan + the
157 166 // Bluetooth list scroll together, and an expanded row's detail drawer
158 167 // grows inside it without clipping. Idle (no overflow) => not interactive.
206 215 width: parent.width - 132
209 - Rectangle {
218 + PopupButton {
219 + theme: root.theme
210 220 width: 58
211 221 height: 26
212 - radius: 9
213 - color: root.theme ? root.theme.withAlpha(root.networkState.wifi && root.networkState.wifi.enabled ? root.theme.ui.focus : root.theme.ui.minor, 0.22) : "transparent"
214 - border.width: 0
215 - border.color: root.roleColor(root.networkState.compact ? root.networkState.compact.role : "ui.minor")
217 - NuguText {
218 - anchors.centerIn: parent
219 - theme: root.theme
220 - variant: "meta"
221 - text: root.networkState.wifi && root.networkState.wifi.enabled ? "on" : "off"
222 - }
224 - MouseArea {
225 - anchors.fill: parent
226 - onClicked: root.toggleWifi()
227 - }
222 + text: root.networkState.wifi && root.networkState.wifi.enabled ? "on" : "off"
223 + checked: root.networkState.wifi && root.networkState.wifi.enabled
224 + onClicked: root.toggleWifi()
230 - Rectangle {
227 + PopupButton {
228 + theme: root.theme
231 229 width: 58
232 230 height: 26
233 - radius: 9
234 - color: root.theme ? root.theme.withAlpha(root.theme.ui.accent, root.networkState.scanning ? 0.32 : 0.16) : "transparent"
235 - border.width: 0
236 - border.color: root.theme ? root.theme.ui.accent : "transparent"
238 - NuguText {
239 - anchors.centerIn: parent
240 - theme: root.theme
241 - variant: "meta"
242 - text: root.networkState.scanning ? "scan…" : "scan"
243 - }
245 - MouseArea {
246 - anchors.fill: parent
247 - onClicked: root.scanWifi()
248 - }
231 + text: root.networkState.scanning ? "scan…" : "scan"
232 + checked: root.networkState.scanning
233 + onClicked: root.scanWifi()
267 252 width: parent.width
268 253 spacing: 4
270 - // --- washout-fixed card: solid dark base, identity via thin
271 - // accent bar + border; whole card taps to open its drawer.
272 - Rectangle {
255 + PopupCard {
256 + theme: root.theme
257 + padding: 0
258 + active: wifiRow.active
259 + revealed: wifiRow.revealed
260 + attention: wifiRow.modelData.state === "connecting"
261 + hoverable: true
262 + externallyPressed: wifiArea.pressed
273 263 width: parent.width
274 - height: 40
275 - radius: 12
276 - color: root.theme ? root.theme.withAlpha(root.theme.ui.backdrop, wifiRow.active ? 0.82 : 0.55) : "#333333"
277 - border.width: (wifiRow.active || wifiRow.revealed) ? 2 : 1
278 - border.color: root.theme ? (wifiRow.active ? root.theme.ui.accent : (wifiRow.modelData.state === "connecting" ? root.roleColor("warning") : (wifiRow.revealed ? root.theme.withAlpha(root.theme.ui.accent, 0.6) : root.theme.withAlpha(root.theme.ui.minor, 0.45)))) : "white"
280 - // left accent bar — only on the connected network
281 - Rectangle {
282 - anchors.left: parent.left
283 - anchors.top: parent.top
284 - anchors.bottom: parent.bottom
285 - anchors.margins: 2
286 - width: 3
287 - radius: 2
288 - color: root.theme ? root.theme.ui.accent : "transparent"
289 - opacity: wifiRow.active ? 1 : 0
290 - }
264 + height: 44
292 266 Text {
293 267 id: wifiGlyph
341 315 MouseArea {
316 + id: wifiArea
342 317 anchors.fill: parent
318 + hoverEnabled: true
319 + cursorShape: Qt.PointingHandCursor
343 320 onClicked: root.expandRow(wifiRow.modelData)
347 324 // --- detail + actions drawer (revealed on tap) -----------
348 - Rectangle {
325 + PopupCard {
349 326 id: wifiDrawer
351 328 visible: wifiRow.revealed
329 + theme: root.theme
330 + padding: 0
331 + revealed: true
352 332 width: parent.width
353 333 height: visible ? drawerCol.height + 16 : 0
354 - radius: 10
355 - color: root.theme ? root.theme.withAlpha(root.theme.ui.backdrop, 0.55) : "#333333"
356 - border.width: 1
357 - border.color: root.theme ? root.theme.withAlpha(root.theme.ui.accent, 0.4) : "white"
358 - clip: true
360 335 Column {
361 336 id: drawerCol
372 347 text: {
373 348 const dbm = wifiRow.modelData.signalDbm;
374 349 const sig = (dbm === null || dbm === undefined) ? `${wifiRow.modelData.signal}/4 bars` : `${dbm} dBm`;
375 - return `${wifiRow.modelData.securityLabel || "Open"} · ${sig}`;
350 + return `${wifiRow.modelData.securityLabel || "open"} · ${sig}`;
377 352 color: root.theme ? root.theme.content.normal : "white"
411 386 visible: !wifiRow.modelData.needsPassphrase
412 387 spacing: 8
414 - Rectangle {
389 + PopupButton {
415 390 visible: !wifiRow.active
391 + theme: root.theme
416 392 width: 96
417 393 height: 28
418 - radius: 9
419 - color: root.theme ? root.theme.withAlpha(root.theme.ui.accent, 0.18) : "transparent"
420 - border.width: 1
421 - border.color: root.theme ? root.theme.withAlpha(root.theme.ui.accent, 0.7) : "white"
423 - NuguText {
424 - anchors.centerIn: parent
425 - theme: root.theme
426 - variant: "meta"
427 - text: "connect"
428 - }
430 - MouseArea {
431 - anchors.fill: parent
432 - onClicked: {
433 - root.expandedSsid = "";
434 - root.selectNetwork(wifiRow.modelData.id);
435 - }
394 + text: "connect"
395 + role: "primary"
396 + onClicked: {
397 + root.expandedSsid = "";
398 + root.selectNetwork(wifiRow.modelData.id);
439 - Rectangle {
402 + PopupButton {
440 403 visible: wifiRow.active
404 + theme: root.theme
441 405 width: 96
442 406 height: 28
443 - radius: 9
444 - color: root.theme ? root.theme.withAlpha(root.theme.ui.accent, 0.18) : "transparent"
445 - border.width: 1
446 - border.color: root.theme ? root.theme.withAlpha(root.theme.ui.accent, 0.7) : "white"
448 - NuguText {
449 - anchors.centerIn: parent
450 - theme: root.theme
451 - variant: "meta"
452 - text: "disconnect"
453 - }
455 - MouseArea {
456 - anchors.fill: parent
457 - onClicked: {
458 - root.expandedSsid = "";
459 - root.disconnectNetwork();
460 - }
407 + text: "disconnect"
408 + role: "primary"
409 + onClicked: {
410 + root.expandedSsid = "";
411 + root.disconnectNetwork();
464 - Rectangle {
415 + PopupButton {
465 416 visible: wifiRow.active || wifiRow.modelData.known
417 + theme: root.theme
466 418 width: 96
467 419 height: 28
468 - radius: 9
469 - color: root.theme ? root.theme.withAlpha(root.theme.error, 0.18) : "transparent"
470 - border.width: 1
471 - border.color: root.theme ? root.theme.withAlpha(root.theme.error, 0.7) : "white"
473 - NuguText {
474 - anchors.centerIn: parent
475 - theme: root.theme
476 - variant: "meta"
477 - text: "forget"
478 - }
480 - MouseArea {
481 - anchors.fill: parent
482 - onClicked: {
483 - root.expandedSsid = "";
484 - root.forgetNetwork(wifiRow.modelData.id);
485 - }
420 + text: "forget"
421 + role: "destructive"
422 + onClicked: {
423 + root.expandedSsid = "";
424 + root.forgetNetwork(wifiRow.modelData.id);
490 429 // --- inline passphrase entry for a NEW secured network.
491 430 // echoMode Password; text lives only here, cleared on
492 431 // submit, never bound into networkState / any logged field.
493 - Rectangle {
432 + Item {
494 433 id: wifiPpRow
496 435 function submit() {
502 441 visible: wifiRow.modelData.needsPassphrase
503 442 width: parent.width
504 - height: visible ? 34 : 0
505 - radius: 10
506 - color: root.theme ? root.theme.withAlpha(root.theme.ui.backdrop, 0.7) : "#333333"
507 - border.width: 1
508 - border.color: root.theme ? root.theme.withAlpha(root.theme.ui.accent, 0.6) : "white"
443 + height: visible ? 38 : 0
509 444 onVisibleChanged: {
510 445 if (visible && wifiRow.revealed)
511 - Qt.callLater(function () {
512 - wifiPp.forceActiveFocus();
513 - });
446 + Qt.callLater(wifiPp.input.forceActiveFocus);
516 - TextInput {
449 + PopupTextField {
517 450 id: wifiPp
519 452 anchors.left: parent.left
520 - anchors.leftMargin: 12
521 453 anchors.right: wifiPpConfirm.left
522 - anchors.rightMargin: 10
454 + anchors.rightMargin: 8
523 455 anchors.verticalCenter: parent.verticalCenter
524 - verticalAlignment: TextInput.AlignVCenter
525 - color: root.theme ? root.theme.content.normal : "white"
526 - selectionColor: root.theme ? root.theme.ui.focus : "#ffffff"
527 - selectedTextColor: root.theme ? root.theme.content.backdrop : "black"
528 - font.family: "IBM Plex Sans"
529 - font.pixelSize: 13
456 + theme: root.theme
457 + placeholderText: "passphrase"
530 458 echoMode: TextInput.Password
531 - clip: true
532 459 onAccepted: wifiPpRow.submit()
533 - Keys.onReturnPressed: event => {
534 - event.accepted = true;
535 - wifiPpRow.submit();
536 - }
537 - Keys.onEnterPressed: event => {
538 - event.accepted = true;
539 - wifiPpRow.submit();
540 - }
541 - Keys.onEscapePressed: event => {
542 - event.accepted = true;
543 - wifiPp.text = "";
460 + onCancelled: {
461 + text = "";
544 462 root.expandedSsid = "";
548 - NuguText {
549 - anchors.left: parent.left
550 - anchors.leftMargin: 12
551 - anchors.verticalCenter: parent.verticalCenter
552 - visible: wifiPp.text.length === 0
553 - theme: root.theme
554 - variant: "meta"
555 - text: "passphrase"
556 - opacity: 0.7
557 - }
559 - Rectangle {
466 + PopupButton {
560 467 id: wifiPpConfirm
562 469 anchors.right: parent.right
563 - anchors.rightMargin: 6
564 470 anchors.verticalCenter: parent.verticalCenter
565 - width: 56
566 - height: 24
567 - radius: 8
568 - color: root.theme ? root.theme.withAlpha(root.theme.ui.accent, 0.22) : "transparent"
569 - border.width: 1
570 - border.color: root.theme ? root.theme.withAlpha(root.theme.ui.accent, 0.7) : "white"
572 - NuguText {
573 - anchors.centerIn: parent
574 - theme: root.theme
575 - variant: "meta"
576 - text: "join"
577 - }
579 - MouseArea {
580 - anchors.fill: parent
581 - onClicked: wifiPpRow.submit()
582 - }
471 + theme: root.theme
472 + width: 64
473 + height: 32
474 + text: "join"
475 + role: "primary"
476 + onClicked: wifiPpRow.submit()
600 - Rectangle {
494 + PopupDivider {
495 + theme: root.theme
601 496 width: parent.width
602 - height: 1
603 - color: root.theme ? root.theme.ui.accent : "transparent"
606 499 Column {
619 512 width: parent.width - 132
622 - Rectangle {
515 + PopupButton {
516 + theme: root.theme
623 517 width: 58
624 518 height: 26
625 - radius: 9
626 - color: root.theme ? root.theme.withAlpha(root.bluetoothState.adapter && root.bluetoothState.adapter.state === "powered" ? root.theme.ui.focus : root.theme.ui.minor, 0.22) : "transparent"
627 - border.width: 0
628 - border.color: root.roleColor(root.bluetoothState.compact ? root.bluetoothState.compact.role : "ui.minor")
630 - NuguText {
631 - anchors.centerIn: parent
632 - theme: root.theme
633 - variant: "meta"
634 - text: root.bluetoothState.adapter && root.bluetoothState.adapter.state === "powered" ? "on" : "off"
635 - }
637 - MouseArea {
638 - anchors.fill: parent
639 - onClicked: root.toggleBluetooth()
640 - }
519 + text: root.bluetoothState.adapter && root.bluetoothState.adapter.state === "powered" ? "on" : "off"
520 + checked: root.bluetoothState.adapter && root.bluetoothState.adapter.state === "powered"
521 + onClicked: root.toggleBluetooth()
643 - Rectangle {
524 + PopupButton {
525 + theme: root.theme
644 526 width: 58
645 527 height: 26
646 - radius: 9
647 - color: root.theme ? root.theme.withAlpha(root.theme.ui.accent, root.bluetoothState.adapter && root.bluetoothState.adapter.discovering ? 0.32 : 0.16) : "transparent"
648 - border.width: 0
649 - border.color: root.theme ? root.theme.ui.accent : "transparent"
651 - NuguText {
652 - anchors.centerIn: parent
653 - theme: root.theme
654 - variant: "meta"
655 - text: root.bluetoothState.adapter && root.bluetoothState.adapter.discovering ? "scan…" : "scan"
656 - }
658 - MouseArea {
659 - anchors.fill: parent
660 - onClicked: root.scanBluetooth()
661 - }
528 + text: root.bluetoothState.adapter && root.bluetoothState.adapter.discovering ? "scan…" : "scan"
529 + checked: root.bluetoothState.adapter && root.bluetoothState.adapter.discovering
530 + onClicked: root.scanBluetooth()
717 - Rectangle {
586 + PopupDivider {
587 + theme: root.theme
718 588 width: parent.width
719 - height: 1
720 - color: root.theme ? root.theme.withAlpha(root.theme.ui.minor, 0.24) : "transparent"
723 591 Repeater {
724 592 model: root.bluetoothState.devices || []
726 - delegate: Rectangle {
594 + delegate: PopupCard {
727 595 id: deviceRow
729 597 required property var modelData
599 + theme: root.theme
600 + padding: 0
601 + active: modelData.connected
602 + destructive: modelData.blocked
603 + hoverable: true
604 + externallyPressed: deviceArea.pressed
731 605 width: root.width
732 - height: 42
733 - radius: 10
734 - color: root.theme ? root.theme.withAlpha(modelData.connected ? root.theme.ui.focus : root.theme.ui.minor, modelData.connected ? 0.24 : 0.1) : "transparent"
735 - border.width: modelData.connected ? 1 : 0
736 - border.color: root.roleColor(modelData.blocked ? "error" : modelData.connected ? "ui.accent" : "ui.minor")
606 + height: 46
739 609 id: deviceLine
761 631 elide: Text.ElideRight
764 - Rectangle {
765 - width: 78
766 - height: 23
634 + PopupBadge {
767 635 anchors.verticalCenter: parent.verticalCenter
768 - radius: 8
769 - color: root.theme ? root.theme.withAlpha(deviceRow.modelData.trusted ? root.theme.ui.accent : root.theme.ui.minor, deviceRow.modelData.trusted ? 0.18 : 0.1) : "transparent"
771 - NuguText {
772 - anchors.centerIn: parent
773 - theme: root.theme
774 - variant: "meta"
775 - text: deviceRow.modelData.trusted ? "✓ trusted" : "untrusted"
776 - color: root.roleColor(deviceRow.modelData.trusted ? "ui.accent" : "ui.minor")
777 - }
636 + theme: root.theme
637 + width: 78
638 + text: deviceRow.modelData.trusted ? "trusted" : "untrusted"
639 + icon: deviceRow.modelData.trusted ? "✓" : ""
640 + role: deviceRow.modelData.trusted ? "active" : "normal"
780 - Rectangle {
781 - width: 84
782 - height: 23
643 + PopupBadge {
783 644 anchors.verticalCenter: parent.verticalCenter
784 - radius: 8
785 - color: root.theme ? root.theme.withAlpha(deviceRow.modelData.connected ? root.theme.ui.accent : root.theme.ui.minor, deviceRow.modelData.connected ? 0.22 : 0.1) : "transparent"
787 - NuguText {
788 - anchors.centerIn: parent
789 - theme: root.theme
790 - variant: "meta"
791 - text: deviceRow.modelData.connected ? "● linked" : "○ off"
792 - color: root.roleColor(deviceRow.modelData.connected ? "ui.accent" : "ui.minor")
793 - }
645 + theme: root.theme
646 + width: 84
647 + text: deviceRow.modelData.connected ? "linked" : "off"
648 + icon: deviceRow.modelData.connected ? "●" : "○"
649 + role: deviceRow.modelData.connected ? "active" : "normal"
796 652 NuguText {
809 665 MouseArea {
666 + id: deviceArea
810 667 anchors.fill: parent
811 668 acceptedButtons: Qt.LeftButton | Qt.MiddleButton | Qt.RightButton
669 + hoverEnabled: true
670 + cursorShape: Qt.PointingHandCursor
812 671 onClicked: event => {
813 672 if (event.button === Qt.MiddleButton)
814 673 root.bluetoothAction("forget", deviceRow.modelData.id);

quickshell/nuguland/LauncherPanel.qml

Modified
100 100 width: parent ? parent.width : 0
101 101 height: parent ? parent.height : 0
102 102 focus: true
103 - Component.onCompleted: Qt.callLater(searchInput.forceActiveFocus)
103 + Component.onCompleted: Qt.callLater(searchInput.input.forceActiveFocus)
104 104 onVisibleChanged: if (visible)
105 - Qt.callLater(searchInput.forceActiveFocus)
105 + Qt.callLater(searchInput.input.forceActiveFocus)
107 107 Keys.onUpPressed: event => {
108 108 event.accepted = true;
133 - Rectangle {
134 - anchors.fill: parent
135 - radius: 14
136 - color: root.theme ? root.theme.ui.backdrop : "#242424"
137 - border.width: 1
138 - border.color: root.theme ? root.theme.withAlpha(root.theme.ui.normal, 0.34) : "#666666"
139 - }
141 - Rectangle {
142 - anchors.left: parent.left
143 - anchors.right: parent.right
144 - anchors.bottom: parent.bottom
145 - height: 3
146 - color: root.theme ? root.theme.ui.accent : "#d86dd8"
147 - }
150 134 anchors.fill: parent
151 135 anchors.margins: 1
154 138 width: Math.max(1, parent.width - root.rightWidth)
155 139 height: parent.height
157 - Rectangle {
158 - id: searchBox
141 + PopupTextField {
142 + id: searchInput
144 + theme: root.theme
160 145 anchors.left: parent.left
161 146 anchors.right: parent.right
162 147 anchors.top: parent.top
163 - height: 66
164 - color: "transparent"
166 - Text {
167 - anchors.left: parent.left
168 - anchors.leftMargin: 20
169 - anchors.verticalCenter: parent.verticalCenter
170 - text: "⌕"
171 - color: root.theme ? root.theme.ui.accent : "#d86dd8"
172 - font.pixelSize: 21
148 + anchors.margins: 8
149 + height: 50
150 + icon: "⌕"
151 + fontFamily: "IBM Plex Mono"
152 + fontPixelSize: 24
153 + placeholderText: "search apps"
154 + text: root.query
155 + onEdited: text => root.setQuery(text)
156 + onAccepted: root.activateSelected()
157 + Keys.onUpPressed: event => {
158 + event.accepted = true;
159 + root.select(root.selectedIndex - 1);
175 - TextInput {
176 - id: searchInput
178 - anchors.left: parent.left
179 - anchors.leftMargin: 60
180 - anchors.right: parent.right
181 - anchors.rightMargin: 18
182 - anchors.verticalCenter: parent.verticalCenter
183 - color: root.theme ? root.theme.content.normal : "white"
184 - selectionColor: root.theme ? root.theme.ui.focus : "#ffffff"
185 - selectedTextColor: root.theme ? root.theme.content.backdrop : "black"
186 - font.family: "IBM Plex Mono"
187 - font.pixelSize: 25
188 - text: root.query
189 - focus: true
190 - clip: true
191 - onTextChanged: {
192 - if (text !== root.query)
193 - root.setQuery(text);
194 - }
195 - onAccepted: root.activateSelected()
196 - Keys.onUpPressed: event => {
197 - event.accepted = true;
198 - root.select(root.selectedIndex - 1);
199 - }
200 - Keys.onDownPressed: event => {
201 - event.accepted = true;
202 - root.select(root.selectedIndex + 1);
203 - }
204 - Keys.onReturnPressed: event => {
205 - event.accepted = true;
206 - root.activateSelected();
207 - }
208 - Keys.onEnterPressed: event => {
209 - event.accepted = true;
210 - root.activateSelected();
211 - }
212 - Keys.onPressed: event => root.keyAction(event)
213 - }
215 - Rectangle {
216 - anchors.left: parent.left
217 - anchors.right: parent.right
218 - anchors.bottom: parent.bottom
219 - height: 1
220 - color: root.theme ? root.theme.withAlpha(root.theme.ui.normal, 0.22) : "#444444"
161 + Keys.onDownPressed: event => {
162 + event.accepted = true;
163 + root.select(root.selectedIndex + 1);
165 + Keys.onPressed: event => root.keyAction(event)
224 168 Flickable {
228 172 anchors.left: parent.left
229 173 anchors.right: parent.right
230 - anchors.top: searchBox.bottom
174 + anchors.top: searchInput.bottom
231 175 anchors.bottom: parent.bottom
232 176 anchors.margins: 8
233 177 contentHeight: resultColumn.implicitHeight
251 195 Repeater {
252 196 model: root.results.slice(0, 60)
254 - delegate: Rectangle {
198 + delegate: PopupCard {
255 199 id: rrow
257 201 required property int index
258 202 required property var modelData
259 203 readonly property bool isSelected: index === root.selectedIndex
205 + theme: root.theme
206 + padding: 0
207 + active: isSelected
208 + hoverable: true
209 + externallyPressed: rrowArea.pressed
261 210 width: parent.width
262 211 height: root.rowHeight
263 - radius: 11
264 - color: root.theme ? (isSelected ? root.theme.ui.focus : "transparent") : (isSelected ? "#9aabae" : "transparent")
266 213 Item {
267 214 id: iconSlot
340 287 MouseArea {
288 + id: rrowArea
341 289 anchors.fill: parent
290 + hoverEnabled: true
291 + cursorShape: Qt.PointingHandCursor
342 292 onClicked: root.select(rrow.index)
343 293 onDoubleClicked: root.activateSelected()
344 294 onWheel: wheel => {
355 - Rectangle {
305 + Item {
356 306 width: root.rightWidth
357 307 height: parent.height
358 - color: "transparent"
359 - border.width: 0
361 - Rectangle {
309 + PopupDivider {
362 310 anchors.left: parent.left
363 311 anchors.top: parent.top
364 312 anchors.bottom: parent.bottom
365 - width: 1
366 - color: root.theme ? root.theme.withAlpha(root.theme.ui.normal, 0.22) : "#444444"
313 + theme: root.theme
369 316 Column {
413 360 NuguText {
414 361 theme: root.theme
415 362 variant: "title"
416 - text: root.selectedRow.title || "No apps"
363 + text: root.selectedRow.title || "no apps"
417 364 width: parent.width
418 365 font.pixelSize: 22
438 385 opacity: 0.68
441 - Rectangle {
388 + PopupButton {
389 + theme: root.theme
442 390 width: parent.width
443 391 height: 42
444 - radius: 11
445 - color: root.theme ? root.theme.content.backdrop : "#121212"
447 - NuguText {
448 - anchors.left: parent.left
449 - anchors.leftMargin: 12
450 - anchors.verticalCenter: parent.verticalCenter
451 - theme: root.theme
452 - text: "open"
453 - width: parent.width - 78
454 - }
456 - NuguText {
457 - anchors.right: parent.right
458 - anchors.rightMargin: 12
459 - anchors.verticalCenter: parent.verticalCenter
460 - theme: root.theme
461 - variant: "mono"
462 - text: "enter"
463 - width: 52
464 - horizontalAlignment: Text.AlignRight
465 - opacity: 0.7
466 - }
468 - MouseArea {
469 - anchors.fill: parent
470 - onClicked: root.activateSelected()
471 - }
392 + text: "open"
393 + role: "primary"
394 + onClicked: root.activateSelected()
474 397 Repeater {
475 398 model: root.selectedActions.slice(0, 4)
477 - delegate: Rectangle {
400 + delegate: PopupButton {
478 401 id: actionRow
480 403 required property int index
481 404 required property var modelData
406 + theme: root.theme
483 407 width: parent.width
484 408 height: 42
485 - radius: 11
486 - color: root.theme ? root.theme.content.backdrop : "#121212"
488 - NuguText {
489 - anchors.left: parent.left
490 - anchors.leftMargin: 12
491 - anchors.verticalCenter: parent.verticalCenter
492 - theme: root.theme
493 - text: actionRow.modelData.title || actionRow.modelData.id || "action"
494 - width: parent.width - 78
495 - }
497 - NuguText {
498 - anchors.right: parent.right
499 - anchors.rightMargin: 12
500 - anchors.verticalCenter: parent.verticalCenter
501 - theme: root.theme
502 - variant: "mono"
503 - text: "ctrl " + (actionRow.index + 1)
504 - width: 52
505 - horizontalAlignment: Text.AlignRight
506 - opacity: 0.7
507 - }
509 - MouseArea {
510 - anchors.fill: parent
511 - onClicked: root.activateAction(actionRow.index)
512 - }
409 + text: modelData.title || modelData.id || "action"
410 + onClicked: root.activateAction(index)
523 421 opacity: 0.68
526 - Rectangle {
424 + PopupCard {
425 + theme: root.theme
426 + padding: 0
527 427 width: parent.width
528 428 height: detailColumn.implicitHeight + 20
529 - radius: 11
530 - color: root.theme ? root.theme.content.backdrop : "#121212"
532 430 Column {
533 431 id: detailColumn

quickshell/nuguland/MediaPanel.qml

Modified
87 87 width: parent ? parent.width : 0
88 88 height: parent ? parent.height : 360
90 - Rectangle {
90 + PopupCard {
91 91 id: nowPlayingCard
93 + theme: root.theme
94 + padding: 0
93 95 objectName: "coverDetailsProgressTransport"
94 96 visible: root.hasMedia
95 97 width: parent.width
162 164 width: parent.width
163 165 spacing: 8
165 - Rectangle {
166 - width: stateText.implicitWidth + 18
167 - height: 24
168 - radius: 12
169 - color: root.theme ? root.theme.withAlpha(root.player.playbackState === "playing" ? root.theme.ui.accent : root.theme.ui.minor, 0.18) : "transparent"
167 + PopupBadge {
168 + id: stateBadge
171 - NuguText {
172 - id: stateText
174 - anchors.centerIn: parent
175 - theme: root.theme
176 - variant: "meta"
177 - text: root.player.playbackState === "playing" ? "● now playing" : root.player.playbackState
178 - color: root.roleColor(root.player.playbackState === "playing" ? "ui.accent" : "ui.minor")
179 - }
170 + theme: root.theme
171 + text: root.player.playbackState === "playing" ? "now playing" : root.player.playbackState
172 + icon: root.player.playbackState === "playing" ? "●" : ""
173 + role: root.player.playbackState === "playing" ? "active" : "normal"
182 176 NuguText {
183 177 theme: root.theme
184 178 variant: "meta"
185 179 text: root.player.identity || "mpris"
186 - width: parent.width - stateText.implicitWidth - 28
180 + width: parent.width - stateBadge.width - 16
187 181 opacity: 0.6
188 182 elide: Text.ElideRight
192 186 NuguText {
193 187 theme: root.theme
194 188 variant: "title"
195 - text: root.player.title || root.player.identity || "Untitled"
189 + text: root.player.title || root.player.identity || "untitled"
196 190 width: parent.width
197 191 font.pixelSize: 24
198 192 elide: Text.ElideRight
247 241 opacity: 0.72
250 - Rectangle {
251 - id: progressRail
244 + PopupSlider {
253 245 objectName: "mpris-progress"
254 246 anchors.left: parent.left
255 247 anchors.right: parent.right
256 248 anchors.bottom: parent.bottom
257 - height: 12
258 - radius: 6
259 - color: root.theme ? root.theme.withAlpha(root.theme.ui.minor, 0.24) : "transparent"
261 - Rectangle {
262 - anchors.left: parent.left
263 - anchors.top: parent.top
264 - anchors.bottom: parent.bottom
265 - width: Math.round(parent.width * Math.max(0, Math.min(1, Number(root.player.progress || 0))))
266 - radius: parent.radius
267 - color: root.theme ? root.theme.ui.accent : "white"
268 - }
270 - Rectangle {
271 - width: 16
272 - height: 16
273 - radius: 8
274 - anchors.verticalCenter: parent.verticalCenter
275 - x: Math.max(0, Math.min(parent.width - width, Math.round(parent.width * Math.max(0, Math.min(1, Number(root.player.progress || 0)))) - width / 2))
276 - color: root.theme ? root.theme.content.normal : "white"
277 - border.width: 3
278 - border.color: root.theme ? root.theme.ui.accent : "white"
279 - }
281 - MouseArea {
282 - anchors.fill: parent
283 - cursorShape: Qt.PointingHandCursor
284 - onClicked: event => root.seekByRatio(event.x / Math.max(1, width))
285 - }
249 + theme: root.theme
250 + value: Number(root.player.progress || 0)
251 + onMoved: value => root.seekByRatio(value)
298 264 Repeater {
299 265 model: root.transportActions
301 - delegate: Rectangle {
267 + delegate: PopupButton {
302 268 id: transportButton
304 270 required property string modelData
305 - readonly property bool primary: modelData === "playPause"
306 - readonly property bool active: root.actionActive(modelData)
271 + readonly property bool isPrimary: modelData === "playPause"
272 + readonly property bool actionActive: root.actionActive(modelData)
308 - width: primary ? 64 : 46
309 - height: primary ? 64 : 46
274 + theme: root.theme
275 + width: isPrimary ? 64 : 46
276 + height: isPrimary ? 64 : 46
310 277 radius: width / 2
311 278 anchors.verticalCenter: parent.verticalCenter
312 - color: root.theme ? root.theme.withAlpha(active ? root.theme.ui.focus : root.theme.ui.minor, primary ? 0.34 : (active ? 0.24 : 0.12)) : "transparent"
313 - border.width: active ? 1 : 0
314 - border.color: root.theme ? root.theme.withAlpha(root.theme.ui.accent, 0.65) : "transparent"
316 - Text {
317 - anchors.centerIn: parent
318 - font.family: "Symbols Nerd Font Mono"
319 - font.pixelSize: transportButton.primary ? 25 : 19
320 - text: root.actionIcon(transportButton.modelData)
321 - color: root.roleColor(transportButton.active ? "ui.accent" : "content.accent")
322 - }
324 - MouseArea {
325 - anchors.fill: parent
326 - cursorShape: Qt.PointingHandCursor
327 - onClicked: root.runAction(transportButton.modelData)
328 - }
279 + icon: root.actionIcon(modelData)
280 + iconSize: isPrimary ? 25 : 19
281 + role: isPrimary ? "primary" : "normal"
282 + checked: actionActive
283 + onClicked: root.runAction(modelData)
340 295 Repeater {
341 296 model: root.players
343 - delegate: Rectangle {
298 + delegate: PopupButton {
344 299 id: playerButton
346 301 required property var modelData
347 302 readonly property bool active: modelData.id === root.player.id
304 + theme: root.theme
349 305 height: 26
350 - width: Math.max(76, playerName.implicitWidth + 18)
351 - radius: 10
352 - color: root.theme ? root.theme.withAlpha(active ? root.theme.ui.focus : root.theme.ui.minor, active ? 0.3 : 0.14) : "transparent"
353 - border.width: 0
354 - border.color: root.theme ? (active ? root.theme.ui.focus : root.theme.ui.accent) : "transparent"
356 - NuguText {
357 - id: playerName
359 - anchors.centerIn: parent
360 - theme: root.theme
361 - variant: "meta"
362 - selected: playerButton.active
363 - text: playerButton.modelData.identity || playerButton.modelData.id
364 - }
366 - MouseArea {
367 - anchors.fill: parent
368 - onClicked: root.selectPlayer(playerButton.modelData.id)
369 - }
306 + text: modelData.identity || modelData.id
307 + checked: active
308 + onClicked: root.selectPlayer(modelData.id)
401 340 anchors.horizontalCenter: parent.horizontalCenter
402 341 theme: root.theme
403 342 variant: "title"
404 - text: "Nothing playing"
343 + text: "nothing playing"
407 346 NuguText {
408 347 anchors.horizontalCenter: parent.horizontalCenter
409 348 theme: root.theme
410 349 variant: "meta"
411 - text: "Start a track — controls appear here"
350 + text: "start a track — controls appear here"

quickshell/nuguland/Network.qml

Modified
138 138 "networks": mergedModel,
139 139 "knownNetworks": mergedModel,
140 140 "compact": {
141 - "label": "Network",
141 + "label": "network",
142 142 "role": role(),
143 143 "signal": compactSignal
313 313 check("signalRole(0)", Network.signalRole(0), "ui.minor");
314 314 check("signalRole(2)", Network.signalRole(2), "ui.accent");
315 315 check("signalRole(4)", Network.signalRole(4), "content.accent");
316 - check("securityLabel psk", Network.securityLabel("psk"), "WPA");
317 - check("securityLabel open", Network.securityLabel("open"), "Open");
316 + check("securityLabel psk", Network.securityLabel("psk"), "wpa");
317 + check("securityLabel open", Network.securityLabel("open"), "open");
318 318 check("needsPassphrase open", Network.needsPassphrase("open", false), false);
319 319 check("needsPassphrase psk unknown", Network.needsPassphrase("psk", false), true);
320 320 check("networkId empty non-empty", Network.networkId("").length > 0, true);

quickshell/nuguland/NokoAssetRow.qml

Modified
1 1 import QtQuick
3 -Row {
3 +PopupBadge {
4 4 id: root
6 - required property Theme theme
7 6 property string label: ""
8 7 property bool ok: false
9 8 property real rowWidth: 0
11 10 width: rowWidth > 0 ? rowWidth : implicitWidth
12 - height: 14
13 - spacing: 5
15 - Rectangle {
16 - width: 6
17 - height: 6
18 - radius: 3
19 - anchors.verticalCenter: parent.verticalCenter
20 - color: root.theme ? (root.ok ? root.theme.ui.accent : root.theme.warning) : "white"
21 - }
23 - NuguText {
24 - anchors.verticalCenter: parent.verticalCenter
25 - width: implicitWidth
26 - height: parent.height
27 - verticalAlignment: Text.AlignVCenter
28 - theme: root.theme
29 - variant: "meta"
30 - font.pixelSize: 12
31 - text: root.label
32 - elide: Text.ElideRight
33 - color: root.theme ? root.theme.content.normal : "white"
34 - }
36 - NuguText {
37 - anchors.verticalCenter: parent.verticalCenter
38 - height: parent.height
39 - verticalAlignment: Text.AlignVCenter
40 - theme: root.theme
41 - variant: "meta"
42 - font.pixelSize: 12
43 - text: root.ok ? "· ok" : "· missing"
44 - color: root.theme ? (root.ok ? root.theme.ui.accent : root.theme.warning) : "white"
45 - }
11 + text: `${label} · ${ok ? "ok" : "missing"}`
12 + icon: ok ? "✓" : "!"
13 + role: ok ? "active" : "warning"

quickshell/nuguland/NokoButton.qml

Modified
1 1 import QtQuick
3 -Rectangle {
3 +PopupButton {
4 4 id: root
6 - required property Theme theme
7 6 property string label: ""
8 - property string kind: "ghost"
7 + property string kind: "normal"
9 8 property real buttonWidth: 0
10 - readonly property bool primary: kind === "primary"
11 - signal clicked
10 + text: label
11 + role: kind
13 12 width: buttonWidth > 0 ? buttonWidth : Math.max(1, parent ? (parent.width - 8) / 2 : 160)
14 - height: 34
15 - radius: 10
16 - color: theme ? theme.withAlpha(primary ? theme.ui.accent : theme.ui.minor, enabled ? (primary ? 0.34 : 0.11) : 0.06) : "transparent"
17 - border.width: 0
18 - border.color: "transparent"
19 - opacity: 1
21 - NuguText {
22 - anchors.centerIn: parent
23 - width: parent.width
24 - height: parent.height
25 - horizontalAlignment: Text.AlignHCenter
26 - verticalAlignment: Text.AlignVCenter
27 - theme: root.theme
28 - variant: "meta"
29 - text: root.label
30 - color: root.theme ? (root.enabled ? (root.primary ? root.theme.ui.accent : root.theme.content.normal) : root.theme.ui.normal) : "white"
31 - }
33 - MouseArea {
34 - anchors.fill: parent
35 - enabled: root.enabled
36 - hoverEnabled: true
37 - cursorShape: Qt.PointingHandCursor
38 - onClicked: root.clicked()
39 - }

quickshell/nuguland/NokoPanel.qml

Modified
116 116 onTriggered: root.copiedIndex = -1
119 - Rectangle {
119 + PopupCard {
120 + theme: root.theme
121 + padding: 0
122 + attention: root.panelState && root.panelState.role === "warning"
123 + destructive: root.panelState && root.panelState.role === "error"
120 124 width: parent.width
121 125 height: 76
122 - radius: 16
123 - color: root.theme ? root.theme.withAlpha(root.theme.ui.minor, 0.09) : "transparent"
125 - Rectangle {
126 - width: 3
127 - height: 42
128 - radius: 2
129 - anchors.left: parent.left
130 - anchors.leftMargin: 12
131 - anchors.top: parent.top
132 - anchors.topMargin: 14
133 - color: root.theme ? root.roleColor(root.panelState ? root.panelState.role : "warning") : "white"
134 - }
136 127 Column {
137 128 anchors.fill: parent
138 - anchors.leftMargin: 28
129 + anchors.leftMargin: 14
139 130 anchors.rightMargin: root.showSetupAction() ? 242 : 14
140 131 anchors.topMargin: 13
141 132 anchors.bottomMargin: 12
210 201 Item {
211 - width: Math.max(1, parent.width - setupTitle.implicitWidth - updateBadge.width - 8)
202 + width: Math.max(1, parent.width - setupTitle.implicitWidth - updateBadge.width - parent.spacing * 2)
212 203 height: 1
215 - Rectangle {
206 + PopupBadge {
216 207 id: updateBadge
218 209 anchors.verticalCenter: parent.verticalCenter
210 + theme: root.theme
219 211 width: 136
220 - height: 24
221 - radius: 10
222 - color: root.theme ? root.theme.withAlpha(root.updateAccent(), 0.13) : "transparent"
223 - border.width: root.panelState && root.panelState.updateAvailable ? 1 : 0
224 - border.color: root.updateAccent()
226 - Row {
227 - anchors.centerIn: parent
228 - spacing: 7
230 - Rectangle {
231 - anchors.verticalCenter: parent.verticalCenter
232 - width: 6
233 - height: 6
234 - radius: 3
235 - color: root.updateAccent()
236 - }
238 - NuguText {
239 - anchors.verticalCenter: parent.verticalCenter
240 - theme: root.theme
241 - variant: "meta"
242 - font.pixelSize: 12
243 - text: root.updateLine()
244 - color: root.updateAccent()
245 - }
246 - }
212 + text: root.updateLine()
213 + icon: "●"
214 + role: root.panelState && (root.panelState.updateUnknown || root.panelState.updateAvailable) ? "warning" : "active"
250 - Rectangle {
218 + PopupCard {
219 + theme: root.theme
220 + padding: 0
251 221 width: parent.width
252 222 height: setupFlow.implicitHeight + 18 + (root.panelState && root.panelState.installing ? 25 : 0)
253 - radius: 12
254 - color: root.theme ? root.theme.withAlpha(root.theme.ui.minor, 0.07) : "transparent"
256 224 Column {
257 225 anchors.fill: parent
330 298 color: root.theme ? root.theme.ui.accent : "white"
333 - Rectangle {
301 + PopupCard {
302 + theme: root.theme
303 + padding: 0
304 + active: root.panelState && root.panelState.listening
334 305 width: parent.width
335 306 height: 58
336 - radius: 14
337 - color: root.theme ? root.theme.withAlpha(root.panelState && root.panelState.listening ? root.theme.ui.accent : root.theme.ui.minor, root.panelState && root.panelState.listening ? 0.11 : 0.06) : "transparent"
338 - border.width: root.panelState && root.panelState.listening ? 1 : 0
339 - border.color: root.theme && root.panelState && root.panelState.listening ? root.theme.withAlpha(root.theme.ui.accent, 0.35) : "transparent"
340 - clip: true
343 309 anchors.centerIn: parent
382 - Rectangle {
348 + PopupCard {
349 + theme: root.theme
350 + padding: 0
383 351 width: parent.width
384 352 height: Math.max(150, root.height - y)
385 - radius: 14
386 - color: root.theme ? root.theme.withAlpha(root.theme.ui.minor, 0.07) : "transparent"
388 354 Column {
389 355 anchors.fill: parent
422 388 Repeater {
423 389 model: root.panelState ? root.panelState.historyEntries : []
425 - delegate: Rectangle {
391 + delegate: PopupCard {
426 392 id: transcriptEntry
428 394 required property int index
430 396 readonly property string transcript: String(modelData.transcript || "")
431 397 readonly property bool copied: root.copiedIndex === index
399 + theme: root.theme
400 + padding: 0
433 401 width: historyColumn.width
434 402 height: entryColumn.implicitHeight + 10
435 - radius: 10
436 - color: root.theme ? root.theme.withAlpha(root.theme.ui.minor, 0.06) : "transparent"
438 404 Column {
439 405 id: entryColumn
464 - Rectangle {
430 + PopupButton {
465 431 id: copyButton
467 433 anchors.right: parent.right
468 434 anchors.top: parent.top
469 435 anchors.margins: 8
470 - width: 44
471 - height: 24
472 - radius: 8
473 - color: root.theme ? root.theme.withAlpha(root.theme.ui.accent, transcriptEntry.copied ? 0.36 : (copyArea.containsMouse ? 0.22 : 0.12)) : "transparent"
475 - NuguText {
476 - anchors.centerIn: parent
477 - theme: root.theme
478 - variant: "meta"
479 - font.pixelSize: 12
480 - text: transcriptEntry.copied ? "copied" : "copy"
481 - color: root.theme ? (transcriptEntry.copied ? root.theme.content.normal : root.theme.ui.accent) : "white"
482 - }
484 - MouseArea {
485 - id: copyArea
487 - anchors.fill: parent
488 - hoverEnabled: true
489 - cursorShape: Qt.PointingHandCursor
490 - onClicked: if (transcriptEntry.transcript.length > 0) {
491 - Quickshell.execDetached(["wl-copy", transcriptEntry.transcript]);
492 - root.copiedIndex = transcriptEntry.index;
493 - copyFeedbackTimer.restart();
494 - }
436 + theme: root.theme
437 + width: 58
438 + height: 26
439 + text: transcriptEntry.copied ? "copied" : "copy"
440 + checked: transcriptEntry.copied
441 + onClicked: if (transcriptEntry.transcript.length > 0) {
442 + Quickshell.execDetached(["wl-copy", transcriptEntry.transcript]);
443 + root.copiedIndex = transcriptEntry.index;
444 + copyFeedbackTimer.restart();

quickshell/nuguland/NotificationCard.qml

Modified
3 3 pragma ComponentBehavior: Bound
4 4 import QtQuick
5 5 import Quickshell
6 6 import Quickshell.Widgets
8 -Rectangle {
8 +PopupCard {
9 9 id: card
11 - required property Theme theme
12 11 required property var modelData
13 12 property bool compact: false
14 13 signal dismiss(string id)
40 39 elide: Text.ElideRight
43 - function urgencyColor() {
44 - const u = String(modelData.urgency || "normal");
45 - if (!theme)
46 - return "transparent";
47 - if (u === "critical")
48 - return theme.error;
49 - if (u === "low")
50 - return theme.ui.minor;
51 - return theme.ui.accent;
52 - }
54 42 function relTime(ms) {
55 43 const now = Date.now();
56 44 const diff = Math.max(0, now - Number(ms || now));
65 53 return `${Math.floor(h / 24)}d`;
56 + padding: 0
57 + hoverable: compact || hasDefault
58 + externallyPressed: cardArea.pressed
59 + active: String(modelData.urgency || "normal") === "normal"
60 + destructive: String(modelData.urgency || "normal") === "critical"
68 61 radius: compact ? 12 : 10
69 - color: theme ? theme.withAlpha(theme.ui.backdrop, 0.92) : "transparent"
70 62 implicitHeight: cardBody.implicitHeight + (compact ? 16 : 20)
71 - clip: true
73 - Rectangle {
74 - anchors.left: parent.left
75 - anchors.top: parent.top
76 - anchors.bottom: parent.bottom
77 - width: 3
78 - radius: 2
79 - color: card.urgencyColor()
80 - visible: String(card.modelData.urgency || "normal") !== "low"
81 - }
83 64 // freedesktop "default" action: invoked by clicking the notification body
84 65 // (not rendered as a button). Buttons declared later sit above this area,
87 68 readonly property bool hasDefault: !!defaultAction
89 70 MouseArea {
71 + id: cardArea
90 72 anchors.fill: parent
73 + hoverEnabled: true
74 + cursorShape: enabled ? Qt.PointingHandCursor : Qt.ArrowCursor
91 75 acceptedButtons: Qt.LeftButton
92 76 enabled: card.compact || card.hasDefault
93 77 onClicked: {
230 214 property var actionModel: (card.modelData.actionRows || []).filter(a => a.kind !== "close" && a.kind !== "copy-body" && a.id !== "default")
231 215 Repeater {
232 216 model: parent.actionModel
233 - delegate: Rectangle {
217 + delegate: PopupButton {
234 218 id: actionBtn
235 219 required property var modelData
236 - // action-icons: identifier doubles as a freedesktop icon
237 - // name; resolve it to a real path (empty if absent).
238 - readonly property string actIcon: actionBtn.modelData.icon ? Quickshell.iconPath(String(actionBtn.modelData.icon), true) : ""
220 + readonly property string actIcon: modelData.icon ? Quickshell.iconPath(String(modelData.icon), true) : ""
221 + theme: card.theme
239 222 height: 26
240 - width: Math.max(58, actRow.implicitWidth + 18)
241 - radius: 8
242 - color: {
243 - if (!card.theme)
244 - return "transparent";
245 - if (actArea.pressed)
246 - return card.theme.withAlpha(card.theme.ui.accent, 0.34);
247 - if (actArea.containsMouse)
248 - return card.theme.withAlpha(card.theme.ui.accent, 0.24);
249 - return card.theme.withAlpha(card.theme.ui.accent, 0.14);
250 - }
251 - Row {
252 - id: actRow
253 - anchors.centerIn: parent
254 - spacing: 5
255 - IconImage {
256 - anchors.verticalCenter: parent.verticalCenter
257 - width: 16
258 - height: 16
259 - source: actionBtn.actIcon
260 - visible: actionBtn.actIcon.length > 0
261 - }
262 - CardText {
263 - id: actLabel
264 - anchors.verticalCenter: parent.verticalCenter
265 - theme: card.theme
266 - variant: "meta"
267 - text: actionBtn.modelData.label || "act"
268 - }
269 - }
270 - MouseArea {
271 - id: actArea
272 - anchors.fill: parent
273 - hoverEnabled: true
274 - onClicked: card.invokeAction(String(card.modelData.id), String(actionBtn.modelData.id))
275 - }
276 - Behavior on color {
277 - ColorAnimation {
278 - duration: card.theme && card.theme.lowPowerMode ? 0 : 120
279 - }
280 - }
223 + text: modelData.label || "act"
224 + iconSource: actionBtn.actIcon
225 + onClicked: card.invokeAction(String(card.modelData.id), String(actionBtn.modelData.id))
285 230 // inline reply (chat apps advertising hasInlineReply): a quick
286 231 // text field; Enter sends via sendInlineReply() and clears.
287 - Rectangle {
232 + PopupTextField {
233 + id: replyInput
288 234 width: parent.width
289 235 height: card.canReply ? 30 : 0
290 236 visible: card.canReply
291 - radius: 10
292 - color: card.theme ? card.theme.withAlpha(card.theme.ui.minor, 0.14) : "transparent"
293 - border.width: replyInput.activeFocus ? 1 : 0
294 - border.color: card.theme ? card.theme.ui.accent : "transparent"
296 - TextInput {
297 - id: replyInput
298 - anchors.fill: parent
299 - anchors.leftMargin: 10
300 - anchors.rightMargin: 10
301 - verticalAlignment: TextInput.AlignVCenter
302 - color: card.theme ? card.theme.content.normal : "white"
303 - selectionColor: card.theme ? card.theme.ui.focus : "#ffffff"
304 - selectedTextColor: card.theme ? card.theme.content.backdrop : "black"
305 - font.family: "IBM Plex Sans"
306 - font.pixelSize: 13
307 - clip: true
308 - onAccepted: {
309 - if (text.length > 0) {
310 - card.sendReply(String(card.modelData.id), text);
311 - text = "";
312 - }
237 + theme: card.theme
238 + placeholderText: card.modelData.inlineReplyPlaceholder || "reply…"
239 + onAccepted: {
240 + if (text.length > 0) {
241 + card.sendReply(String(card.modelData.id), text);
242 + text = "";
316 - CardText {
317 - anchors.left: parent.left
318 - anchors.leftMargin: 10
319 - anchors.verticalCenter: parent.verticalCenter
320 - visible: replyInput.text.length === 0
321 - theme: card.theme
322 - variant: "meta"
323 - text: card.modelData.inlineReplyPlaceholder || "Reply…"
324 - }
328 - Item {
248 + PopupButton {
329 249 id: closeCol
250 + theme: card.theme
330 251 width: card.compact ? 0 : 24
331 252 height: card.compact ? 0 : 24
332 253 visible: !card.compact
333 - Rectangle {
334 - anchors.fill: parent
335 - radius: 12
336 - color: closeArea.containsMouse && card.theme ? card.theme.withAlpha(card.theme.ui.minor, 0.25) : "transparent"
337 - opacity: cardHover.hovered || closeArea.containsMouse ? 1 : 0
338 - CardText {
339 - anchors.centerIn: parent
340 - theme: card.theme
341 - variant: "mono"
342 - text: "×"
343 - }
344 - Behavior on opacity {
345 - NumberAnimation {
346 - duration: 120
347 - }
348 - }
349 - }
350 - MouseArea {
351 - id: closeArea
352 - anchors.fill: parent
353 - hoverEnabled: true
354 - onClicked: card.dismiss(String(card.modelData.id))
355 - }
254 + text: "×"
255 + opacity: cardHover.hovered ? 1 : 0
256 + onClicked: card.dismiss(String(card.modelData.id))

quickshell/nuguland/NotificationGroup.qml

Modified
55 55 anchors.verticalCenter: parent.verticalCenter
56 56 theme: root.theme
57 57 variant: "title"
58 - text: `Notifications${root.panelState.activeCount ? " · " + root.panelState.activeCount : ""}`
58 + text: `notifications${root.panelState.activeCount ? " · " + root.panelState.activeCount : ""}`
60 60 Row {
61 61 anchors.right: parent.right
62 62 anchors.verticalCenter: parent.verticalCenter
63 63 spacing: 8
64 - Rectangle {
65 - width: dndLabel.implicitWidth + 18
64 + PopupButton {
65 + theme: root.theme
66 66 height: 24
67 - radius: 8
68 - color: root.theme ? root.theme.withAlpha(root.panelState.dnd ? root.theme.ui.accent : root.theme.ui.minor, root.panelState.dnd ? 0.3 : 0.12) : "transparent"
69 - NuguText {
70 - id: dndLabel
71 - anchors.centerIn: parent
72 - theme: root.theme
73 - variant: "meta"
74 - text: root.panelState.dnd ? "DND on" : "DND"
75 - }
76 - MouseArea {
77 - anchors.fill: parent
78 - onClicked: root.toggleDnd()
79 - }
67 + text: root.panelState.dnd ? "dnd on" : "dnd"
68 + checked: root.panelState.dnd
69 + onClicked: root.toggleDnd()
81 - Rectangle {
82 - width: clearLabel.implicitWidth + 18
83 - height: 24
84 - radius: 8
71 + PopupButton {
85 72 visible: (root.panelState.activeCount || 0) > 0
86 - color: clearArea.containsMouse && root.theme ? root.theme.withAlpha(root.theme.error, 0.24) : (root.theme ? root.theme.withAlpha(root.theme.ui.minor, 0.12) : "transparent")
87 - NuguText {
88 - id: clearLabel
89 - anchors.centerIn: parent
90 - theme: root.theme
91 - variant: "meta"
92 - text: "Clear all"
93 - }
94 - MouseArea {
95 - id: clearArea
96 - anchors.fill: parent
97 - hoverEnabled: true
98 - onClicked: root.clearAll()
99 - }
73 + theme: root.theme
74 + height: 24
75 + text: "clear all"
76 + role: "destructive"
77 + onClicked: root.clearAll()
134 112 anchors.horizontalCenter: parent.horizontalCenter
135 113 theme: root.theme
136 114 variant: "title"
137 - text: "No notifications"
115 + text: "no notifications"
139 117 NuguText {
140 118 anchors.horizontalCenter: parent.horizontalCenter
141 119 theme: root.theme
142 120 variant: "meta"
143 - text: "You're all caught up"
121 + text: "you're all caught up"
153 131 width: root.width
154 132 spacing: 6
156 - // collapsible group header: an obvious interactive pill with a
157 - // hover background and an explicit "Show N more" / "Show less"
158 - // label so the collapse affordance reads as a button, not decor.
159 - Rectangle {
134 + PopupButton {
160 135 id: groupHeader
136 + readonly property int hiddenCount: Math.max(1, (groupDelegate.modelData.count || 1) - (groupDelegate.modelData.previewCount || 1))
138 + theme: root.theme
161 139 width: parent.width
162 - height: (groupDelegate.modelData.count || 0) > 1 ? 26 : 0
140 + height: (groupDelegate.modelData.count || 0) > 1 ? 30 : 0
163 141 visible: (groupDelegate.modelData.count || 0) > 1
164 - radius: 8
165 - color: grpArea.containsMouse && root.theme ? root.theme.withAlpha(root.theme.ui.minor, 0.16) : "transparent"
166 - Behavior on color {
167 - ColorAnimation {
168 - duration: root.theme && root.theme.lowPowerMode ? 0 : 120
169 - }
170 - }
171 - Row {
172 - anchors.left: parent.left
173 - anchors.leftMargin: 8
174 - anchors.verticalCenter: parent.verticalCenter
175 - spacing: 6
176 - NuguText {
177 - theme: root.theme
178 - variant: "meta"
179 - text: groupDelegate.modelData.appName || ""
180 - }
181 - NuguText {
182 - theme: root.theme
183 - variant: "meta"
184 - text: `· ${groupDelegate.modelData.count}`
185 - }
186 - }
187 - Row {
188 - anchors.right: parent.right
189 - anchors.rightMargin: 8
190 - anchors.verticalCenter: parent.verticalCenter
191 - spacing: 4
192 - NuguText {
193 - theme: root.theme
194 - variant: "meta"
195 - opacity: grpArea.containsMouse ? 1 : 0.7
196 - text: groupDelegate.modelData.expanded ? "Show less" : `Show ${Math.max(1, (groupDelegate.modelData.count || 1) - (groupDelegate.modelData.previewCount || 1))} more`
197 - }
198 - NuguText {
199 - theme: root.theme
200 - variant: "mono"
201 - opacity: grpArea.containsMouse ? 1 : 0.7
202 - text: groupDelegate.modelData.expanded ? "⌃" : "⌄"
203 - }
204 - }
205 - MouseArea {
206 - id: grpArea
207 - anchors.fill: parent
208 - hoverEnabled: true
209 - onClicked: root.toggleGroup(groupDelegate.modelData.appName || "")
210 - }
142 + text: groupDelegate.modelData.expanded ? `${groupDelegate.modelData.appName || "app"} · ${groupDelegate.modelData.count} — show less` : `${groupDelegate.modelData.appName || "app"} · ${groupDelegate.modelData.count} — show ${hiddenCount} more`
143 + checked: groupDelegate.modelData.expanded
144 + onClicked: root.toggleGroup(groupDelegate.modelData.appName || "")
213 147 Repeater {

quickshell/nuguland/Notifications.qml

Modified
78 78 const action = source[i];
79 79 rows.push({
80 80 "id": action.id || action.identifier || `action-${i}`,
81 - "label": action.label || action.text || "Action"
81 + "label": action.label || action.text || "action"
84 84 return rows;
240 240 "urgency": "normal",
241 241 "expireTimeout": -1
242 242 }) === defaultToastTimeoutMs, "default timeout");
244 + // Stateful behavior is exercised through IPC, but always restore the
245 + // complete state so the test is safe even when called by a live client.
246 + const snapshot = {
247 + "dnd": dnd,
248 + "notifications": notifications,
249 + "nativeNotifications": nativeNotifications,
250 + "activeToasts": activeToasts,
251 + "toastById": toastById,
252 + "unreadCount": unreadCount,
253 + "lastAction": lastAction
254 + };
255 + try {
256 + dnd = false;
257 + notifications = [
259 + "id": "history",
260 + "nativeId": "native-history",
261 + "urgency": "normal",
262 + "closed": false,
263 + "read": false
265 + ];
266 + nativeNotifications = {
267 + "native-normal": ({
268 + "summary": "normal"
269 + }),
270 + "native-critical": ({
271 + "summary": "critical"
272 + }),
273 + "native-history": ({
274 + "summary": "history"
275 + })
276 + };
277 + activeToasts = ["normal-alias", "critical"];
278 + toastById = {
279 + "normal-alias": ({
280 + "id": "normal-alias",
281 + "nativeId": "native-normal",
282 + "urgency": "normal",
283 + "transient": true
284 + }),
285 + "critical": ({
286 + "id": "critical",
287 + "nativeId": "native-critical",
288 + "urgency": "critical",
289 + "transient": true
290 + })
291 + };
292 + toggleDnd();
293 + expect(activeToasts.length === 1 && activeToasts[0] === "critical", "DND prunes only normal toasts");
294 + expect(!!nativeNotifications["native-critical"], "DND retains critical native references");
295 + expect(!nativeNotifications["native-normal"], "DND releases transient aliases by native id");
296 + expect(!!nativeNotifications["native-history"] && notifications.length === 1, "DND retains history and native lifecycle");
297 + expect(toastEligible({
298 + "urgency": "normal"
299 + }, dnd) === false, "DND suppresses later normal toasts");
300 + dismissToasts();
301 + expect(activeToasts.length === 0 && Object.keys(toastById).length === 0, "dismissToasts clears critical toasts too");
302 + expect(notifications.length === 1 && !!nativeNotifications["native-history"], "dismissToasts preserves history");
303 + } finally {
304 + dnd = snapshot.dnd;
305 + notifications = snapshot.notifications;
306 + nativeNotifications = snapshot.nativeNotifications;
307 + activeToasts = snapshot.activeToasts;
308 + toastById = snapshot.toastById;
309 + unreadCount = snapshot.unreadCount;
310 + lastAction = snapshot.lastAction;
243 312 return {
244 313 "pass": failures.length === 0,
245 314 "failures": failures
310 379 "id": "close",
311 380 "kind": "close",
312 - "label": "Close",
381 + "label": "close",
313 382 "route": "Notifications.qml"
319 388 rows.push({
320 389 "id": aid,
321 390 "kind": "server-action",
322 - "label": serverActions[i].label || serverActions[i].text || "Action",
391 + "label": serverActions[i].label || serverActions[i].text || "action",
323 392 // with action-icons, the identifier IS a freedesktop icon name.
324 393 "icon": notification.hasActionIcons ? aid : "",
325 394 "route": "Notifications.qml"
328 397 rows.push({
329 398 "id": "copy-body",
330 399 "kind": "copy-body",
331 - "label": "Copy body",
400 + "label": "copy body",
332 401 "route": "Notifications.qml"
334 403 return rows;
378 447 return rows;
450 + function pruneToasts(keep) {
451 + const oldMap = toastById;
452 + const nextMap = ({});
453 + const nextIds = [];
454 + const retainedNative = ({});
455 + const removed = [];
456 + for (let i = 0; i < activeToasts.length; i++) {
457 + const tid = activeToasts[i];
458 + const toast = oldMap[tid];
459 + if (toast && keep(toast)) {
460 + nextIds.push(tid);
461 + nextMap[tid] = toast;
462 + retainedNative[String(toast.nativeId || toast.id)] = true;
463 + } else if (toast) {
464 + removed.push(toast);
467 + // Historical notifications own their native reference independently
468 + // from a toast, including replacement ids that alias nativeId.
469 + for (let h = 0; h < notifications.length; h++)
470 + retainedNative[String(notifications[h].nativeId || notifications[h].id)] = true;
471 + const nmap = Object.assign({}, nativeNotifications);
472 + for (let r = 0; r < removed.length; r++) {
473 + const row = removed[r];
474 + const nativeKey = String(row.nativeId || row.id);
475 + if (row.transient && !retainedNative[nativeKey])
476 + delete nmap[nativeKey];
478 + activeToasts = nextIds;
479 + toastById = nextMap;
480 + nativeNotifications = nmap;
381 483 function dismissToast(id) {
382 484 const sid = String(id);
383 - const toast = toastById[sid];
384 - activeToasts = activeToasts.filter(x => x !== sid);
385 - const map = Object.assign({}, toastById);
386 - delete map[sid];
387 - toastById = map;
388 - if (toast && toast.transient) {
389 - const nmap = Object.assign({}, nativeNotifications);
390 - delete nmap[sid];
391 - nativeNotifications = nmap;
392 - }
485 + pruneToasts(toast => String(toast.id) !== sid);
393 486 return stateJson();
396 489 function dismissToasts() {
397 - const tmap = toastById;
398 - activeToasts = [];
399 - toastById = ({});
400 - const nmap = Object.assign({}, nativeNotifications);
401 - let pruned = false;
402 - for (const tid in tmap) {
403 - if (tmap[tid] && tmap[tid].transient) {
404 - delete nmap[tid];
405 - pruned = true;
406 - }
407 - }
408 - if (pruned)
409 - nativeNotifications = nmap;
490 + pruneToasts(() => false);
410 491 return stateJson();
490 571 function toggleDnd() {
491 572 dnd = !dnd;
573 + if (dnd)
574 + pruneToasts(toast => toast.urgency === "critical");
492 575 lastAction = {
493 576 "kind": "toggle-dnd",
494 577 "enabled": dnd

quickshell/nuguland/NuguText.qml

Modified
5 5 property string variant: "body"
6 6 property bool selected: false
8 - color: !theme ? "transparent" : (selected ? theme.content.backdrop : (variant === "title" ? theme.ui.important_global : (variant === "meta" ? theme.ui.normal : theme.content.normal)))
8 + color: !theme ? "transparent" : (variant === "title" ? theme.ui.important_global : (variant === "meta" ? theme.ui.normal : theme.content.normal))
9 9 font.family: variant === "mono" ? "IBM Plex Mono" : "IBM Plex Sans"
10 10 font.pixelSize: variant === "title" ? 15 : (variant === "meta" ? 13 : 14)
11 11 font.bold: variant === "title"

quickshell/nuguland/PopoutHost.qml

Modified
26 26 required property Network networkService
27 27 required property Bluetooth bluetoothService
28 28 required property Power powerService
29 + required property Privilege privilegeService
29 30 required property Lock lockService
30 31 required property Noko nokoService
31 32 required property var barWindow
106 107 exclusionMode: ExclusionMode.Ignore
107 108 WlrLayershell.layer: WlrLayer.Overlay
108 109 WlrLayershell.namespace: "nuguland-popout"
109 - WlrLayershell.keyboardFocus: root.visible ? WlrKeyboardFocus.Exclusive : WlrKeyboardFocus.None
110 + WlrLayershell.keyboardFocus: root.visible && !root.privilegeService.active ? WlrKeyboardFocus.Exclusive : WlrKeyboardFocus.None
110 111 onVisibleChanged: {
111 112 if (!visible && root.surfaces && root.surfaces.popoutOpen && !root.surfaces.popoutClosing)
112 113 root.surfaces.closePopout("focus-grab-outside");
168 - Rectangle {
169 + PopupSurface {
169 170 id: card
172 + theme: root.theme
173 + padding: 0
171 174 x: Math.round(root.currentRect.x)
172 175 y: Math.round(root.currentRect.y)
173 176 width: Math.round(root.currentRect.width)
174 177 height: Math.round(root.currentRect.height)
175 - clip: true
176 - color: root.theme ? root.theme.ui.backdrop : "transparent"
177 - border.width: 0
178 - border.color: root.theme ? root.theme.ui.accent : "transparent"
179 - radius: 14
180 178 opacity: root.cardFrame.opacity
181 179 transformOrigin: Item.Top
182 180 focus: root.visible
553 551 visible: clockCol.todayItems.length === 0
554 552 theme: root.theme
555 553 variant: "meta"
556 - text: "Keine Termine"
554 + text: "keine termine"
590 588 NuguText {
591 589 theme: root.theme
592 590 variant: "meta"
593 - text: "CalDAV einrichten"
591 + text: "caldav einrichten"
596 594 SetupField {
609 607 id: userField
611 609 theme: root.theme
612 - placeholder: "Benutzername"
610 + placeholder: "benutzername"
613 611 text: root.caldavService ? root.caldavService.setupUsernameDraft : ""
614 612 onEdited: text => {
615 613 if (root.caldavService)
621 619 id: pwField
623 621 theme: root.theme
624 - placeholder: "App-Passwort"
622 + placeholder: "app-passwort"
625 623 secret: true
626 624 text: root.caldavService ? root.caldavService.setupPasswordDraft : ""
627 625 onEdited: text => {
633 - Rectangle {
631 + PopupButton {
632 + theme: root.theme
634 633 width: parent.width
635 634 height: 30
636 - radius: 10
637 - color: root.theme ? root.theme.withAlpha(root.theme.ui.accent, 0.2) : "transparent"
639 - NuguText {
640 - anchors.centerIn: parent
641 - theme: root.theme
642 - variant: "meta"
643 - text: "Speichern"
646 - MouseArea {
647 - anchors.fill: parent
648 - cursorShape: Qt.PointingHandCursor
649 - onClicked: if (root.caldavService)
650 - root.caldavService.saveSetup(urlField.text, userField.text, pwField.text)
635 + text: "speichern"
636 + role: "primary"
637 + onClicked: if (root.caldavService)
638 + root.caldavService.saveSetup(urlField.text, userField.text, pwField.text)
654 641 NuguText {
716 703 spacing: 10
718 705 // ===== MACHINE IDENTITY =====
719 - Rectangle {
706 + PopupCard {
707 + theme: root.theme
708 + padding: 0
720 709 width: cardRow.machineW
721 710 height: cardRow.height
722 - radius: 14
723 - color: root.theme ? root.theme.withAlpha(root.theme.ui.backdrop, 0.55) : "#242424"
725 712 Column {
726 713 anchors.fill: parent
818 805 // ===== LIVE STATS =====
819 - Rectangle {
806 + PopupCard {
807 + theme: root.theme
808 + padding: 0
820 809 width: cardRow.liveW
821 810 height: cardRow.height
822 - radius: 14
823 - color: root.theme ? root.theme.withAlpha(root.theme.ui.backdrop, 0.55) : "#242424"
825 812 Column {
826 813 anchors.fill: parent
975 962 // all-clear: a single green check row (the service emits NO synthetic
976 963 // green issue — the view renders it when the array is empty).
977 - Rectangle {
964 + PopupCard {
978 965 visible: systemPanel.issueList.length === 0
966 + theme: root.theme
967 + padding: 0
968 + active: true
979 969 width: parent.width
980 970 height: 30
981 - radius: 10
982 - color: root.theme ? root.theme.withAlpha(root.theme.ui.backdrop, 0.55) : "#242424"
985 973 anchors.left: parent.left
1007 995 Repeater {
1008 996 model: systemPanel.issueList
1010 - delegate: Rectangle {
998 + delegate: PopupCard {
1011 999 id: issueCard
1013 1001 required property var modelData
1023 1011 return root.theme ? root.theme.info : "#3ec5e3";
1014 + theme: root.theme
1015 + padding: 0
1016 + attention: modelData.severity === "warning"
1017 + destructive: modelData.severity === "error"
1026 1018 width: parent.width
1027 - height: 40
1028 - radius: 10
1029 - clip: true
1030 - color: root.theme ? root.theme.withAlpha(root.theme.ui.backdrop, 0.55) : "#242424"
1032 - // severity-colored left accent bar (strong signal, matches card aesthetic)
1033 - Rectangle {
1034 - anchors.left: parent.left
1035 - anchors.top: parent.top
1036 - anchors.bottom: parent.bottom
1037 - width: 4
1038 - color: issueCard.sevColor
1019 + height: 44
1041 1021 Rectangle {
1042 1022 id: sevDot
1087 - Rectangle {
1067 + PopupButton {
1088 1068 id: actBtn
1090 1070 visible: !!issueCard.modelData.action
1091 1071 anchors.right: parent.right
1092 1072 anchors.rightMargin: 12
1093 1073 anchors.verticalCenter: parent.verticalCenter
1074 + theme: root.theme
1094 1075 width: 62
1095 - height: 24
1096 - radius: 7
1097 - // ghost button: transparent with a severity-tinted border + text,
1098 - // faint fill on hover — consistent with the dark card aesthetic.
1099 - color: actMouse.containsMouse && root.theme ? root.theme.withAlpha(issueCard.sevColor, 0.22) : "transparent"
1100 - border.width: 1
1101 - border.color: root.theme ? root.theme.withAlpha(issueCard.sevColor, 0.55) : issueCard.sevColor
1103 - Text {
1104 - anchors.centerIn: parent
1105 - text: "open"
1106 - color: issueCard.sevColor
1107 - font.family: "IBM Plex Sans"
1108 - font.pixelSize: 13
1111 - MouseArea {
1112 - id: actMouse
1114 - anchors.fill: parent
1115 - hoverEnabled: true
1116 - cursorShape: Qt.PointingHandCursor
1117 - onClicked: {
1118 - if (systemPanel.rs)
1119 - systemPanel.rs.runIssueAction(issueCard.modelData.id);
1076 + height: 26
1077 + text: "open"
1078 + role: issueCard.modelData.severity === "error" ? "destructive" : "normal"
1079 + onClicked: {
1080 + if (systemPanel.rs)
1081 + systemPanel.rs.runIssueAction(issueCard.modelData.id);
1132 1093 Repeater {
1133 1094 model: systemPanel.rs ? systemPanel.rs.processes : []
1135 - delegate: Rectangle {
1096 + delegate: PopupBadge {
1136 1097 id: procChip
1138 1099 required property var modelData
1140 - height: 22
1141 - width: procRow.implicitWidth + 18
1142 - radius: 8
1143 - color: root.theme ? root.theme.withAlpha(root.theme.ui.minor, 0.16) : "transparent"
1145 - Row {
1146 - id: procRow
1148 - anchors.centerIn: parent
1149 - spacing: 6
1151 - NuguText {
1152 - theme: root.theme
1153 - variant: "meta"
1154 - text: String(procChip.modelData.name || "?")
1157 - NuguText {
1158 - theme: root.theme
1159 - variant: "meta"
1160 - color: root.theme ? root.theme.ui.accent : "white"
1161 - text: `${Number(procChip.modelData.cpu || 0).toFixed(0)}%`
1101 + theme: root.theme
1102 + text: `${String(modelData.name || "?")} · ${Number(modelData.cpu || 0).toFixed(0)}%`
1103 + role: "normal"

quickshell/nuguland/PopupBadge.qml

Added
new file mode 100644
1 +import QtQuick
3 +Rectangle {
4 + id: root
6 + required property Theme theme
7 + property string text: ""
8 + property string icon: ""
9 + property string role: "normal"
11 + readonly property color roleColor: role === "error" ? theme.error : (role === "warning" ? theme.warning : (role === "info" ? theme.info : (role === "active" ? theme.ui.accent : theme.ui.minor)))
13 + implicitWidth: labelRow.implicitWidth + 16
14 + implicitHeight: 24
15 + radius: 9
16 + color: theme.withAlpha(roleColor, 0.14)
17 + border.width: role === "normal" ? 0 : 1
18 + border.color: theme.withAlpha(roleColor, 0.5)
19 + Accessible.role: Accessible.StaticText
20 + Accessible.name: text
22 + Row {
23 + id: labelRow
25 + anchors.centerIn: parent
26 + spacing: 5
28 + Text {
29 + visible: root.icon.length > 0
30 + anchors.verticalCenter: parent.verticalCenter
31 + color: root.roleColor
32 + font.family: "Symbols Nerd Font Mono"
33 + font.pixelSize: 12
34 + text: root.icon
35 + }
37 + NuguText {
38 + anchors.verticalCenter: parent.verticalCenter
39 + theme: root.theme
40 + variant: "meta"
41 + color: root.theme.content.normal
42 + text: root.text
43 + }
44 + }

quickshell/nuguland/PopupButton.qml

Added
new file mode 100644
1 +import QtQuick
2 +import Quickshell.Widgets
4 +Rectangle {
5 + id: root
7 + required property Theme theme
8 + property string text: ""
9 + property string icon: ""
10 + property url iconSource: ""
11 + property string role: "normal"
12 + property bool checked: false
13 + property int iconSize: 14
14 + property bool primary: role === "primary"
15 + signal clicked
17 + readonly property bool destructive: role === "destructive"
18 + readonly property color stateColor: destructive ? theme.error : (primary || checked ? theme.ui.accent : theme.ui.normal)
20 + implicitWidth: labelRow.implicitWidth + 24
21 + implicitHeight: 34
22 + radius: 10
23 + opacity: enabled ? 1 : 0.48
24 + color: theme.withAlpha(stateColor, tap.pressed ? 0.38 : (hover.hovered ? 0.28 : (checked || primary ? 0.2 : 0.1)))
25 + border.width: activeFocus || checked ? 2 : 1
26 + border.color: activeFocus ? theme.content.focus : theme.withAlpha(stateColor, enabled ? 0.72 : 0.35)
27 + activeFocusOnTab: enabled
28 + Accessible.role: Accessible.Button
29 + Accessible.name: text
30 + Accessible.checked: checked
31 + Keys.onPressed: event => {
32 + if (enabled && (event.key === Qt.Key_Return || event.key === Qt.Key_Enter || event.key === Qt.Key_Space)) {
33 + event.accepted = true;
34 + root.clicked();
35 + }
36 + }
38 + Row {
39 + id: labelRow
41 + anchors.centerIn: parent
42 + spacing: 7
44 + IconImage {
45 + visible: root.iconSource.toString().length > 0
46 + anchors.verticalCenter: parent.verticalCenter
47 + width: root.iconSize
48 + height: root.iconSize
49 + source: root.iconSource
50 + }
52 + Text {
53 + visible: root.icon.length > 0
54 + anchors.verticalCenter: parent.verticalCenter
55 + color: root.theme.content.normal
56 + font.family: "Symbols Nerd Font Mono"
57 + font.pixelSize: root.iconSize
58 + text: root.icon
59 + }
61 + NuguText {
62 + theme: root.theme
63 + color: root.theme.content.normal
64 + text: root.text
65 + }
66 + }
68 + HoverHandler {
69 + id: hover
70 + }
71 + TapHandler {
72 + id: tap
73 + enabled: root.enabled
74 + gesturePolicy: TapHandler.ReleaseWithinBounds
75 + onTapped: root.clicked()
76 + }
78 + Behavior on color {
79 + ColorAnimation {
80 + duration: root.theme.lowPowerMode ? 0 : 90
81 + }
82 + }

quickshell/nuguland/PopupCard.qml

Added
new file mode 100644
1 +import QtQuick
3 +Rectangle {
4 + id: root
6 + required property Theme theme
7 + default property alias content: contentItem.data
8 + property string role: "normal"
9 + property bool active: false
10 + property bool revealed: false
11 + property bool attention: false
12 + property bool destructive: false
13 + property bool interactive: false
14 + property bool hoverable: interactive
15 + property bool externallyPressed: false
16 + property int padding: 12
17 + signal clicked
19 + readonly property bool highlighted: active || revealed || attention || destructive
20 + readonly property color stateColor: destructive ? theme.error : (attention ? theme.warning : theme.ui.accent)
22 + implicitWidth: contentItem.implicitWidth + padding * 2
23 + implicitHeight: Math.max(44, contentItem.implicitHeight + padding * 2)
24 + radius: 12
25 + color: theme.withAlpha(highlighted ? stateColor : theme.ui.backdrop, tap.pressed || externallyPressed ? 0.34 : (hover.hovered ? 0.24 : (highlighted ? 0.18 : 0.55)))
26 + border.width: highlighted || activeFocus ? 2 : 1
27 + border.color: activeFocus ? theme.content.focus : theme.withAlpha(highlighted ? stateColor : theme.ui.minor, highlighted ? 0.8 : 0.42)
28 + activeFocusOnTab: interactive && enabled
29 + opacity: enabled ? 1 : 0.48
30 + Accessible.role: interactive ? Accessible.Button : Accessible.Pane
31 + Accessible.name: role
32 + Keys.onPressed: event => {
33 + if (interactive && enabled && (event.key === Qt.Key_Return || event.key === Qt.Key_Enter || event.key === Qt.Key_Space)) {
34 + event.accepted = true;
35 + root.clicked();
36 + }
37 + }
39 + Item {
40 + id: contentItem
42 + anchors.fill: parent
43 + anchors.margins: root.padding
44 + readonly property Item child: children.length > 0 ? children[0] : null
45 + implicitWidth: child ? child.implicitWidth : 0
46 + implicitHeight: child ? child.implicitHeight : 0
47 + }
49 + HoverHandler {
50 + id: hover
51 + enabled: root.hoverable && root.enabled
52 + }
54 + TapHandler {
55 + id: tap
56 + enabled: root.interactive && root.enabled
57 + gesturePolicy: TapHandler.ReleaseWithinBounds
58 + onTapped: root.clicked()
59 + }
61 + Behavior on color {
62 + ColorAnimation {
63 + duration: root.theme.lowPowerMode ? 0 : 90
64 + }
65 + }

quickshell/nuguland/PopupDivider.qml

Added
new file mode 100644
1 +import QtQuick
3 +Rectangle {
4 + required property Theme theme
6 + implicitWidth: 1
7 + implicitHeight: 1
8 + color: theme.withAlpha(theme.ui.minor, 0.28)
9 + Accessible.ignored: true

quickshell/nuguland/PopupSection.qml

Added
new file mode 100644
1 +import QtQuick
3 +Item {
4 + id: root
6 + required property Theme theme
7 + default property alias body: bodyItem.data
8 + property string title: ""
9 + property string detail: ""
11 + implicitWidth: Math.max(header.implicitWidth, bodyItem.implicitWidth)
12 + implicitHeight: header.height + (header.visible ? 8 : 0) + bodyItem.implicitHeight
14 + Row {
15 + id: header
17 + visible: root.title.length > 0 || root.detail.length > 0
18 + width: parent.width
19 + spacing: 8
21 + NuguText {
22 + theme: root.theme
23 + variant: "title"
24 + text: root.title
25 + }
27 + NuguText {
28 + theme: root.theme
29 + variant: "meta"
30 + text: root.detail
31 + }
32 + }
34 + Item {
35 + id: bodyItem
37 + y: header.visible ? header.height + 8 : 0
38 + width: parent.width
39 + readonly property Item child: children.length > 0 ? children[0] : null
40 + implicitWidth: child ? child.implicitWidth : 0
41 + implicitHeight: child ? child.implicitHeight : 0
42 + }

quickshell/nuguland/PopupSlider.qml

Added
new file mode 100644
1 +import QtQuick
3 +Item {
4 + id: root
6 + required property Theme theme
7 + property real value: 0
8 + property real step: 0.05
9 + signal moved(real value)
11 + readonly property real boundedValue: Math.max(0, Math.min(1, value))
13 + function valueAt(x) {
14 + return Math.max(0, Math.min(1, x / Math.max(1, width)));
15 + }
17 + function moveTo(x) {
18 + moved(valueAt(x));
19 + }
21 + implicitWidth: 120
22 + implicitHeight: 20
23 + activeFocusOnTab: enabled
24 + opacity: enabled ? 1 : 0.48
25 + Accessible.role: Accessible.Slider
26 + Accessible.name: "slider"
27 + Keys.onLeftPressed: event => {
28 + event.accepted = true;
29 + moved(Math.max(0, boundedValue - step));
30 + }
31 + Keys.onRightPressed: event => {
32 + event.accepted = true;
33 + moved(Math.min(1, boundedValue + step));
34 + }
36 + Rectangle {
37 + anchors.left: parent.left
38 + anchors.right: parent.right
39 + anchors.verticalCenter: parent.verticalCenter
40 + height: pointer.containsMouse || pointer.pressed || root.activeFocus ? 8 : 6
41 + radius: height / 2
42 + color: root.theme.withAlpha(root.theme.ui.minor, 0.28)
44 + Rectangle {
45 + anchors.left: parent.left
46 + anchors.top: parent.top
47 + anchors.bottom: parent.bottom
48 + width: parent.width * root.boundedValue
49 + radius: parent.radius
50 + color: root.theme.ui.accent
51 + }
52 + }
54 + Rectangle {
55 + x: Math.round((root.width - width) * root.boundedValue)
56 + anchors.verticalCenter: parent.verticalCenter
57 + width: pointer.pressed ? 16 : 14
58 + height: width
59 + radius: width / 2
60 + color: root.theme.content.normal
61 + border.width: root.activeFocus ? 2 : 1
62 + border.color: root.activeFocus ? root.theme.content.focus : root.theme.withAlpha(root.theme.ui.backdrop, 0.7)
64 + Behavior on width {
65 + NumberAnimation {
66 + duration: root.theme.lowPowerMode ? 0 : 90
67 + }
68 + }
69 + }
71 + MouseArea {
72 + id: pointer
74 + anchors.fill: parent
75 + enabled: root.enabled
76 + hoverEnabled: true
77 + cursorShape: Qt.PointingHandCursor
78 + onPressed: event => root.moveTo(event.x)
79 + onPositionChanged: event => {
80 + if (pressed)
81 + root.moveTo(event.x);
82 + }
83 + }

quickshell/nuguland/PopupSurface.qml

Added
new file mode 100644
1 +import QtQuick
3 +Rectangle {
4 + id: root
6 + required property Theme theme
7 + default property alias body: bodyItem.data
8 + property int padding: 16
10 + implicitWidth: bodyItem.implicitWidth + padding * 2
11 + implicitHeight: bodyItem.implicitHeight + padding * 2
12 + radius: 14
13 + color: theme.ui.backdrop
14 + border.width: 1
15 + border.color: theme.withAlpha(theme.ui.normal, 0.22)
16 + clip: true
18 + Item {
19 + id: bodyItem
21 + anchors.fill: parent
22 + anchors.margins: root.padding
23 + readonly property Item child: children.length > 0 ? children[0] : null
24 + implicitWidth: child ? child.implicitWidth : 0
25 + implicitHeight: child ? child.implicitHeight : 0
26 + }

quickshell/nuguland/PopupTextField.qml

Added
new file mode 100644
1 +import QtQuick
3 +Rectangle {
4 + id: root
6 + required property Theme theme
7 + property alias text: input.text
8 + property alias echoMode: input.echoMode
9 + property alias inputMethodHints: input.inputMethodHints
10 + property string placeholderText: ""
11 + property string icon: ""
12 + property string fontFamily: "IBM Plex Sans"
13 + property int fontPixelSize: 14
14 + property alias input: input
15 + signal accepted
16 + signal cancelled
17 + signal edited(string text)
19 + implicitWidth: 220
20 + implicitHeight: 38
21 + radius: 10
22 + color: theme.withAlpha(theme.content.backdrop, input.activeFocus ? 0.9 : 0.68)
23 + border.width: input.activeFocus ? 2 : 1
24 + border.color: input.activeFocus ? theme.content.focus : theme.withAlpha(theme.ui.minor, 0.55)
26 + Text {
27 + visible: root.icon.length > 0
28 + anchors.left: parent.left
29 + anchors.leftMargin: 12
30 + anchors.verticalCenter: parent.verticalCenter
31 + color: root.theme.ui.minor
32 + font.family: "Symbols Nerd Font Mono"
33 + font.pixelSize: 13
34 + text: root.icon
35 + }
37 + NuguText {
38 + anchors.left: parent.left
39 + anchors.right: parent.right
40 + anchors.leftMargin: root.icon.length > 0 ? 34 : 12
41 + anchors.rightMargin: 12
42 + anchors.verticalCenter: parent.verticalCenter
43 + visible: input.text.length === 0 && !input.activeFocus
44 + theme: root.theme
45 + variant: "meta"
46 + text: root.placeholderText
47 + }
49 + TextInput {
50 + id: input
52 + anchors.fill: parent
53 + anchors.leftMargin: root.icon.length > 0 ? 34 : 12
54 + anchors.rightMargin: 12
55 + verticalAlignment: TextInput.AlignVCenter
56 + color: root.theme.content.normal
57 + selectionColor: root.theme.ui.accent
58 + selectedTextColor: root.theme.content.backdrop
59 + font.family: root.fontFamily
60 + font.pixelSize: root.fontPixelSize
61 + activeFocusOnTab: true
62 + clip: true
63 + Accessible.role: Accessible.EditableText
64 + Accessible.name: root.placeholderText
65 + onAccepted: root.accepted()
66 + onTextEdited: root.edited(text)
67 + Keys.onEscapePressed: event => {
68 + event.accepted = true;
69 + root.cancelled();
70 + }
71 + }

quickshell/nuguland/PowerPanel.qml

Modified
96 96 Keys.onReturnPressed: root.panelState.pendingConfirmation ? root.confirm(root.panelState.pendingConfirmation) : root.runSession("lock")
97 97 Keys.onEnterPressed: root.panelState.pendingConfirmation ? root.confirm(root.panelState.pendingConfirmation) : root.runSession("lock")
99 - Rectangle {
99 + PopupCard {
100 100 objectName: "batteryHero"
101 + theme: root.theme
102 + padding: 0
103 + active: true
104 + attention: root.battery.role === "warning"
105 + destructive: root.battery.role === "error"
101 106 width: parent.width
102 107 height: root.hasMainBattery ? 116 : 0
103 - radius: 18
104 108 visible: root.hasMainBattery
105 - color: root.theme ? root.theme.withAlpha(root.theme.ui.backdrop, 0.56) : "transparent"
106 - border.width: 1
107 - border.color: root.theme ? root.theme.withAlpha(root.roleColor(root.battery.role || "ui.accent"), 0.65) : "transparent"
109 110 Rectangle {
110 111 id: batteryDial
170 171 Repeater {
171 172 model: root.devices
173 - delegate: Rectangle {
174 + delegate: PopupCard {
174 175 id: deviceChip
176 177 required property var modelData
179 + theme: root.theme
180 + padding: 0
178 181 width: Math.floor((root.width - 8) / 2)
179 182 height: 32
180 - radius: 11
181 - color: root.theme ? root.theme.withAlpha(root.theme.ui.backdrop, 0.55) : "transparent"
182 - border.width: 1
183 - border.color: root.theme ? root.theme.withAlpha(root.theme.ui.minor, 0.42) : "transparent"
185 184 NuguText {
186 185 anchors.left: parent.left
222 221 Repeater {
223 222 model: root.safeActions
225 - delegate: Rectangle {
224 + delegate: PopupButton {
226 225 id: safeButton
228 227 required property string modelData
229 - readonly property bool primary: modelData === "lock"
228 + readonly property bool isPrimary: modelData === "lock"
230 + theme: root.theme
231 231 width: Math.floor((root.width - safeGrid.columnSpacing * (safeGrid.columns - 1)) / safeGrid.columns)
232 232 height: 42
233 - radius: 13
234 - color: root.theme ? root.theme.withAlpha(primary ? root.theme.ui.accent : root.theme.ui.minor, primary ? 0.22 : 0.12) : "transparent"
235 - border.width: 1
236 - border.color: root.theme ? root.theme.withAlpha(primary ? root.theme.ui.accent : root.theme.ui.minor, primary ? 0.78 : 0.36) : "transparent"
238 - NuguText {
239 - anchors.centerIn: parent
240 - theme: root.theme
241 - variant: "meta"
242 - text: root.actionLabel(safeButton.modelData)
243 - color: root.theme ? root.theme.content.normal : "white"
244 - }
246 - MouseArea {
247 - anchors.fill: parent
248 - hoverEnabled: true
249 - cursorShape: Qt.PointingHandCursor
250 - onClicked: root.runSession(safeButton.modelData)
251 - }
233 + text: root.actionLabel(modelData)
234 + role: isPrimary ? "primary" : "normal"
235 + onClicked: root.runSession(modelData)
256 - Rectangle {
240 + PopupCard {
257 241 objectName: "dangerRegion"
242 + theme: root.theme
243 + padding: 0
244 + attention: !!root.panelState.pendingConfirmation
245 + destructive: !root.panelState.pendingConfirmation
258 246 width: parent.width
259 247 height: root.panelState.pendingConfirmation ? 62 : 58
260 - radius: 18
261 - color: root.theme ? root.theme.withAlpha(root.panelState.pendingConfirmation ? root.theme.warning : root.theme.error, root.panelState.pendingConfirmation ? 0.12 : 0.08) : "transparent"
262 - border.width: 1
263 - border.color: root.theme ? root.theme.withAlpha(root.panelState.pendingConfirmation ? root.theme.warning : root.theme.error, 0.62) : "transparent"
265 249 Grid {
266 250 id: dangerGrid
274 258 Repeater {
275 259 model: root.destructiveActions
277 - delegate: Rectangle {
261 + delegate: PopupButton {
278 262 id: dangerButton
280 264 required property string modelData
266 + theme: root.theme
282 267 width: Math.floor((dangerGrid.width - dangerGrid.columnSpacing * 2) / 3)
283 268 height: 38
284 - radius: 12
285 - color: root.theme ? root.theme.withAlpha(root.theme.error, dangerArea.containsMouse ? 0.2 : 0.12) : "transparent"
286 - border.width: 1
287 - border.color: root.theme ? root.theme.withAlpha(root.theme.error, 0.5) : "transparent"
289 - NuguText {
290 - anchors.centerIn: parent
291 - theme: root.theme
292 - variant: "meta"
293 - text: root.actionLabel(dangerButton.modelData)
294 - color: root.theme ? root.theme.content.normal : "white"
295 - }
297 - MouseArea {
298 - id: dangerArea
300 - anchors.fill: parent
301 - hoverEnabled: true
302 - cursorShape: Qt.PointingHandCursor
303 - onClicked: root.runSession(dangerButton.modelData)
304 - }
269 + text: root.actionLabel(modelData)
270 + role: "destructive"
271 + onClicked: root.runSession(modelData)
322 289 elide: Text.ElideRight
325 - Rectangle {
292 + PopupButton {
326 293 id: confirmButton
328 294 anchors.verticalCenter: parent.verticalCenter
295 + theme: root.theme
329 296 width: 82
330 297 height: 38
331 - radius: 12
332 - color: root.theme ? root.theme.withAlpha(root.theme.warning, confirmArea.containsMouse ? 0.28 : 0.18) : "transparent"
333 - border.width: 1
334 - border.color: root.theme ? root.theme.warning : "transparent"
336 - NuguText {
337 - anchors.centerIn: parent
338 - theme: root.theme
339 - variant: "meta"
340 - text: "confirm"
341 - color: root.theme ? root.theme.content.normal : "white"
342 - }
344 - MouseArea {
345 - id: confirmArea
347 - anchors.fill: parent
348 - hoverEnabled: true
349 - cursorShape: Qt.PointingHandCursor
350 - onClicked: root.confirm(root.panelState.pendingConfirmation)
351 - }
298 + text: "confirm"
299 + role: "destructive"
300 + onClicked: root.confirm(root.panelState.pendingConfirmation)
354 - Rectangle {
303 + PopupButton {
355 304 id: cancelButton
357 305 anchors.verticalCenter: parent.verticalCenter
306 + theme: root.theme
358 307 width: 74
359 308 height: 38
360 - radius: 12
361 - color: root.theme ? root.theme.withAlpha(root.theme.ui.minor, cancelArea.containsMouse ? 0.18 : 0.1) : "transparent"
362 - border.width: 0
363 - border.color: "transparent"
365 - NuguText {
366 - anchors.centerIn: parent
367 - theme: root.theme
368 - variant: "meta"
369 - text: "cancel"
370 - color: root.theme ? root.theme.content.normal : "white"
371 - }
373 - MouseArea {
374 - id: cancelArea
376 - anchors.fill: parent
377 - hoverEnabled: true
378 - cursorShape: Qt.PointingHandCursor
379 - onClicked: root.cancel()
380 - }
309 + text: "cancel"
310 + onClicked: root.cancel()

quickshell/nuguland/SetupField.qml

Modified
1 1 import QtQuick
3 -Rectangle {
3 +PopupTextField {
4 4 id: root
6 - required property Theme theme
7 - property alias field: input
6 + property alias field: root.input
8 7 property string placeholder: ""
9 8 property bool secret: false
10 - property string text: ""
11 - signal edited(string text)
13 10 width: parent ? parent.width : 0
14 11 height: 30
15 - radius: 10
16 - color: theme ? theme.withAlpha(theme.ui.minor, 0.14) : "transparent"
18 - TextInput {
19 - id: input
21 - anchors.fill: parent
22 - anchors.leftMargin: 10
23 - anchors.rightMargin: 10
24 - verticalAlignment: TextInput.AlignVCenter
25 - color: root.theme ? root.theme.content.normal : "white"
26 - selectionColor: root.theme ? root.theme.ui.focus : "#ffffff"
27 - selectedTextColor: root.theme ? root.theme.content.backdrop : "black"
28 - font.family: "IBM Plex Sans"
29 - font.pixelSize: 13
30 - echoMode: root.secret ? TextInput.Password : TextInput.Normal
31 - text: root.text
32 - clip: true
33 - onTextEdited: root.edited(text)
34 - }
36 - NuguText {
37 - anchors.left: parent.left
38 - anchors.leftMargin: 10
39 - anchors.verticalCenter: parent.verticalCenter
40 - visible: input.text.length === 0
41 - theme: root.theme
42 - variant: "meta"
43 - text: root.placeholder
44 - }
12 + placeholderText: placeholder
13 + echoMode: secret ? TextInput.Password : TextInput.Normal

quickshell/nuguland/Tray.qml

Modified
108 108 return null;
111 + function menuFor(id) {
112 + const item = nativeItemById(id);
113 + return item && item.hasMenu ? item.menu : null;
111 116 function selectedItem() {
112 117 const items = itemsArray();
113 118 if (items.length === 0)
248 253 return stateJson();
256 + function displayMenu(id, parentWindow, x, y) {
257 + const item = nativeItemById(id);
258 + if (!item || !item.hasMenu || !parentWindow)
259 + return stateJson();
260 + item.display(parentWindow, Math.round(x), Math.round(y));
261 + lastAction = {
262 + "kind": "display-menu",
263 + "id": String(id),
264 + "accepted": true,
265 + "native": true
266 + };
267 + return stateJson();
270 + function primaryActivate(id, parentWindow, x, y) {
271 + const item = nativeItemById(id);
272 + if (item && item.onlyMenu)
273 + return displayMenu(id, parentWindow, x, y);
274 + return activateRow(id);
277 + function secondaryActivate(id) {
278 + const item = nativeItemById(id);
279 + if (item) {
280 + item.secondaryActivate();
281 + lastAction = {
282 + "kind": "secondary-activate",
283 + "id": String(id),
284 + "accepted": true,
285 + "native": true
286 + };
288 + return stateJson();
251 291 function activateRow(id) {
252 292 const item = nativeItemById(id);
253 293 if (item) {

quickshell/nuguland/TrayPanel.qml

Modified
1 1 pragma ComponentBehavior: Bound
2 2 import QtQuick
3 +import Quickshell
3 4 import "Util.js" as Util
5 6 Column {
19 20 panelState = Util.parseJson(text, panelState);
22 - function activate(id) {
23 + function primary(id, window, x, y) {
23 24 if (trayService)
24 - refreshFrom(trayService.activateRow(id));
25 + refreshFrom(trayService.primaryActivate(id, window, x, y));
26 + }
28 + function menu(id, window, x, y) {
29 + if (trayService)
30 + refreshFrom(trayService.displayMenu(id, window, x, y));
31 + }
33 + function secondary(id) {
34 + if (trayService)
35 + refreshFrom(trayService.secondaryActivate(id));
27 38 spacing: 10
28 39 width: parent ? parent.width : 0
30 - Flow {
31 - objectName: "trayItems"
41 + PopupSection {
32 42 visible: root.hasItems
33 43 width: parent.width
34 - spacing: 8
44 + theme: root.theme
45 + title: "tray"
46 + detail: `${root.items.length}`
36 - Repeater {
37 - model: root.items
48 + Flow {
49 + objectName: "trayItems"
50 + width: parent.width
51 + spacing: 8
39 - delegate: Rectangle {
40 - id: itemCell
53 + Repeater {
54 + model: root.items
42 - required property var modelData
43 - readonly property bool attention: modelData.status === "NeedsAttention"
56 + delegate: PopupCard {
57 + id: itemCell
45 - width: 168
46 - height: 46
47 - radius: 12
48 - color: root.theme ? root.theme.withAlpha(attention ? root.theme.info : root.theme.ui.accent, attention ? 0.2 : 0.12) : "transparent"
49 - border.width: 0
50 - border.color: root.theme ? (attention ? root.theme.info : root.theme.ui.accent) : "transparent"
59 + required property var modelData
60 + readonly property bool needsAttention: modelData.status === "NeedsAttention"
61 + readonly property string tooltipTitle: modelData.tooltipTitle || ""
62 + readonly property string description: modelData.tooltipDescription || ""
63 + readonly property string statusText: String(modelData.status || "passive").toLowerCase()
64 + readonly property string categoryText: String(modelData.category || "application status").replace(/([a-z])([A-Z])/g, "$1 $2").toLowerCase()
65 + readonly property string menuText: modelData.onlyMenu ? "menu only" : (modelData.hasMenu ? "menu" : "")
52 - Row {
53 - anchors.fill: parent
54 - anchors.leftMargin: 11
55 - anchors.rightMargin: 11
56 - spacing: 10
58 - Image {
59 - anchors.verticalCenter: parent.verticalCenter
60 - width: 24
61 - height: 24
62 - sourceSize.width: 24
63 - sourceSize.height: 24
64 - fillMode: Image.PreserveAspectFit
65 - source: itemCell.modelData.icon || ""
66 - visible: status === Image.Ready
67 + function openMenu(x, y) {
68 + if (nativeMenu.menu) {
69 + nativeMenu.anchor.rect = Qt.rect(Math.round(x), Math.round(y), 1, 1);
70 + nativeMenu.open();
71 + }
69 - NuguText {
70 - anchors.verticalCenter: parent.verticalCenter
71 - theme: root.theme
72 - variant: "meta"
73 - selected: itemCell.attention
74 - text: itemCell.modelData.title
75 - width: parent.width - 34
76 - elide: Text.ElideRight
77 - }
78 - }
74 + theme: root.theme
75 + padding: 0
76 + attention: needsAttention
77 + hoverable: true
78 + externallyPressed: trayArea.pressed
79 + width: root.width
80 + height: tooltipTitle.length > 0 || description.length > 0 ? 96 : 76
81 + role: modelData.title || "tray item"
80 - MouseArea {
81 - anchors.fill: parent
82 - onClicked: root.activate(itemCell.modelData.id)
83 + QsMenuAnchor {
84 + id: nativeMenu
85 + menu: root.trayService ? root.trayService.menuFor(itemCell.modelData.id) : null
86 + anchor.item: itemCell
87 + }
89 + Row {
90 + anchors.fill: parent
91 + anchors.margins: 12
92 + spacing: 12
94 + Rectangle {
95 + anchors.verticalCenter: parent.verticalCenter
96 + width: 40
97 + height: 40
98 + radius: 12
99 + color: root.theme ? root.theme.withAlpha(itemCell.needsAttention ? root.theme.warning : root.theme.ui.accent, 0.16) : "transparent"
101 + Image {
102 + anchors.centerIn: parent
103 + width: 26
104 + height: 26
105 + sourceSize.width: 26
106 + sourceSize.height: 26
107 + fillMode: Image.PreserveAspectFit
108 + source: itemCell.modelData.icon || ""
112 + Column {
113 + anchors.verticalCenter: parent.verticalCenter
114 + width: parent.width - 142
115 + spacing: 3
117 + NuguText {
118 + width: parent.width
119 + theme: root.theme
120 + variant: "title"
121 + text: itemCell.modelData.title || itemCell.modelData.tooltipTitle || itemCell.modelData.id
122 + elide: Text.ElideRight
125 + NuguText {
126 + visible: itemCell.tooltipTitle.length > 0 && itemCell.tooltipTitle !== itemCell.modelData.title
127 + width: parent.width
128 + theme: root.theme
129 + variant: "meta"
130 + text: itemCell.tooltipTitle
131 + elide: Text.ElideRight
134 + NuguText {
135 + visible: itemCell.description.length > 0
136 + width: parent.width
137 + theme: root.theme
138 + variant: "meta"
139 + text: itemCell.description
140 + elide: Text.ElideRight
143 + NuguText {
144 + width: parent.width
145 + theme: root.theme
146 + variant: "meta"
147 + text: itemCell.menuText.length > 0 ? `${itemCell.categoryText} · ${itemCell.menuText}` : itemCell.categoryText
148 + elide: Text.ElideRight
152 + NuguText {
153 + anchors.verticalCenter: parent.verticalCenter
154 + width: 66
155 + horizontalAlignment: Text.AlignRight
156 + theme: root.theme
157 + variant: "meta"
158 + selected: itemCell.needsAttention
159 + text: itemCell.statusText
163 + MouseArea {
164 + id: trayArea
165 + anchors.fill: parent
166 + acceptedButtons: Qt.LeftButton | Qt.MiddleButton | Qt.RightButton
167 + hoverEnabled: true
168 + cursorShape: Qt.PointingHandCursor
169 + onClicked: event => {
170 + if (event.button === Qt.RightButton || (event.button === Qt.LeftButton && itemCell.modelData.onlyMenu))
171 + itemCell.openMenu(event.x, event.y);
172 + else if (event.button === Qt.MiddleButton)
173 + root.secondary(itemCell.modelData.id);
174 + else
175 + root.primary(itemCell.modelData.id, itemCell.QsWindow.window, event.x, event.y);
115 210 anchors.horizontalCenter: parent.horizontalCenter
116 211 theme: root.theme
117 212 variant: "title"
118 - text: "No tray icons"
213 + text: "no tray icons"
121 216 NuguText {
122 217 anchors.horizontalCenter: parent.horizontalCenter
123 218 theme: root.theme
124 219 variant: "meta"
125 - text: "Background apps show up here"
220 + text: "background apps show up here"

quickshell/nuguland/contrast.test.js

Added
new file mode 100644
1 +'use strict';
3 +const assert = require('assert');
4 +const fs = require('fs');
6 +const theme = fs.readFileSync('Theme.qml', 'utf8');
7 +function token(name, occurrence = 0) {
8 + const matches = [...theme.matchAll(new RegExp(`"${name}": "(#[0-9a-fA-F]{6})"`, 'g'))];
9 + assert(matches[occurrence], `missing theme token: ${name}[${occurrence}]`);
10 + return matches[occurrence][1];
12 +function rgb(hex) {
13 + return [1, 3, 5].map(i => parseInt(hex.slice(i, i + 2), 16) / 255);
15 +function composite(fg, bg, alpha) {
16 + const a = rgb(fg);
17 + const b = rgb(bg);
18 + return a.map((v, i) => v * alpha + b[i] * (1 - alpha));
20 +function luminance(color) {
21 + const values = typeof color === 'string' ? rgb(color) : color;
22 + const linear = values.map(v => v <= 0.04045 ? v / 12.92 : ((v + 0.055) / 1.055) ** 2.4);
23 + return linear[0] * 0.2126 + linear[1] * 0.7152 + linear[2] * 0.0722;
25 +function contrast(a, b) {
26 + const x = luminance(a);
27 + const y = luminance(b);
28 + return (Math.max(x, y) + 0.05) / (Math.min(x, y) + 0.05);
31 +const normal = token('normal', 0);
32 +const backdrop = token('backdrop', 1);
33 +const accent = token('accent', 1);
34 +const worstInteractiveFill = composite(accent, backdrop, 0.38);
35 +assert(contrast(normal, worstInteractiveFill) >= 4.5, 'normal text meets WCAG AA on strongest interactive fill');
37 +const button = fs.readFileSync('PopupButton.qml', 'utf8');
38 +const badge = fs.readFileSync('PopupBadge.qml', 'utf8');
39 +const text = fs.readFileSync('NuguText.qml', 'utf8');
40 +assert(!/selected:\s*root\.checked \|\| root\.primary/.test(button), 'buttons never select dark text on dark translucent fills');
41 +assert(/color:\s*root\.theme\.content\.normal/.test(badge), 'badge text uses readable content color');
42 +assert(!/selected \? theme\.content\.backdrop/.test(text), 'selected text stays readable on translucent dark controls');
44 +console.log('contrast.test.js: ALL PASS');

quickshell/nuguland/justfile

Modified
60 60 exit 1
63 +# run JS tests; pass a file, basename, or stem for one test
64 +# examples: just test, just test network, just test network.test.js
65 +test name="":
66 + #!/usr/bin/env bash
67 + set -euo pipefail
68 + target={{quote(name)}}
69 + if [[ -n "$target" ]]; then
70 + case "$target" in
71 + /*|*..*|*$'\n'*|*$'\r'*) echo "unsafe test: $target" >&2; exit 2 ;;
72 + esac
73 + if [[ "$target" != *.js && "$target" != *.mjs ]]; then
74 + if [[ -f "$target.test.js" ]]; then
75 + target="$target.test.js"
76 + elif [[ -f "$target.test.mjs" ]]; then
77 + target="$target.test.mjs"
78 + else
79 + target="$target.test.js"
80 + fi
81 + fi
82 + [[ -f "$target" ]] || { echo "missing test: $target" >&2; exit 2; }
83 + node "$target"
84 + exit
85 + fi
87 + mapfile -t tests < <(find . -maxdepth 1 \( -name '*.test.js' -o -name '*.test.mjs' \) -print | sort)
88 + ((${#tests[@]} > 0)) || { echo "no tests" >&2; exit 1; }
89 + for file in "${tests[@]}"; do
90 + node "$file"
91 + done
63 93 # format Nuguland QML and shell scripts in place
64 94 fmt:
65 95 #!/usr/bin/env bash

quickshell/nuguland/network.js

Modified
127 127 // [{ id, ssid, security, signal:0..4, connected, known, needsPassphrase, path }]
128 128 function networkRows(managed, ordered) {
129 129 var nets = (managed && managed.networks) ? managed.networks : {};
130 - var list = ordered || [];
130 + var list = Array.isArray(ordered) ? ordered : [];
131 131 var rows = [];
132 - for (var i = 0; i < list.length; i++) {
133 - var o = list[i];
134 - var n = nets[o.path];
135 - if (!n) continue;
136 - rows.push({
137 - id: networkId(n.ssid),
138 - ssid: n.ssid,
139 - security: n.security,
140 - signal: signalBars(o.signal),
141 - signalDbm: dbmFromCenti(o.signal),
142 - connected: n.connected,
143 - known: n.known,
144 - needsPassphrase: needsPassphrase(n.security, n.known),
145 - path: o.path
146 - });
132 + var used = {};
134 + function identity(net) {
135 + return String(net.ssid || "") + "\u0000" + String(net.security || "");
137 + function append(path, net, rawSignal, atFront) {
138 + if (!net || used[path]) return;
139 + var row = {
140 + id: networkId(net.ssid),
141 + ssid: net.ssid,
142 + security: net.security,
143 + signal: rawSignal === null ? 0 : signalBars(rawSignal),
144 + signalDbm: rawSignal === null ? null : dbmFromCenti(rawSignal),
145 + connected: net.connected,
146 + known: net.known,
147 + needsPassphrase: needsPassphrase(net.security, net.known),
148 + path: path
149 + };
150 + used[path] = true;
151 + if (atFront) rows.unshift(row); else rows.push(row);
154 + for (var i = 0; i < list.length; i++) {
155 + var orderedRow = list[i];
156 + var path = orderedRow.path;
157 + var net = nets[path];
158 + if (!net && (orderedRow.ssid || orderedRow.security)) {
159 + var wanted = identity(orderedRow);
160 + for (var candidate in nets) {
161 + if (!used[candidate] && identity(nets[candidate]) === wanted) {
162 + path = candidate;
163 + net = nets[candidate];
164 + break;
168 + append(path, net, orderedRow.signal, false);
171 + // ObjectManager and Station snapshots can race. Retain unmatched managed
172 + // rows rather than flashing an empty model; a missing connected row leads.
173 + for (var managedPath in nets)
174 + if (!used[managedPath] && nets[managedPath].connected)
175 + append(managedPath, nets[managedPath], null, true);
176 + for (var fallbackPath in nets)
177 + if (!used[fallbackPath])
178 + append(fallbackPath, nets[fallbackPath], null, false);
148 179 return rows;
188 219 // securityLabel(sec) — human label for the security token.
189 220 function securityLabel(sec) {
190 - if (sec === "open") return "Open";
191 - if (sec === "psk") return "WPA";
192 - if (sec === "8021x") return "Enterprise";
221 + if (sec === "open") return "open";
222 + if (sec === "psk") return "wpa";
223 + if (sec === "8021x") return "enterprise";
193 224 return sec ? sec : "";

quickshell/nuguland/network.test.js

Modified
91 91 // an ordered path with no matching managed network is skipped, not crashed
92 92 eq(N.networkRows({ networks: {} }, [{ path: '/ghost', signal: -5000 }]).length, 0, 'orphan ordered path skipped');
94 +// --- racing snapshots: reconcile by canonical identity --------------------
95 +var churnManaged = {
96 + station: { connectedNetwork: '/managed/home' },
97 + networks: {
98 + '/managed/home': { ssid: 'home', security: 'psk', connected: true, known: true },
99 + '/managed/cafe': { ssid: 'cafe', security: 'open', connected: false, known: false }
102 +var churnRows = N.networkRows(churnManaged, [
103 + { path: '/ordered/cafe', signal: -5100, ssid: 'cafe', security: 'open' },
104 + { path: '/ordered/home', signal: -7000, ssid: 'home', security: 'psk' }
105 +]);
106 +eq(churnRows.length, 2, 'path churn keeps usable ordered rows');
107 +eq(churnRows[0].ssid, 'cafe', 'ordered identity preserves iwd ordering');
108 +eq(churnRows.filter(function (r) { return r.connected; }).length, 1, 'connected identity emitted once');
109 +var fallbackRows = N.networkRows(churnManaged, [
110 + { path: '/managed/cafe', signal: -5100 }
111 +]);
112 +eq(fallbackRows.length, 2, 'managed connected network missing from ordered reply is retained');
113 +eq(fallbackRows[0].ssid, 'home', 'connected fallback is placed first');
114 +eq(fallbackRows[0].signal, 0, 'connected fallback has deterministic unknown signal');
94 116 // --- view helpers ----------------------------------------------------------
95 117 eq(N.signalRole(0), 'ui.minor', 'role weak');
96 118 eq(N.signalRole(1), 'ui.minor', 'role 1 bar weak');
97 119 eq(N.signalRole(2), 'ui.accent', 'role medium');
98 120 eq(N.signalRole(3), 'ui.accent', 'role 3 medium');
99 121 eq(N.signalRole(4), 'content.accent', 'role strong');
100 -eq(N.securityLabel('psk'), 'WPA', 'psk label');
101 -eq(N.securityLabel('open'), 'Open', 'open label');
102 -eq(N.securityLabel('8021x'), 'Enterprise', 'enterprise label');
122 +eq(N.securityLabel('psk'), 'wpa', 'psk label');
123 +eq(N.securityLabel('open'), 'open', 'open label');
124 +eq(N.securityLabel('8021x'), 'enterprise', 'enterprise label');
103 125 eq(N.needsPassphrase('open', false), false, 'open never needs passphrase');
104 126 eq(N.needsPassphrase('psk', true), false, 'known psk needs no passphrase');
105 127 eq(N.needsPassphrase('psk', false), true, 'unknown psk needs passphrase');

quickshell/nuguland/notifications.test.js

Added
new file mode 100644
1 +'use strict';
3 +const assert = require('assert');
4 +const fs = require('fs');
5 +const os = require('os');
6 +const path = require('path');
7 +const { spawn, spawnSync } = require('child_process');
9 +const tmp = fs.mkdtempSync(path.join(os.tmpdir(), 'nuguland-ipc-'));
10 +const name = `test-${process.pid}`;
11 +const configDir = path.join(tmp, 'quickshell', name);
12 +const testEnv = { ...process.env, XDG_CONFIG_HOME: tmp, QT_NO_XDG_DESKTOP_PORTAL: '1' };
13 +const output = [];
14 +let proc;
16 +function ipc(method) {
17 + return spawnSync('qs', ['ipc', '-c', name, 'call', 'tests', method], {
18 + encoding: 'utf8',
19 + env: testEnv,
20 + timeout: 2000
21 + });
24 +try {
25 + fs.mkdirSync(configDir, { recursive: true });
26 + for (const file of ['Notifications.qml', 'Network.qml', 'network.js'])
27 + fs.symlinkSync(path.join(__dirname, file), path.join(configDir, file));
28 + fs.writeFileSync(path.join(configDir, 'shell.qml'), `
29 +import QtQuick
30 +import Quickshell
31 +import Quickshell.Io
32 +ShellRoot {
33 + Notifications { id: notifications }
34 + Network { id: network }
35 + IpcHandler {
36 + target: "tests"
37 + function notifications(): string { return JSON.stringify(notifications.selfTest()); }
38 + function network(): string { return network.selfTest(); }
39 + function ready(): string { return "ready"; }
40 + }
42 +`);
43 + proc = spawn('qs', ['-c', name], {
44 + env: testEnv,
45 + stdio: ['ignore', 'pipe', 'pipe']
46 + });
47 + proc.stdout.on('data', chunk => output.push(String(chunk)));
48 + proc.stderr.on('data', chunk => output.push(String(chunk)));
50 + let ready = false;
51 + for (let attempt = 0; attempt < 80; attempt++) {
52 + const result = ipc('ready');
53 + if (result.status === 0 && result.stdout.trim() === 'ready') {
54 + ready = true;
55 + break;
56 + }
57 + Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, 50);
58 + }
59 + assert(ready, `isolated Quickshell IPC did not become ready: ${output.join('')}`);
60 + for (const method of ['notifications', 'network']) {
61 + const result = ipc(method);
62 + assert.strictEqual(result.status, 0, result.stderr);
63 + const report = JSON.parse(result.stdout);
64 + const passed = typeof report.pass === 'boolean' ? report.pass : report.fail === 0;
65 + assert.strictEqual(passed, true, `${method}: ${JSON.stringify(report.failures || report.cases || [])}`);
66 + }
67 + assert(!/WARN|ERROR|Error parsing|deprecated|Could not|failed/.test(output.join('')), output.join(''));
68 + console.log('notifications.test.js: ALL PASS');
69 +} finally {
70 + if (proc) proc.kill('SIGTERM');
71 + fs.rmSync(tmp, { recursive: true, force: true });

quickshell/nuguland/popup-controls.test.js

Added
new file mode 100644
1 +'use strict';
3 +const assert = require('assert');
4 +const fs = require('fs');
6 +const controls = ['PopupSurface', 'PopupSection', 'PopupCard', 'PopupButton', 'PopupBadge', 'PopupDivider', 'PopupSlider', 'PopupTextField'];
7 +for (const control of controls)
8 + assert(fs.existsSync(`${control}.qml`), `${control}.qml must exist`);
10 +const host = fs.readFileSync('PopoutHost.qml', 'utf8');
11 +assert.strictEqual((host.match(/PopupSurface\s*\{/g) || []).length, 1, 'host has exactly one popup surface');
12 +for (const control of ['PopupSurface', 'PopupSection', 'PopupCard'])
13 + assert(!/childrenRect/.test(fs.readFileSync(`${control}.qml`, 'utf8')), `${control} avoids container binding loops`);
14 +const popupCard = fs.readFileSync('PopupCard.qml', 'utf8');
15 +assert(/root\.interactive && root\.enabled/.test(popupCard), 'disabled cards reject pointer activation');
16 +assert(/interactive && enabled/.test(popupCard), 'disabled cards reject keyboard activation');
17 +const popupTextField = fs.readFileSync('PopupTextField.qml', 'utf8');
18 +assert(/TextInput\s*\{[\s\S]*?clip:\s*true/.test(popupTextField), 'shared text input clips long text');
19 +const notificationCard = fs.readFileSync('NotificationCard.qml', 'utf8');
20 +assert(/iconSource:\s*actionBtn\.actIcon/.test(notificationCard), 'notification actions retain advertised icons');
21 +assert(!/height:\s*3\s*\n\s*color:.*ui\.accent/.test(fs.readFileSync('LauncherPanel.qml', 'utf8')), 'launcher accent removed');
22 +assert(!/left accent bar/.test(fs.readFileSync('AudioPanel.qml', 'utf8')), 'audio accent strips removed');
23 +const keybinds = fs.readFileSync('../../niri/cfg/keybinds.kdl', 'utf8');
24 +assert(/Mod\+Escape[^}]*notificationsDismissToasts/s.test(keybinds), 'super+escape dismisses notification toasts');
25 +const bluetoothService = fs.readFileSync('Bluetooth.qml', 'utf8');
26 +const connectivityPanel = fs.readFileSync('ConnectivityPanel.qml', 'utf8');
27 +assert(/signal refreshed/.test(bluetoothService) && /refreshTimer\.restart\(\)/.test(bluetoothService), 'bluetooth actions schedule async refreshes');
28 +assert(/target:\s*root\.bluetoothService[\s\S]*onRefreshed/.test(connectivityPanel), 'open connectivity popup follows bluetooth refreshes');
30 +const trayService = fs.readFileSync('Tray.qml', 'utf8');
31 +assert(/item\.onlyMenu[\s\S]*displayMenu/.test(trayService), 'only-menu tray items open their menu');
32 +assert(/item\.display\(/.test(trayService), 'tray service exposes native menu display');
33 +assert(/item\.secondaryActivate\(\)/.test(trayService), 'tray service exposes secondary activation');
34 +const trayPanel = fs.readFileSync('TrayPanel.qml', 'utf8');
35 +assert(/Qt\.LeftButton \| Qt\.MiddleButton \| Qt\.RightButton/.test(trayPanel), 'tray cards accept all documented buttons');
36 +assert(/QsMenuAnchor\s*\{[\s\S]*root\.trayService\.menuFor/.test(trayPanel), 'tray right click uses a native menu anchor');
38 +const panels = ['ConnectivityPanel', 'AudioPanel', 'TrayPanel', 'NotificationGroup', 'NotificationCard', 'ClipboardPanel', 'PowerPanel', 'BrightnessPanel', 'MediaPanel', 'NokoPanel', 'LauncherPanel'];
39 +for (const panel of panels) {
40 + const source = fs.readFileSync(`${panel}.qml`, 'utf8');
41 + assert(/Popup(?:Section|Card|Button|Badge|Divider|Slider|TextField)\s*\{/.test(source), `${panel} uses shared popup controls`);
42 + assert(!/text:\s*"[A-Z]/.test(source), `${panel} authored labels are lowercase`);
44 +for (const panel of ['AudioPanel', 'BrightnessPanel', 'MediaPanel'])
45 + assert(/PopupSlider\s*\{/.test(fs.readFileSync(`${panel}.qml`, 'utf8')), `${panel} uses the shared slider`);
46 +for (const panel of ['ConnectivityPanel', 'MediaPanel', 'NokoPanel'])
47 + assert(/PopupBadge\s*\{/.test(fs.readFileSync(`${panel}.qml`, 'utf8')), `${panel} uses shared status badges`);
48 +const nokoPanel = fs.readFileSync('NokoPanel.qml', 'utf8');
49 +assert(/updateBadge\.width - parent\.spacing \* 2/.test(nokoPanel), 'noko update badge reserves both row gaps');
50 +for (const panel of ['ClipboardPanel', 'ConnectivityPanel', 'LauncherPanel'])
51 + assert(/PopupTextField\s*\{/.test(fs.readFileSync(`${panel}.qml`, 'utf8')), `${panel} uses the shared text field`);
52 +console.log('popup-controls.test.js: ALL PASS');

quickshell/nuguland/privilege-ui.test.mjs

Modified
3 3 import assert from "node:assert/strict";
4 4 import { readFileSync } from "node:fs";
6 6 const qml = readFileSync(new URL("./shell.qml", import.meta.url), "utf8");
7 7 const privilegeQml = readFileSync(new URL("./Privilege.qml", import.meta.url), "utf8");
8 +const barQml = readFileSync(new URL("./Bar.qml", import.meta.url), "utf8");
9 +const popoutQml = readFileSync(new URL("./PopoutHost.qml", import.meta.url), "utf8");
8 10 const start = qml.indexOf("component PrivilegeSurface: Rectangle");
9 11 const end = qml.indexOf("component NokoFocusOverlay", start);
10 12 assert.notEqual(start, -1, "PrivilegeSurface component exists");
19 21 assert.match(surface, /password rejected/, "wrong password message is human-readable");
20 22 assert.match(surface, /secretInput\.forceActiveFocus\(\)/, "password input is explicitly focused");
21 23 assert.match(surface, /id:\s*focusRetry/, "focus retry timer exists for map-time focus races");
24 +assert.match(qml, /Variants\s*\{\s*model:\s*shell\.primaryScreens[\s\S]*?objectName:\s*"privilegeSecuritySurface"/, "exactly one primary-screen privilege window is instantiated");
22 25 assert.match(qml, /id:\s*privilegeSurface/, "privilege surface instance is addressable from PanelWindow");
26 +assert.match(barQml, /privilegeService:\s*root\.privilegeService/, "bar passes privilege state to its popout host");
27 +assert.match(popoutQml, /root\.visible && !root\.privilegeService\.active \? WlrKeyboardFocus\.Exclusive/, "popout releases exclusive keyboard focus during authentication");
23 28 assert.match(qml, /visible:\s*privilege\.active \|\| privilege\.error\.length > 0 \|\| privilege\.confirming/, "privilege window stays up for success confirmation");
24 29 assert.match(qml, /onVisibleChanged:\s*if \(visible\)\s*Qt\.callLater\(privilegeSurface\.focusSecret\)/, "PanelWindow asks password input for focus after mapping");
25 30 assert.match(privilegeQml, /property bool confirming:\s*false/, "privilege service exposes transient success confirmation state");

quickshell/nuguland/shell.qml

Modified
14 14 // Connector name of the monitor that hosts the interactive nuguland
15 15 // surfaces (bar, OSD, toasts). Set e.g. "DP-1" to pin them; left empty it
16 - // falls back to the first connected screen. The wallpaper backdrop and the
17 - // polkit security prompt deliberately stay on every screen.
16 + // falls back to the first connected screen. The wallpaper stays on every
17 + // screen; interactive security prompts stay on the primary screen.
18 18 property string primaryOutput: ""
19 19 readonly property var primaryScreens: {
20 20 const screens = Quickshell.screens;
514 514 Variants {
515 - model: Quickshell.screens
515 + model: shell.primaryScreens
517 517 delegate: Component {
518 518 PanelWindow {
586 586 networkService: network
587 587 bluetoothService: bluetooth
588 588 powerService: power
589 + privilegeService: privilege
589 590 idleService: idle
590 591 lockService: lock
591 592 nokoService: noko

quickshell/nuguland/sysinfo.js

Modified
268 268 id: "low-disk:" + keys[k],
269 269 severity: w.usedPercent >= 95 ? "error" : "warning",
270 270 icon: "",
271 - label: "Low disk space",
271 + label: "low disk space",
272 272 detail: w.target + " " + w.usedPercent + "%",
273 273 action: { kind: "open-mount", target: w.target }
281 281 id: "mem-pressure",
282 282 severity: "warning",
283 283 icon: "",
284 - label: "Memory pressure",
284 + label: "memory pressure",
285 285 detail: Math.round(Number(st.memoryUsage) * 100) + "% used, swapping",
286 286 action: { kind: "btm" }
295 295 id: "battery-health",
296 296 severity: health < 60 ? "error" : "warning",
297 297 icon: "",
298 - label: "Battery wear",
298 + label: "battery wear",
299 299 detail: Math.round(health) + "% health",
300 300 action: null
308 308 id: "high-load",
309 309 severity: "warning",
310 310 icon: "",
311 - label: "High load",
311 + label: "high load",
312 312 detail: Number(st.loadOne).toFixed(2) + " on " + Number(st.cores) + " cores",
313 313 action: { kind: "btm" }

zed/settings.json

Modified

Previous version contains binary or non-UTF-8 data.

Current version contains binary or non-UTF-8 data.