Compare commits
No commits in common. "main" and "v0.1.0" have entirely different histories.
3 changed files with 54 additions and 70 deletions
55
README.md
55
README.md
|
|
@ -9,9 +9,20 @@ 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">
|
```
|
||||||
<img src="docs/screenshot.png" alt="omagrab TUI" width="700">
|
omagrab
|
||||||
</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
|
||||||
|
|
||||||
|
|
@ -43,8 +54,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 Walker
|
missing, installs the binary to `~/.local/bin`, and (on Omarchy) adds a floating
|
||||||
entry plus the Hyprland rule that makes omagrab float small and centered:
|
Walker entry:
|
||||||
|
|
||||||
```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
|
||||||
|
|
@ -59,8 +70,8 @@ cd omagrab
|
||||||
./install.sh
|
./install.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
Make sure `~/.local/bin` is on your `PATH`. On Omarchy it also wires up the
|
Make sure `~/.local/bin` is on your `PATH`. The installer prints the optional
|
||||||
`SUPER+SHIFT+V` clipboard keybind (see below).
|
`SUPER+SHIFT+V` clipboard keybind for you to add.
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
|
|
@ -87,21 +98,27 @@ 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
|
## Clipboard keybind (recommended)
|
||||||
|
|
||||||
The smoothest flow on Omarchy: **copy a link → `SUPER+SHIFT+V` → omagrab floats
|
The smoothest flow on Omarchy: copy a link in your browser, then summon omagrab as
|
||||||
with the URL ready → `Tab` to pick mode → `Enter`.**
|
a floating window with the URL already filled in.
|
||||||
|
|
||||||
The installer sets this up for you — it adds the `SUPER+SHIFT+V` keybind to
|
Add to `~/.config/hypr/bindings.conf`:
|
||||||
`~/.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.
|
|
||||||
|
|
||||||
> If `SUPER+SHIFT+V` is already bound to something else, the installer leaves your
|
```ini
|
||||||
> shortcut alone and prints the line for you to add under a different key. Both the
|
bindd = SUPER SHIFT, V, omagrab, exec, xdg-terminal-exec --app-id=omagrab -e omagrab --clip
|
||||||
> 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
|
||||||
|
|
||||||
|
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 80 KiB |
69
install.sh
69
install.sh
|
|
@ -107,10 +107,9 @@ 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, and a Hyprland window
|
# Only on Omarchy: add a Walker entry that opens omagrab in a floating window.
|
||||||
# rule so it floats small and centered. Both the Walker entry and the optional
|
# The TUI.float app-id is matched by Omarchy's stock floating-window rule, so
|
||||||
# clipboard keybind use the dedicated "omagrab" app-id, so this one rule covers
|
# no Hyprland configuration is required (same approach as tsplay / omarchy-send).
|
||||||
# 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"
|
||||||
|
|
||||||
|
|
@ -132,7 +131,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=omagrab -e $BIN
|
Exec=xdg-terminal-exec --app-id=TUI.float -e $BIN
|
||||||
Icon=omagrab
|
Icon=omagrab
|
||||||
Terminal=false
|
Terminal=false
|
||||||
Type=Application
|
Type=Application
|
||||||
|
|
@ -142,53 +141,21 @@ 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'."
|
||||||
|
|
||||||
# Write a small floating window rule, idempotently, between markers we own so
|
cat <<EOF
|
||||||
# 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
|
|
||||||
|
|
||||||
# Add the clipboard keybind (SUPER+SHIFT+V), idempotently and backed up. Skip
|
Optional: bind clipboard-launch to a key. Copy a link, hit the key, and omagrab
|
||||||
# if that combo is already bound to something that isn't us, so we never stomp
|
opens with the URL pre-filled. Add to ~/.config/hypr/bindings.conf:
|
||||||
# a user's existing shortcut.
|
|
||||||
bindings_conf="$HOME/.config/hypr/bindings.conf"
|
bindd = SUPER SHIFT, V, omagrab, exec, xdg-terminal-exec --app-id=omagrab -e omagrab --clip
|
||||||
kb_begin="# >>> omagrab keybind begin"
|
|
||||||
kb_end="# <<< omagrab keybind end"
|
and a floating rule to ~/.config/hypr/windows.conf (Hyprland >= 0.55):
|
||||||
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
|
windowrule = float on, match:class ^(omagrab)\$
|
||||||
echo " Clipboard keybind already present — left as-is."
|
windowrule = center on, 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
|
windowrule = size 520 260, match:class ^(omagrab)\$
|
||||||
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:"
|
then run 'hyprctl reload'.
|
||||||
echo " $keybind_line"
|
EOF
|
||||||
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
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue