Skip to content

en Window Management and Scripts

Surfire edited this page Dec 4, 2026 · 1 revision

← Back to Home · 简体中文

Adaptive Window Tiling (win), Quicklinks & Local Scripts

Power up your daily desktop flow with orientation-aware window tiling, custom web & folder quicklinks, and local executable scripts.


1. Adaptive Window Tiling & Custom Ratios: win

Type win to arrange the active window or automatically tile multiple open windows without overlap across both landscape and portrait monitors.

Built-In Presets

Command Layout
win auto Auto-Tile: orientation-aware non-overlapping layout across active windows
win restore Batch Restore: revert recently tiled windows back to their original positions and sizes
win left / win right Left half / Right half
win top / win bottom Top half / Bottom half
win top third / win middle third / win bottom third Vertical thirds (great on portrait monitors)
win top 2/3 / win bottom 2/3 Top two-thirds / Bottom two-thirds
win max / win almost Maximize / Almost Maximize
win center / win reasonable Center / Reasonable Size (macOS)
win next / win prev Move window to next / previous display

Custom Split Ratios (v0.7.2+ / v0.8.0)

Divide your monitor into 2 to 4 custom segments (each weight 1–99, with the smallest segment ≥ 10% of the sum):

Syntax Examples Result
Compact digits win 21, win 12, win 73, win 121, win 1111 2:1, 1:2, 7:3, 1:2:1, 1:1:1:1
Colon-separated win 2:1, win 70:30, win 1:2:1 Proportional left→right (landscape) or top→bottom (portrait)
Space-separated win 70 30, win 2 5 3 Same as colon syntax (note: / is rejected)
  • Automatic reverse option: Asymmetric ratios like win 21 or win 70:30 show a live preview alongside the reversed option (1:2 / 30:70).
  • Multi-window reflow: Distributes windows in fixed spatial order and runs a second reflow pass for apps with minimum window widths; with only one window open, snaps it to the first segment on the left.
  • OS safety boundaries:
    • macOS: Uses Accessibility and gracefully skips AX-disabled windows without stalling.
    • Windows: Per-monitor DPI-aware work-area coordinates; strictly respects Windows UIPI (skips elevated admin windows cleanly with a clear status message instead of failing).

2. Quicklinks: Web Search Shortcuts & Project Aliases

Manage web search shortcuts, pinned apps, and project folder aliases under Settings → Quicklinks.

Built-In Web Shortcuts

  • g <query>: Enabled by default—searches Google (automatically uses attached selection or 60s-fresh clipboard text).
  • Opt-in built-ins (enable with one toggle in Settings):
    • gh <query>: GitHub Search
    • wiki <query>: Wikipedia (matches your UI language)
    • map <query>: Google Maps

Custom Web Quicklinks

  1. Under Settings → Quicklinks, add a Name, Alias (e.g. npm, mdn, jira), HTTPS Base URL (no query string or # fragment), and Query Parameter (e.g. q).
  2. Trigger anytime with <alias> <query>.

Pinned Project Folders & Aliases

Bind a frequent project directory to a short alias (e.g. kh → ~/Work/ClientA):

  • kh quote searches only inside ClientA.
  • kh + Tab jumps straight into its breadcrumb folder scope.
  • Pinned folders also surface at the top of the empty bar and inside Quick Switch file dialogs.

3. Local Scripts & Apple Shortcuts

Local Executable Scripts (macOS & Windows)

Enable and choose a local scripts folder under Settings → Scripts (Windows defaults to %LOCALAPPDATA%\Lumen\Scripts or portable data\Scripts, or a custom folder; scanned non-recursively with zero cloud hydration and no symlink traversal).

  • Supported types:
    • macOS: Any executable script (chmod +x) — Shell, Python, Ruby, Node, etc.
    • Windows: .ps1 (run silently via powershell.exe -NoProfile -ExecutionPolicy Bypass -File with CREATE_NO_WINDOW), .cmd, and .bat.
  • Metadata headers (@lumen.*): Declared in comments within the first 8 KiB (# or // on macOS; # in .ps1, REM or :: in .cmd/.bat):

macOS Shell Example (flush-dns.sh)

#!/bin/sh
# @lumen.title Flush Local DNS
# @lumen.alias dns
# @lumen.description Clear macOS DNS cache and print status
# @lumen.mode compact
# @lumen.argument1 domain

echo "Checked target: ${1:-all}"

Windows PowerShell Example (flush-dns.ps1)

# @lumen.title Flush Local DNS
# @lumen.alias dns
# @lumen.description Clear local Windows DNS cache
# @lumen.mode fullOutput
# @lumen.argument1 domain

param([string]$Target)
ipconfig /flushdns
if ($Target) { Write-Output "Target: $Target" }

@lumen.mode Display Modes

Mode Behavior
compact (default) Shows concise result text in the footer area
fullOutput Opens an expandable output card (scrollable with PgUp/PgDn)
inline Displays single-line inline output
silent Runs quietly in the background, notifying only on error

Safety limits: Scripts have a 30-second timeout and 256 KiB output cap. When @lumen.argument1 is declared, Lumen prompts for an argument or accepts your currently selected text/files automatically.

Apple Shortcuts (macOS Only)

Toggle Apple Shortcuts under Settings → Scripts to discover and trigger your macOS Shortcuts (/usr/bin/shortcuts) right from the Lumen search bar.


Next Guide: Indexing Scope, External Volumes & Privacy Boundaries →

Clone this wiki locally