mirror of
https://github.com/arthur-pbty/arthur-os.git
synced 2026-08-01 20:28:16 +02:00
Download the current page's video with yt-dlp via Alt+Shift+D or a click on the toolbar icon. A native-messaging host runs the download, shows live progress on the Quickshell OSD, and posts a clickable "Download complete" toast that opens the file in mpv. - Extension: pinned key for a stable id, green download-video icon, keyboard command + toolbar action (reads the active tab URL). - Native host (omarchy-chromium-ytdlp-host): verifies the URL with yt-dlp --simulate (else "No video found"), streams progress to the OSD (time-throttled to ~4/s), saves to ~/Videos, opens mpv on click. - Installer (omarchy-install-chromium-ytdlp) writes the native-messaging manifest into installed Chromium/Chrome/Brave/Edge profiles; wired into browser install and chromium refresh, with a migration for existing users. - omarchy-osd: add -d/--duration so the OSD can persist during a download. - Add yt-dlp to base packages, load the extension via --load-extension, and document the Alt+Shift+D binding. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
41 lines
1.0 KiB
Bash
Executable File
41 lines
1.0 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# omarchy:summary=Show the Omarchy Quickshell on-screen display
|
|
# omarchy:args=[-i|--icon <icon>] [-m|--message <text>] [-p|--progress <0-100>] [-d|--duration <ms>]
|
|
# omarchy:examples=omarchy osd -i brightness -p 50 | omarchy osd -m "Hello"
|
|
|
|
set -euo pipefail
|
|
|
|
icon=""
|
|
message=""
|
|
progress=""
|
|
progress_text=""
|
|
max="100"
|
|
duration=""
|
|
|
|
while (($#)); do
|
|
case $1 in
|
|
-i|--icon) icon="${2:-}"; shift 2 ;;
|
|
-m|--message) message="${2:-}"; shift 2 ;;
|
|
-p|--progress) progress="${2:-}"; shift 2 ;;
|
|
-d|--duration) duration="${2:-}"; shift 2 ;;
|
|
-h|--help) omarchy osd --help; exit 0 ;;
|
|
*) echo "Unknown OSD option: $1" >&2; exit 1 ;;
|
|
esac
|
|
done
|
|
|
|
if [[ -n $progress ]]; then
|
|
progress_text="${progress}%"
|
|
fi
|
|
|
|
payload=$(jq -cn \
|
|
--arg icon "$icon" \
|
|
--arg message "$message" \
|
|
--arg value "$progress" \
|
|
--arg progressText "$progress_text" \
|
|
--arg max "$max" \
|
|
--arg duration "$duration" \
|
|
'{icon:$icon,message:$message,value:$value,progressText:$progressText,max:$max,duration:$duration}')
|
|
|
|
omarchy-shell -q osd show "$payload"
|