diff options
| author | 2026-04-21 01:23:18 +0100 | |
|---|---|---|
| committer | 2026-04-21 01:23:18 +0100 | |
| commit | d00bf2cb2d5087164fa509a4f20a2be62a519044 (patch) | |
| tree | e788986ca341fa7a9d7327b48c58d2e0c0c43115 /dot_local/bin/executable_tokodi | |
| parent | 9b2af4dd6c73ea57cc921f41120db7a2700e806d (diff) | |
| download | dotfiles-d00bf2cb2d5087164fa509a4f20a2be62a519044.tar.gz dotfiles-d00bf2cb2d5087164fa509a4f20a2be62a519044.tar.bz2 dotfiles-d00bf2cb2d5087164fa509a4f20a2be62a519044.zip | |
refactor: restructure to chezmoi source state
Rename home/ contents to chezmoi naming conventions:
- dot_ prefix for dotfiles and dot-dirs
- private_dot_ for .gnupg and .ssh directories
- private_ for 0600 files (nym.pub)
- executable_ for scripts in .local/bin and display-toggle.sh
- symlink_ for mimeapps.list symlink
Diffstat (limited to 'dot_local/bin/executable_tokodi')
| -rwxr-xr-x | dot_local/bin/executable_tokodi | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/dot_local/bin/executable_tokodi b/dot_local/bin/executable_tokodi new file mode 100755 index 0000000..ce945de --- /dev/null +++ b/dot_local/bin/executable_tokodi @@ -0,0 +1,22 @@ +#!/usr/bin/env sh + +if [ -z "$1" ]; then + url=$(wl-paste) +elif [ "$1" = "-" ]; then + read -r url +else + url="$1" +fi + +case "$url" in +*.m3u8*) + prefix='' + ;; +*) + prefix='plugin://plugin.video.sendtokodi/?' + ;; +esac + +payload="$(printf '{"jsonrpc":"2.0", "id": 1, "method":"Player.Open","params": {"item": {"file":"%s%s"}}}' "$prefix" "$url")" + +curl -u kodi:kodi 'http://ruiflix.pulpo:8080/jsonrpc' -X POST --data-raw "$payload" -H 'Content-Type: application/json' |
