Compare commits

..

3 commits
v0.1.0 ... main

Author SHA1 Message Date
b3b6605af9 install: auto-add the SUPER+SHIFT+V clipboard keybind too
The installer now writes both the keybind (bindings.conf) and the float rule
(windows.conf) — idempotent, backed up, reloads Hyprland. It skips the keybind
(with a printed fallback) if SUPER+SHIFT+V is already bound elsewhere, so it
never stomps an existing shortcut. README updated: no manual keybind step.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-08 19:20:59 +01:00
4ce4856134 install: auto-write the floating window rule on Omarchy
Both the Walker entry and the optional clipboard keybind now use the dedicated
'omagrab' app-id, and the installer writes the float/center/size rule to
windows.conf (idempotent, backed up, reloads Hyprland). No manual window-rule
step left — only the optional keybind is printed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-08 19:03:51 +01:00
522eef4b9e docs: use a real screenshot in the README
Replace the ASCII-art preview with an actual TUI screenshot.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-08 18:59:10 +01:00
3 changed files with 70 additions and 54 deletions

View file

@ -9,20 +9,9 @@ URL, pick Audio or Video, and watch it download with live progress. Built with G
> Wayland + `wl-clipboard`, and a Nerd Font terminal. There are no X11 / > Wayland + `wl-clipboard`, and a Nerd Font terminal. There are no X11 /
> non-Omarchy fallbacks. > non-Omarchy fallbacks.
``` <p align="center">
omagrab <img src="docs/screenshot.png" alt="omagrab TUI" width="700">
</p>
Audio ▐ Video ▌
▸ paste a URL and press enter…
✓ Big Buck Bunny (1080p) done
Sintel — Blender Open Movie ████████░░ 62% 4.2MiB/s
○ another queued link queued
tab audio/video · enter add · ↑↓ select · esc quit
empty box → c config · d remove · q quit
```
## Features ## Features
@ -54,8 +43,8 @@ sudo pacman -S yt-dlp ffmpeg wl-clipboard
## Install ## Install
One line — pulls in `yt-dlp`, `ffmpeg` and `wl-clipboard` via pacman if they're One line — pulls in `yt-dlp`, `ffmpeg` and `wl-clipboard` via pacman if they're
missing, installs the binary to `~/.local/bin`, and (on Omarchy) adds a floating missing, installs the binary to `~/.local/bin`, and (on Omarchy) adds a Walker
Walker entry: entry plus the Hyprland rule that makes omagrab float small and centered:
```bash ```bash
curl -fsSL https://raw.githubusercontent.com/28allday/omagrab/main/install.sh | bash curl -fsSL https://raw.githubusercontent.com/28allday/omagrab/main/install.sh | bash
@ -70,8 +59,8 @@ cd omagrab
./install.sh ./install.sh
``` ```
Make sure `~/.local/bin` is on your `PATH`. The installer prints the optional Make sure `~/.local/bin` is on your `PATH`. On Omarchy it also wires up the
`SUPER+SHIFT+V` clipboard keybind for you to add. `SUPER+SHIFT+V` clipboard keybind (see below).
## Usage ## Usage
@ -98,27 +87,21 @@ In the config view: `↑↓` move, `←→` change a value, `Esc` saves and retu
> Single-letter commands (`c`, `d`, `q`) only act when the URL box is empty — so > Single-letter commands (`c`, `d`, `q`) only act when the URL box is empty — so
> they never get swallowed while you're typing or pasting a link. > they never get swallowed while you're typing or pasting a link.
## Clipboard keybind (recommended) ## Clipboard keybind
The smoothest flow on Omarchy: copy a link in your browser, then summon omagrab as The smoothest flow on Omarchy: **copy a link → `SUPER+SHIFT+V` → omagrab floats
a floating window with the URL already filled in. with the URL ready → `Tab` to pick mode → `Enter`.**
Add to `~/.config/hypr/bindings.conf`: The installer sets this up for you — it adds the `SUPER+SHIFT+V` keybind to
`~/.config/hypr/bindings.conf` and the floating window rule to
`~/.config/hypr/windows.conf`, then reloads Hyprland. Both are written between
clearly marked `omagrab` blocks (backed up first, never duplicated on re-run), so
they're easy to find, tweak or remove.
```ini > If `SUPER+SHIFT+V` is already bound to something else, the installer leaves your
bindd = SUPER SHIFT, V, omagrab, exec, xdg-terminal-exec --app-id=omagrab -e omagrab --clip > shortcut alone and prints the line for you to add under a different key. Both the
``` > Walker entry and the keybind use the `omagrab` app-id, so the one window rule
> covers every launch path — edit its `size` line in `windows.conf` to resize.
And a floating rule in `~/.config/hypr/windows.conf` (Hyprland ≥ 0.55 syntax):
```ini
windowrule = float on, match:class ^(omagrab)$
windowrule = center on, match:class ^(omagrab)$
windowrule = size 520 260, match:class ^(omagrab)$
```
Reload Hyprland (`hyprctl reload`). Now: **copy a link → `SUPER+SHIFT+V`
omagrab floats with the URL ready → `Tab` to pick mode → `Enter`.**
## Configuration ## Configuration

BIN
docs/screenshot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

View file

