From 6ec4366b98bcc887d4b35567a7d32e910ae13d25 Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Sun, 6 Apr 2025 18:47:56 +0200 Subject: fix(modules/legacy/conf/xdg/url-handler): Always use dash in name The underscore is uncommon for CLI programs. --- modules/home.legacy/conf/xdg/default.nix | 22 +++++++++++----------- modules/home.legacy/conf/xdg/url-handler.sh | 18 ++++++++++++++++++ modules/home.legacy/conf/xdg/url_handler.sh | 18 ------------------ 3 files changed, 29 insertions(+), 29 deletions(-) create mode 100755 modules/home.legacy/conf/xdg/url-handler.sh delete mode 100755 modules/home.legacy/conf/xdg/url_handler.sh (limited to 'modules/home.legacy/conf') diff --git a/modules/home.legacy/conf/xdg/default.nix b/modules/home.legacy/conf/xdg/default.nix index 9751d806..ad0cd226 100644 --- a/modules/home.legacy/conf/xdg/default.nix +++ b/modules/home.legacy/conf/xdg/default.nix @@ -3,9 +3,9 @@ lib, ... }: let - url_handler = pkgs.writeShellApplication { + url-handler = pkgs.writeShellApplication { name = "url-handler"; - text = builtins.readFile ./url_handler.sh; + text = builtins.readFile ./url-handler.sh; inheritPath = false; runtimeInputs = [ pkgs.rofi @@ -23,22 +23,22 @@ in { mimeApps = { enable = true; defaultApplications = { - "application/pdf" = ["url_handler.desktop"]; - "application/x-pdf" = ["url_handler.desktop"]; + "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"]; - "x-scheme-handler/https" = ["url_handler.desktop"]; - "x-scheme-handler/about" = ["url_handler.desktop"]; - "x-scheme-handler/unknown" = ["url_handler.desktop"]; + "text/html" = ["url-handler.desktop"]; + "text/xml" = ["url-handler.desktop"]; + "x-scheme-handler/http" = ["url-handler.desktop"]; + "x-scheme-handler/https" = ["url-handler.desktop"]; + "x-scheme-handler/about" = ["url-handler.desktop"]; + "x-scheme-handler/unknown" = ["url-handler.desktop"]; }; }; desktopEntries = { url-handler = { name = "url-handler"; genericName = "Web Browser"; - exec = "${lib.getExe url_handler} %u"; + exec = "${lib.getExe url-handler} %u"; terminal = false; categories = [ "Application" diff --git a/modules/home.legacy/conf/xdg/url-handler.sh b/modules/home.legacy/conf/xdg/url-handler.sh new file mode 100755 index 00000000..f15df384 --- /dev/null +++ b/modules/home.legacy/conf/xdg/url-handler.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env sh + +project="$({ + tskm projects list + echo nvim zathura +} | rofi -sep "$(printf "\n")" -dmenu)" + +if [ "$project" = "nvim" ]; then + "$TERMINAL" -e nvim "$1" +elif [ "$project" = "zathura" ]; then + zathura "$1" +elif [ "$project" ]; then + firefox -P "$project" "$1" +else + notify-send "(URL HANDLER) No project selected" && exit 1 +fi + +# vim: ft=sh diff --git a/modules/home.legacy/conf/xdg/url_handler.sh b/modules/home.legacy/conf/xdg/url_handler.sh deleted file mode 100755 index f15df384..00000000 --- a/modules/home.legacy/conf/xdg/url_handler.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env sh - -project="$({ - tskm projects list - echo nvim zathura -} | rofi -sep "$(printf "\n")" -dmenu)" - -if [ "$project" = "nvim" ]; then - "$TERMINAL" -e nvim "$1" -elif [ "$project" = "zathura" ]; then - zathura "$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