From 09e73b1b1ffaf3f154d6e7e2305a57ad8f38b4cd Mon Sep 17 00:00:00 2001 From: xeruf <27jf@pm.me> Date: Sat, 18 Sep 2021 23:09:40 +0200 Subject: [PATCH] bin/edconf: make usable with sudo --- .local/bin/scripts/edconf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.local/bin/scripts/edconf b/.local/bin/scripts/edconf index 6bc0295..889814a 100755 --- a/.local/bin/scripts/edconf +++ b/.local/bin/scripts/edconf @@ -1,9 +1,10 @@ #!/bin/sh # Find and edit config files utilizing fzf +alias dedup='awk '"'"'!a[$0]++'"'" listconf() { { cat "$conf_cache"; test -f "$conf_extra" && cat "$conf_extra"; fd --hidden --type file --size -1m --max-depth 1 . ~; - find "$XDG_CONFIG_HOME" /etc -maxdepth 3 -type f -exec grep -lI '' {} +; } | dedup + find "$XDG_CONFIG_HOME" /etc -maxdepth 3 -type f -readable -exec grep -lI '' {} + 2>/dev/null; } | dedup } conf_cache_dir="$XDG_CACHE_HOME/edconf" conf_cache="$conf_cache_dir/files"