@ -107,9 +107,10 @@ install -Dm755 "$TMPBIN" "$BIN"
bold "Installed: $BIN" bold "Installed: $BIN"
# ---- Omarchy desktop integration ----------------------------------------- # ---- Omarchy desktop integration -----------------------------------------
# Only on Omarchy: add a Walker entry that opens omagrab in a floating window. # Only on Omarchy: add a Walker entry that opens omagrab, and a Hyprland window
# The TUI.float app-id is matched by Omarchy's stock floating-window rule, so # rule so it floats small and centered. Both the Walker entry and the optional
# no Hyprland configuration is required (same approach as tsplay / omarchy-send). # clipboard keybind use the dedicated "omagrab" app-id, so this one rule covers
# every launch path.
if command -v omarchy-launch-tui >/dev/null 2>&1 || [ -d "$HOME/.local/share/omarchy" ]; then if command -v omarchy-launch-tui >/dev/null 2>&1 || [ -d "$HOME/.local/share/omarchy" ]; then
mkdir -p "$APP_DIR" mkdir -p "$APP_DIR"
@ -131,7 +132,7 @@ SVG
[Desktop Entry] [Desktop Entry]
Name=omagrab Name=omagrab
Comment=yt-dlp TUI — paste a URL, pick Audio or Video, download Comment=yt-dlp TUI — paste a URL, pick Audio or Video, download
Exec=xdg-terminal-exec --app-id=TUI.float -e $BIN Exec=xdg-terminal-exec --app-id=omagrab -e $BIN
Icon=omagrab Icon=omagrab
Terminal=false Terminal=false
Type=Application Type=Application
@ -141,21 +142,53 @@ EOF
bold "Omarchy detected — added floating Walker entry (with icon)." bold "Omarchy detected — added floating Walker entry (with icon)."
echo " Launch it from Walker by searching 'omagrab'." echo " Launch it from Walker by searching 'omagrab'."
cat <<EOF # Write a small floating window rule, idempotently, between markers we own so
# re-running the installer never duplicates it. Back the file up first.
windows_conf="$HOME/.config/hypr/windows.conf"
begin="# >>> omagrab windowrules begin"
end="# <<< omagrab windowrules end"
if [ -f "$windows_conf" ] && grep -qF "$begin" "$windows_conf"; then
echo " Hyprland float rule already present — left as-is."
else
mkdir -p "$(dirname "$windows_conf")"
[ -f "$windows_conf" ] && cp "$windows_conf" "$windows_conf.omagrab-bak"
{
printf '\n%s\n' "$begin"
printf '# omagrab — small floating window, centered.\n'
printf 'windowrule = float on, match:class ^(omagrab)$\n'
printf 'windowrule = center on, match:class ^(omagrab)$\n'
printf 'windowrule = size 520 260, match:class ^(omagrab)$\n'
printf '%s\n' "$end"
} >> "$windows_conf"
echo " Added floating window rule to ~/.config/hypr/windows.conf (520x260, centered)."
command -v hyprctl >/dev/null 2>&1 && hyprctl reload >/dev/null 2>&1 || true
fi
Optional: bind clipboard-launch to a key. Copy a link, hit the key, and omagrab # Add the clipboard keybind (SUPER+SHIFT+V), idempotently and backed up. Skip
opens with the URL pre-filled. Add to ~/.config/hypr/bindings.conf: # if that combo is already bound to something that isn't us, so we never stomp
# a user's existing shortcut.
bindd = SUPER SHIFT, V, omagrab, exec, xdg-terminal-exec --app-id=omagrab -e omagrab --clip bindings_conf="$HOME/.config/hypr/bindings.conf"
kb_begin="# >>> omagrab keybind begin"
and a floating rule to ~/.config/hypr/windows.conf (Hyprland >= 0.55): kb_end="# <<< omagrab keybind end"
keybind_line="bindd = SUPER SHIFT, V, omagrab, exec, xdg-terminal-exec --app-id=omagrab -e omagrab --clip"
windowrule = float on, match:class ^(omagrab)\$ if [ -f "$bindings_conf" ] && grep -qF "$kb_begin" "$bindings_conf"; then
windowrule = center on, match:class ^(omagrab)\$ echo " Clipboard keybind already present — left as-is."
windowrule = size 520 260, match:class ^(omagrab)\$ elif [ -f "$bindings_conf" ] && grep -Eq '^[[:space:]]*bind[a-z]*[[:space:]]*=[[:space:]]*SUPER[[:space:]]+SHIFT[[:space:]]*,[[:space:]]*V[[:space:]]*,' "$bindings_conf"; then
warn " SUPER+SHIFT+V is already bound to something else — skipping the keybind."
then run 'hyprctl reload'. echo " To use it anyway, add this line to ~/.config/hypr/bindings.conf yourself:"
EOF echo " $keybind_line"
else
mkdir -p "$(dirname "$bindings_conf")"
[ -f "$bindings_conf" ] && cp "$bindings_conf" "$bindings_conf.omagrab-bak"
{
printf '\n%s\n' "$kb_begin"
printf '# Copy a link, press SUPER+SHIFT+V — omagrab opens with the URL pre-filled.\n'
printf '%s\n' "$keybind_line"
printf '%s\n' "$kb_end"
} >> "$bindings_conf"
echo " Added clipboard keybind: SUPER+SHIFT+V opens omagrab with the copied URL."
command -v hyprctl >/dev/null 2>&1 && hyprctl reload >/dev/null 2>&1 || true
fi
fi fi
case ":$PATH:" in case ":$PATH:" in