From e77f8cac4f7b865058902866c24ceab84faf5668 Mon Sep 17 00:00:00 2001 From: Soispha Date: Fri, 29 Dec 2023 08:28:30 +0100 Subject: feat(hm/conf/xdg): Add a custom url_handler to support select the project --- hm/soispha/conf/xdg/url_handler | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 hm/soispha/conf/xdg/url_handler (limited to 'hm/soispha/conf/xdg/url_handler') diff --git a/hm/soispha/conf/xdg/url_handler b/hm/soispha/conf/xdg/url_handler new file mode 100755 index 00000000..10ce1d90 --- /dev/null +++ b/hm/soispha/conf/xdg/url_handler @@ -0,0 +1,18 @@ +#!/usr/bin/env dash + +# shellcheck source=/dev/null +SHELL_LIBRARY_VERSION="1.10.0" . %SHELL_LIBRARY_PATH + + +project="$(echo "%ALL_PROJECTS_PIPE|nvim" | rofi -sep "|" -dmenu)"; + +if [ "$project" = "nvim" ]; then + "$TERMINAL" -e nvim "$1" +elif [ "$project" ]; then + firefox -P "$project" "$1"; +else + notify-send "(URL HANDLER) No project selected" && exit 1 +fi + + +# vim: ft=sh -- cgit 1.4.1