about summary refs log tree commit diff stats
path: root/modules/by-name/lf
diff options
context:
space:
mode:
Diffstat (limited to 'modules/by-name/lf')
-rw-r--r--modules/by-name/lf/lf/commands/default.nix5
-rwxr-xr-xmodules/by-name/lf/lf/commands/scripts/open.sh15
-rw-r--r--modules/by-name/lf/lf/ctpv/helpers.sh2
-rw-r--r--modules/by-name/lf/lf/ctpv/prev/any.sh4
-rw-r--r--modules/by-name/lf/lf/ctpv/prev/application/dll/dll.sh4
-rw-r--r--modules/by-name/lf/lf/ctpv/prev/application/epub/epub.sh4
-rw-r--r--modules/by-name/lf/lf/module.nix2
7 files changed, 8 insertions, 28 deletions
diff --git a/modules/by-name/lf/lf/commands/default.nix b/modules/by-name/lf/lf/commands/default.nix
index 0c42607b..90b333c6 100644
--- a/modules/by-name/lf/lf/commands/default.nix
+++ b/modules/by-name/lf/lf/commands/default.nix
@@ -124,11 +124,6 @@ in {
     dependencies = [pkgs.gnused];
   };
 
-  open = async {
-    name = "open";
-    dependencies = [pkgs.handlr-regex];
-  };
-
   trash = pipe {
     name = "trash";
     dependencies = [pkgs.trash-cli];
diff --git a/modules/by-name/lf/lf/commands/scripts/open.sh b/modules/by-name/lf/lf/commands/scripts/open.sh
deleted file mode 100755
index b494074f..00000000
--- a/modules/by-name/lf/lf/commands/scripts/open.sh
+++ /dev/null
@@ -1,15 +0,0 @@
-# shellcheck shell=sh
-
-# shellcheck disable=SC2269
-f="$f"
-# shellcheck disable=SC2269
-fx="$fx"
-# shellcheck disable=SC2269
-fs="$fs"
-# shellcheck disable=SC2269
-id="$id"
-
-# TODO: For some reason, `xdg-utils` tries to open firefox with it's default profile for
-# _everything_. Using `handlr-regex` sort-of solves this. <2025-04-04>
-handlr open "$f"
-# vim: ft=sh
diff --git a/modules/by-name/lf/lf/ctpv/helpers.sh b/modules/by-name/lf/lf/ctpv/helpers.sh
index 6dc7fee6..30e4483a 100644
--- a/modules/by-name/lf/lf/ctpv/helpers.sh
+++ b/modules/by-name/lf/lf/ctpv/helpers.sh
@@ -59,7 +59,7 @@ preview_xxd() {
     # This has been derived mathematically.
     octet_columns=$(((2 * w - 22) / 7))
 
-    if [ -n "$CTPV_LESS_PREVIEWER" ]; then
+    if [ "${CTPV_LESS_PREVIEWER:-unset}" != "-unset" ]; then
         __base_xxd_preview "$1"
     else
         __base_xxd_preview "$1" -len "$((h * octet_columns))"
diff --git a/modules/by-name/lf/lf/ctpv/prev/any.sh b/modules/by-name/lf/lf/ctpv/prev/any.sh
index 0b0ee573..7ce72dcd 100644
--- a/modules/by-name/lf/lf/ctpv/prev/any.sh
+++ b/modules/by-name/lf/lf/ctpv/prev/any.sh
@@ -5,9 +5,9 @@ f="$f"
 # shellcheck disable=SC2269
 w="$w"
 # shellcheck disable=SC2269
-e="$e"
+e="${e:-[missing extension]}"
 # shellcheck disable=SC2269
-m="$m"
+m="${m:-[missing mime type]}"
 # shellcheck disable=SC2269
 h="$h"
 
diff --git a/modules/by-name/lf/lf/ctpv/prev/application/dll/dll.sh b/modules/by-name/lf/lf/ctpv/prev/application/dll/dll.sh
index e365fe0a..5237ecec 100644
--- a/modules/by-name/lf/lf/ctpv/prev/application/dll/dll.sh
+++ b/modules/by-name/lf/lf/ctpv/prev/application/dll/dll.sh
@@ -5,9 +5,9 @@ f="$f"
 # shellcheck disable=SC2269
 w="$w"
 # shellcheck disable=SC2269
-e="$e"
+e="${e:-[missing extension]}"
 # shellcheck disable=SC2269
-m="$m"
+m="${m:-[missing mime type]}"
 # shellcheck disable=SC2269
 h="$h"
 
diff --git a/modules/by-name/lf/lf/ctpv/prev/application/epub/epub.sh b/modules/by-name/lf/lf/ctpv/prev/application/epub/epub.sh
index cad95860..3bec0dd1 100644
--- a/modules/by-name/lf/lf/ctpv/prev/application/epub/epub.sh
+++ b/modules/by-name/lf/lf/ctpv/prev/application/epub/epub.sh
@@ -5,9 +5,9 @@ f="$f"
 # shellcheck disable=SC2269
 w="$w"
 # shellcheck disable=SC2269
-e="$e"
+e="${e:-[missing extension]}"
 # shellcheck disable=SC2269
-m="$m"
+m="${m:-[missing mime type]}"
 # shellcheck disable=SC2269
 h="$h"
 # shellcheck disable=SC2269
diff --git a/modules/by-name/lf/lf/module.nix b/modules/by-name/lf/lf/module.nix
index 6dc8e919..ae1534d0 100644
--- a/modules/by-name/lf/lf/module.nix
+++ b/modules/by-name/lf/lf/module.nix
@@ -75,7 +75,7 @@ in {
           icons = true;
           ifs = "\\n"; # internal field separator for shell commands
           #info = "size"; # show the size of a directory
-          shell = "sh";
+          shell = "${lib.getExe pkgs.dash}";
           shellopts = "-eu"; # e: exit on error; u: error for unset variables
         };
         extraConfig = ''