aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config.csv23
-rwxr-xr-xinstall.sh60
-rw-r--r--sets.csv2
3 files changed, 52 insertions, 33 deletions
diff --git a/config.csv b/config.csv
new file mode 100644
index 0000000..ff606c1
--- /dev/null
+++ b/config.csv
@@ -0,0 +1,23 @@
+.bashrc;.
+termite;.config
+autoload.cfg;.local/share/Steam/steamapps/common/Counter-Strike Global Offensive/csgo/cfg/
+.vim;.
+deadd;.config
+nvim;.config
+.xinitrc;.
+i3;.config
+.bash_profile;.
+termux.properties;.termux
+rofi;.config
+alacritty;.config
+twmn;.config
+powerline;.config
+sxhkd;.config
+.radare2rc;.
+polybar;.config
+.Xresources;.
+bspwm;.config
+picom;.config
+.stack;.
+sway;.config
+gpg-agent.conf;.gnupg
diff --git a/install.sh b/install.sh
index 55086d1..b5a7b38 100755
--- a/install.sh
+++ b/install.sh
@@ -1,45 +1,39 @@
#!/bin/bash
-#['name']='install location relative to $HOME'
-declare -A CONFIGS
-CONFIGS=( ["sway"]=".config"
- ["alacritty"]=".config"
- ["polybar"]=".config"
- ["powerline"]=".config"
- ["nvim"]=".config"
- ["termite"]=".config"
- ["twmn"]=".config"
- ["picom"]=".config"
- ["i3"]=".config"
- ["termux.properties"]=".termux"
- ["bspwm"]=".config"
- ["sxhkd"]=".config"
- ["deadd"]=".config"
- ["rofi"]=".config"
- ["autoload.cfg"]=".local/share/Steam/steamapps/common/Counter-Strike Global Offensive/csgo/cfg/"
- [".vim"]="."
- [".xinitrc"]="."
- [".bashrc"]="."
- [".Xresources"]="."
- [".radare2rc"]="."
- [".bash_profile"]="."
- [".stack"]="."
- ["gpg-agent.conf"]=".gnupg"
- )
-
-declare -A SETS
-SETS=( ["base"]=".vim .bashrc .bash_profile"
- ["desktop"]="base termite picom i3 deadd polybar .xinitrc .Xresources"
- )
+function fail(){
+ EXCODE=$1
+ shift
+ echo "$@" >&2
+ exit "$EXCODE"
+}
WORKDIR=$(realpath "$(dirname "$0")")
-cd "$WORKDIR" || (echo cd failed; exit 1)
+cd "$WORKDIR" || fail 1 "The working directory could not be determined."
echo "Working in $WORKDIR"
echo "Homedir is $HOME"
# === CODE BELOW HERE ===
-source "lib/funcs.sh" || exit 1
+source "lib/funcs.sh" || fail 1 "Failed to load components"
+
+if [ ! -f "config.csv" ] || [ ! -f "sets.csv" ]; then
+ # TODO Create them
+ fail 1 "Configuration files do not exist"
+fi
+
+#['name']='install location relative to $HOME'
+declare -A CONFIGS
+while IFS=";" read -r CFG DEST _; do
+ CONFIGS[$CFG]="$DEST"
+done < config.csv
+unset CFG DEST
+
+#['name']='list of keys of CONFIGS (or SETS; Beware of BRB)'
+declare -A SETS
+while IFS=";" read -r SET PKGS _; do
+ SETS[$SET]="$PKGS"
+done < sets.csv
+unset SET PKGS
if [ $# -eq 0 ]; then
cat << EOF
diff --git a/sets.csv b/sets.csv
new file mode 100644
index 0000000..b3d8ad0
--- /dev/null
+++ b/sets.csv
@@ -0,0 +1,2 @@
+base;.vim .bashrc .bash_profile
+desktop;base termite picom i3 deadd polybar .xinitrc .Xresources