From d310686e633a03282be4e4b95a7dffa4b53a6277 Mon Sep 17 00:00:00 2001 From: xeruf <27jf@pm.me> Date: Mon, 20 Sep 2021 08:56:42 +0200 Subject: [PATCH] confi/yadm/bootstrap: config symlinks --- .config/yadm/bootstrap | 4 +++- .local/bin/scripts/edconf | 8 +++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.config/yadm/bootstrap b/.config/yadm/bootstrap index f1e3ba5..a01d1ef 100755 --- a/.config/yadm/bootstrap +++ b/.config/yadm/bootstrap @@ -54,7 +54,9 @@ fi ## Software section "Software" -ln -s "$HOME/.local/share/applications/signal-tray.desktop" "$XDG_CONFIG_HOME/autostart/" +ln -sv "$XDG_STATE_HOME/gradle/gradle.properties" "$XDG_CONFIG_HOME/gradle.properties" +ln -sv "$HOME/.ssh/config" "$XDG_CONFIG_HOME/ssh" +ln -sv "$XDG_DATA_HOME/applications/signal-tray.desktop" "$XDG_CONFIG_HOME/autostart/" highlight "Configure pacman" if test -f /etc/pacman.conf; then diff --git a/.local/bin/scripts/edconf b/.local/bin/scripts/edconf index 229d18b..1bb566a 100755 --- a/.local/bin/scripts/edconf +++ b/.local/bin/scripts/edconf @@ -1,17 +1,19 @@ #!/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"; + { cat "$conf_cache"; fd --hidden --type file --size -1m --max-depth 1 . ~; - find "${XDG_CONFIG_HOME:-$HOME/.config}" /etc -maxdepth 3 -type f -readable -exec grep -lI '' {} + 2>/dev/null; } | dedup + find "${XDG_CONFIG_HOME:-$HOME/.config}" /etc -maxdepth 3 -follow -type f -readable -exec grep -lI '' {} + 2>/dev/null; } | dedup } + conf_cache_dir="${XDG_CACHE_HOME:-$HOME/.cache}/edconf" conf_cache="$conf_cache_dir/files" conf_tmp="${conf_cache}.tmp" -conf_extra="${XDG_CONFIG_HOME:-$HOME/.config}/edconf-extra" mkdir -p "$conf_cache_dir" touch "$conf_cache" + sel=$(listconf | fzf -1 -0 --tiebreak=end,length --preview '$(test -r "{}" || echo "sudo") bat --color=always --style=numbers --line-range :200 {}' --query="$1" --history "$conf_cache_dir/searches") case "$sel" in "") exit 1;;