diff options
author | Benjamin Chausse <benjamin@chausse.xyz> | 2024-01-27 14:01:01 -0500 |
---|---|---|
committer | Benjamin Chausse <benjamin@chausse.xyz> | 2024-01-27 14:01:01 -0500 |
commit | fbcc3dce4caa6196b4b727e815e07b9941ce1709 (patch) | |
tree | e7b956ec9f94b9dc2aa1e051b7d7b321d5305cf5 /.local/bin | |
parent | 102e63624349580ce2f15d35d18628b79807aa1d (diff) |
shortcutgen writes separate files for profile and zshrc
Diffstat (limited to '.local/bin')
-rwxr-xr-x | .local/bin/shortcutgen | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/.local/bin/shortcutgen b/.local/bin/shortcutgen index 08164f0..ce29ffb 100755 --- a/.local/bin/shortcutgen +++ b/.local/bin/shortcutgen @@ -6,10 +6,15 @@ # - remove spacing (keep commas between columns) # - remove trailing whitespace +# Strip comments, remove empty lines, condense spacing, remove trailing whitespace raw="$(sed 's/#.*//g;s/,\s*/,/g;/^$/d;s/\s*$//g' <"$XDG_CONFIG_HOME/shortcutrc")" -# lf +# lf (sourced by lfrc) echo "$raw" | sed 's/\(.*\),\(.*\),\(.*\)/map g\2 cd \3/' >"$XDG_CONFIG_HOME/lf/shortcuts" -# shell (aliases and environment variables) -echo "$raw" | sed 's/\(.*\),\(.*\),\(.*\)/alias g\2="cd \3"\nexport G\U\2="\3"/' >"$HOME/.cache/zsh-shortcuts" +# Shell aliases (read by zshrc) +echo "$raw" | sed 's/\(.*\),\(.*\),\(.*\)/alias g\2="cd \3"/' >"$HOME/.cache/zsh-shortcuts" + +# Environment variables (read by .profile) +echo "$raw" | sed 's/\(.*\),\(.*\),\(.*\)/export G\U\2="\3"/' >"$HOME/.cache/env-shortcuts" + |