summaryrefslogtreecommitdiff
path: root/.local/bin/aliasgen
diff options
context:
space:
mode:
authorBenjamin Chausse <benjamin@chausse.xyz>2024-01-20 14:12:01 -0500
committerBenjamin Chausse <benjamin@chausse.xyz>2024-01-20 14:12:01 -0500
commit61e7324e6692b155b6dd1d450ff431582c1fc57b (patch)
tree9074dd62a0470df97968bad984599bf5854e77c1 /.local/bin/aliasgen
parent52d1cae0fb84a9a8d3f6f1c779570110c7251a6e (diff)
Aliasrc has similar format to shortcutrc
Diffstat (limited to '.local/bin/aliasgen')
-rwxr-xr-x.local/bin/aliasgen10
1 files changed, 2 insertions, 8 deletions
diff --git a/.local/bin/aliasgen b/.local/bin/aliasgen
index 6d9e8cdc..00fbc68 100755
--- a/.local/bin/aliasgen
+++ b/.local/bin/aliasgen
@@ -1,13 +1,7 @@
#!/bin/sh
# Removing unecessary comments and documentation
-raw=$(cat $HOME/.config/aliasrc | tail -n +17 "$HOME/.config/aliasrc" | sed "s/^|\s*//g;
- s/\(.*\)|\(.*\)|\(.*\)|/\1|\2|\3/g;
- s/\s*$//g;
- /^$/d")
+raw="$(sed 's/^\s*//;s/#.*$//;s/,\s*/,/g;/^$/d' <"$XDG_CONFIG_HOME/aliasrc")"
# #---zsh---# #
-echo "$raw" | sed "s/^/alias\ /;
- s/\s*|\s*/=\"/;
- s/^.*-*+-*=\"$//;
- s/\s*|$/\"/" > $HOME/.cache/zsh-aliases
+echo "$raw" | sed 's/\(.*\),\(.*\)/alias \1="\2"/' >$HOME/.cache/zsh-aliases