nix/modules/wm/hyprland/scripts/mpv.sh

17 lines
298 B
Bash
Raw Normal View History

2024-08-31 16:04:57 +02:00
#!/bin/sh
link=$(wl-paste)
if [ -n "$link" ]; then
2024-10-09 16:45:33 +02:00
notify-send "Opening Link" "$link"
2024-10-09 13:02:52 +02:00
2024-10-09 16:45:33 +02:00
error_message=$(mpv "$link" 2>&1)
if [ $? -ne 0 ]; then
notify-send "Error" "Failed to open the link with mpv:\n$error_message"
fi
2024-08-31 16:04:57 +02:00
else
2024-10-09 16:45:33 +02:00
notify-send "Error" "No URL provided."
2024-08-31 16:04:57 +02:00
fi
2024-10-09 16:45:33 +02:00
i