From bee13a9391785276a2790211521bad4e08de7e30 Mon Sep 17 00:00:00 2001 From: Schrottkatze Date: Tue, 17 Jun 2025 14:06:12 +0200 Subject: [PATCH] some optimzations in custom commands --- modules/shell/nu/custom_commands.nu | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/modules/shell/nu/custom_commands.nu b/modules/shell/nu/custom_commands.nu index fc22cba..1f13059 100644 --- a/modules/shell/nu/custom_commands.nu +++ b/modules/shell/nu/custom_commands.nu @@ -16,10 +16,9 @@ def nr [ def lcr [ file_extension: string ] { - ls **/* - | where name ends-with $".($file_extension)" + glob **/*.($file_extension) | par-each {|file| - open $file.name + open $file | lines --skip-empty | length } | math sum @@ -45,7 +44,7 @@ def typed [ } else if ($"($name).pdf" | path exists) { typst compile $"($name).typ" } - mprocs --names Editor,Viewer,Notify $"hx '($name).typ'" $"while true; do mupdf-x11 '($name).pdf' && break; done" $"while inotifywait -e modify '($name).pdf' ; do pkill -HUP mupdf; done" + mprocs --names Editor,Viewer,Notify $"hx '($name).typ'" $"while true; do mupdf-x11 '($name).pdf' && break; done" $"bash -c 'while inotifywait -e modify \'($name).pdf\' ; do pkill -HUP mupdf; done'" } # figure out when the next event is @@ -99,3 +98,8 @@ def "dp gay" [] { swaymsg "output DP-3 position 0 0 scale 1 transform normal resolution 1920x1080@60Hz" bars "LEN G27c-10" } + +def oobs [] { + set-env SHELL /run/current-system/sw/bin/bash + obs +}