From d7c8b912e63c9a112d75f6b9e2e3f5d3c6975240 Mon Sep 17 00:00:00 2001 From: Maksymilian Jopek Date: Sat, 15 Mar 2025 14:46:54 +0100 Subject: Eibhear: Initial commit Some file deletion, small changes, some addition --- .local/bin/shortcuts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to '.local/bin/shortcuts') diff --git a/.local/bin/shortcuts b/.local/bin/shortcuts index 08a2f57..3311349 100755 --- a/.local/bin/shortcuts +++ b/.local/bin/shortcuts @@ -1,7 +1,9 @@ #!/bin/sh bmdirs="${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-dirs" +bmdirs_eibhear="${XDG_CONFIG_HOME:-$HOME/.config}/shell/eibhear/bm-dirs" bmfiles="${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-files" +bmfiles_eibhear="${XDG_CONFIG_HOME:-$HOME/.config}/shell/eibhear/bm-files" # Output locations. Unactivated progs should go to /dev/null. shell_shortcuts="${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutrc" @@ -20,8 +22,14 @@ printf "# vim: filetype=sh\\nalias " > "$shell_shortcuts" printf "# vim: filetype=sh\\n" > "$shell_env_shortcuts" printf "\" vim: filetype=vim\\n" > "$vifm_shortcuts" +# Enable nesting +eval "echo \"$(cat "$bmdirs" "$bmdirs_eibhear"")\"" | \ +awk "!/^\s*#/ && !/^\s*\$/ {gsub(\"\\\s*#.*$\",\"\"); + printf(\"[ -n \42%s\42 ] && export %s=\42%s\42 \n\",\$1,\$1,\$2) >> \"$shell_env_shortcuts\" ;" +source "$shell_env_shortcuts" + # Format the `directories` file in the correct syntax and sent it to all three configs. -eval "echo \"$(cat "$bmdirs")\"" | \ +eval "echo \"$(cat "$bmdirs" "$bmdirs_eibhear")\"" | \ awk "!/^\s*#/ && !/^\s*\$/ {gsub(\"\\\s*#.*$\",\"\"); printf(\"%s=\42cd %s && ls -A\42 \\\\\n\",\$1,\$2) >> \"$shell_shortcuts\" ; printf(\"[ -n \42%s\42 ] && export %s=\42%s\42 \n\",\$1,\$1,\$2) >> \"$shell_env_shortcuts\" ; @@ -33,7 +41,7 @@ awk "!/^\s*#/ && !/^\s*\$/ {gsub(\"\\\s*#.*$\",\"\"); printf(\"cmap ;%s %s\n\",\$1,\$2) >> \"$vim_shortcuts\" }" # Format the `files` file in the correct syntax and sent it to both configs. -eval "echo \"$(cat "$bmfiles")\"" | \ +eval "echo \"$(cat "$bmfiles" "$bmfiles_eibhear")\"" | \ awk "!/^\s*#/ && !/^\s*\$/ {gsub(\"\\\s*#.*$\",\"\"); printf(\"%s=\42\$EDITOR %s\42 \\\\\n\",\$1,\$2) >> \"$shell_shortcuts\" ; printf(\"[ -n \42%s\42 ] && export %s=\42%s\42 \n\",\$1,\$1,\$2) >> \"$shell_env_shortcuts\" ; -- cgit v1.3.1