From 7fc5e9ec677b817429480b061f093bff72b06352 Mon Sep 17 00:00:00 2001 From: Soispha Date: Fri, 29 Dec 2023 09:36:28 +0100 Subject: feat(hm/conf/xdg/url_handler): Also support opening in zathura --- hm/soispha/conf/xdg/default.nix | 4 ++++ hm/soispha/conf/xdg/url_handler | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'hm') diff --git a/hm/soispha/conf/xdg/default.nix b/hm/soispha/conf/xdg/default.nix index 3715cc87..2b244b88 100644 --- a/hm/soispha/conf/xdg/default.nix +++ b/hm/soispha/conf/xdg/default.nix @@ -11,6 +11,7 @@ dependencies = with pkgs; [ rofi libnotify + zathura ]; replacementStrings = { ALL_PROJECTS_PIPE = "${config.soispha.taskwarrior.projects.projects_pipe}"; @@ -21,6 +22,9 @@ in { mimeApps = { enable = true; defaultApplications = { + "application/pdf" = ["url_handler.desktop"]; + "application/x-pdf" = ["url_handler.desktop"]; + "text/html" = ["url_handler.desktop"]; "text/xml" = ["url_handler.desktop"]; "x-scheme-handler/http" = ["url_handler.desktop"]; diff --git a/hm/soispha/conf/xdg/url_handler b/hm/soispha/conf/xdg/url_handler index 10ce1d90..91fdd0d1 100755 --- a/hm/soispha/conf/xdg/url_handler +++ b/hm/soispha/conf/xdg/url_handler @@ -4,10 +4,12 @@ SHELL_LIBRARY_VERSION="1.10.0" . %SHELL_LIBRARY_PATH -project="$(echo "%ALL_PROJECTS_PIPE|nvim" | rofi -sep "|" -dmenu)"; +project="$(echo "%ALL_PROJECTS_PIPE|nvim|zathura" | rofi -sep "|" -dmenu)"; if [ "$project" = "nvim" ]; then "$TERMINAL" -e nvim "$1" +elif [ "$project" = "zathura" ]; then + zathura "$1" elif [ "$project" ]; then firefox -P "$project" "$1"; else -- cgit 1.4.1