External open submit
External open allows you to open a Kelvin submit directly in your IDE or terminal. To set it up, follow these steps:
-
Create schema handler for
kelvin::# ~/.local/share/applications/kelvin-open.desktop
[Desktop Entry]
Type=Application
Name=Kelvin schema handler
Exec=kelvin-open %u
StartupNotify=false
MimeType=x-scheme-handler/kelvin; -
Register schema with default app
xdg-mime default kelvin-open.desktop x-schema-handler/kelvin -
Generate your API token and store it in
~/.config/kelvin/token -
Create your
kelvin-openscript and add it to the$PATH#!/bin/bash
cd $(mktemp -d)
# download submit
url=$(echo $1 | sed 's/kelvin://')
curl -H"Authorization: Bearer $(<~/.config/kelvin/token)" $url | tar xvz
# uncomment one exec line below:
#exec gnome-terminal
#exec code .
# start in ubuntu container
#exec gnome-terminal -- docker run --rm -v $PWD:/submit -w /submit -it ubuntu bash
# start in ubuntu container with X11 forwarding (xhost + or something like that required on your side)
#exec gnome-terminal -- docker run --rm -v $PWD:/submit -w /submit -v /tmp:/tmp -e DISPLAY=:0 -it ubuntu bash -
Make
kelvin-openexecutablechmod u+x kelvin-open -
Update desktop database
update-desktop-database ~/.local/share/applications/`