Compare commits
3 commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b3b6605af9 | |||
| 4ce4856134 | |||
| 522eef4b9e |
3 changed files with 70 additions and 54 deletions
55
README.md
55
README.md
|
|
@ -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 /
|
||||
> non-Omarchy fallbacks.
|
||||
|
||||
```
|
||||
omagrab
|
||||
|
||||
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
|
||||
```
|
||||
<p align="center">
|
||||
<img src="docs/screenshot.png" alt="omagrab TUI" width="700">
|
||||
</p>
|
||||
|
||||
## Features
|
||||
|
||||
|
|
@ -54,8 +43,8 @@ sudo pacman -S yt-dlp ffmpeg wl-clipboard
|
|||
## Install
|
||||
|
||||
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
|
||||
Walker entry:
|
||||
missing, installs the binary to `~/.local/bin`, and (on Omarchy) adds a Walker
|
||||
entry plus the Hyprland rule that makes omagrab float small and centered:
|
||||
|
||||
```bash
|
||||
curl -fsSL https://raw.githubusercontent.com/28allday/omagrab/main/install.sh | bash
|
||||
|
|
@ -70,8 +59,8 @@ cd omagrab
|
|||
./install.sh
|
||||
```
|
||||
|
||||
Make sure `~/.local/bin` is on your `PATH`. The installer prints the optional
|
||||
`SUPER+SHIFT+V` clipboard keybind for you to add.
|
||||
Make sure `~/.local/bin` is on your `PATH`. On Omarchy it also wires up the
|
||||
`SUPER+SHIFT+V` clipboard keybind (see below).
|
||||
|
||||
## 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
|
||||
> 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
|
||||
a floating window with the URL already filled in.
|
||||
The smoothest flow on Omarchy: **copy a link → `SUPER+SHIFT+V` → omagrab floats
|
||||
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
|
||||
bindd = SUPER SHIFT, V, omagrab, exec, xdg-terminal-exec --app-id=omagrab -e omagrab --clip
|
||||
```
|
||||
|
||||
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`.**
|
||||
> If `SUPER+SHIFT+V` is already bound to something else, the installer leaves your
|
||||
> 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.
|
||||
|
||||
## Configuration
|
||||
|
||||
|
|
|
|||
BIN
docs/screenshot.png
Normal file
BIN
docs/screenshot.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 80 KiB |
69
install.sh
69
install.sh
|
|
@ -107,9 +107,10 @@ install -Dm755 "$TMPBIN" "$BIN"
|
|||
bold "Installed: $BIN"
|
||||
|
||||
# ---- Omarchy desktop integration -----------------------------------------
|
||||
# Only on Omarchy: add a Walker entry that opens omagrab in a floating window.
|
||||
# The TUI.float app-id is matched by Omarchy's stock floating-window rule, so
|
||||
# no Hyprland configuration is required (same approach as tsplay / omarchy-send).
|
||||
# Only on Omarchy: add a Walker entry that opens omagrab, and a Hyprland window
|
||||
# rule so it floats small and centered. Both the Walker entry and the optional
|
||||
# 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
|
||||
mkdir -p "$APP_DIR"
|
||||
|
||||
|
|
@ -131,7 +132,7 @@ SVG
|
|||
[Desktop Entry]
|
||||
Name=omagrab
|
||||
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
|
||||
Terminal=false
|
||||
Type=Application
|
||||
|
|
@ -141,21 +142,53 @@ EOF
|
|||
bold "Omarchy detected — added floating Walker entry (with icon)."
|
||||
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
|
||||
opens with the URL pre-filled. Add to ~/.config/hypr/bindings.conf:
|
||||
|
||||
bindd = SUPER SHIFT, V, omagrab, exec, xdg-terminal-exec --app-id=omagrab -e omagrab --clip
|
||||
|
||||
and a floating rule to ~/.config/hypr/windows.conf (Hyprland >= 0.55):
|
||||
|
||||
windowrule = float on, match:class ^(omagrab)\$
|
||||
windowrule = center on, match:class ^(omagrab)\$
|
||||
windowrule = size 520 260, match:class ^(omagrab)\$
|
||||
|
||||
then run 'hyprctl reload'.
|
||||
EOF
|
||||
# Add the clipboard keybind (SUPER+SHIFT+V), idempotently and backed up. Skip
|
||||
# if that combo is already bound to something that isn't us, so we never stomp
|
||||
# a user's existing shortcut.
|
||||
bindings_conf="$HOME/.config/hypr/bindings.conf"
|
||||
kb_begin="# >>> omagrab keybind begin"
|
||||
kb_end="# <<< omagrab keybind end"
|
||||
keybind_line="bindd = SUPER SHIFT, V, omagrab, exec, xdg-terminal-exec --app-id=omagrab -e omagrab --clip"
|
||||
if [ -f "$bindings_conf" ] && grep -qF "$kb_begin" "$bindings_conf"; then
|
||||
echo " Clipboard keybind already present — left as-is."
|
||||
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."
|
||||
echo " To use it anyway, add this line to ~/.config/hypr/bindings.conf yourself:"
|
||||
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
|
||||
|
||||
case ":$PATH:" in
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue