|
|
@@ -1,18 +1,5 @@ |
|
|
|
#!/bin/bash |
|
|
|
|
|
|
|
export OS=$(awk '/DISTRIB_ID=/' /etc/*-release | sed 's/DISTRIB_ID=//' | tr '[:upper:]' '[:lower:]') |
|
|
|
|
|
|
|
case $OS in |
|
|
|
ubuntu) |
|
|
|
;; |
|
|
|
*) |
|
|
|
echo "Unsupported OS: ${OS}." |
|
|
|
exit 1 |
|
|
|
esac |
|
|
|
|
|
|
|
rm out.log &>/dev/null |
|
|
|
mkdir .installed &>/dev/null |
|
|
|
|
|
|
|
issues=0 |
|
|
|
|
|
|
|
check_command() |
|
|
@@ -32,63 +19,6 @@ check_file() |
|
|
|
fi |
|
|
|
} |
|
|
|
|
|
|
|
check_dep() |
|
|
|
{ |
|
|
|
dep="" |
|
|
|
|
|
|
|
case $OS in |
|
|
|
ubuntu) |
|
|
|
case $1 in |
|
|
|
xcb_keysym.h) |
|
|
|
dep="libxcb-keysyms1-dev" |
|
|
|
;; |
|
|
|
xcb.h) |
|
|
|
dep="libxcb-util0-dev" |
|
|
|
;; |
|
|
|
esac |
|
|
|
;; |
|
|
|
esac |
|
|
|
|
|
|
|
exists=0 |
|
|
|
case $OS in |
|
|
|
ubuntu) |
|
|
|
dpkg -s "$dep" &> /dev/null |
|
|
|
exists="$?" |
|
|
|
;; |
|
|
|
esac |
|
|
|
|
|
|
|
if [ ! $exists ]; then |
|
|
|
if [ "$dep" = "" ]; then |
|
|
|
echo "Missing dependency: $1" |
|
|
|
else |
|
|
|
echo "Missing dependency: $dep" |
|
|
|
fi |
|
|
|
issues=1 |
|
|
|
fi |
|
|
|
} |
|
|
|
|
|
|
|
install_setup() |
|
|
|
{ |
|
|
|
if [ -f ".installed/$1" ]; then |
|
|
|
echo "$1 is already installed, skipping." |
|
|
|
return |
|
|
|
fi |
|
|
|
|
|
|
|
echo "Installing ${1}..." |
|
|
|
DIR=$(mktemp -d) |
|
|
|
CDIR=$(pwd) |
|
|
|
cd $DIR |
|
|
|
echo "\n\nINSTALL: $1" >> "$CDIR/out.log" |
|
|
|
sh "$CDIR/install/${1}.sh" &>> "$CDIR/out.log" |
|
|
|
if [ ! $? ]; then |
|
|
|
echo "An error occurred while installing ${1}. See out.log for more information." |
|
|
|
else |
|
|
|
touch "$CDIR/.installed/$1" |
|
|
|
echo "Done." |
|
|
|
fi |
|
|
|
cd "$CDIR" |
|
|
|
} |
|
|
|
|
|
|
|
check_command "zsh" |
|
|
|
check_command "tmux" |
|
|
|
check_command "vim" |
|
|
@@ -107,9 +37,6 @@ check_command "dunst" |
|
|
|
check_command "curl" |
|
|
|
check_command "sudo" |
|
|
|
|
|
|
|
check_dep "xcb.h" |
|
|
|
check_dep "xcb_keysym.h" |
|
|
|
|
|
|
|
if [ $issues -ne 0 ]; then |
|
|
|
echo "Some things are missing. Continue? (y/n)" |
|
|
|
read response |
|
|
@@ -129,6 +56,7 @@ cd .. |
|
|
|
echo "Done." |
|
|
|
|
|
|
|
echo "Copying config files..." |
|
|
|
mkdir -p "$HOME/.config" |
|
|
|
cd config |
|
|
|
for f in *; do |
|
|
|
rm -rf "$HOME/.config/$f" |
|
|
@@ -152,26 +80,18 @@ rm -fr "$HOME/assets" |
|
|
|
cp -r assets "$HOME/assets" |
|
|
|
echo "Done." |
|
|
|
|
|
|
|
while getopts :m:f option; do |
|
|
|
while getopts :m option; do |
|
|
|
case "$option" in |
|
|
|
m) |
|
|
|
echo "Not switching mod and alt keys." |
|
|
|
echo "" > ~/.Xmodmaprc |
|
|
|
;; |
|
|
|
f) |
|
|
|
echo "Forcing a recompile of packages." |
|
|
|
rm .installed/* |
|
|
|
;; |
|
|
|
*) |
|
|
|
echo "Unknown option: $option" |
|
|
|
;; |
|
|
|
esac |
|
|
|
done |
|
|
|
|
|
|
|
install_setup "sxhkd" |
|
|
|
install_setup "i3wm" |
|
|
|
install_setup "mrec" |
|
|
|
|
|
|
|
if [ "$SHELL" != "/bin/zsh" ]; then |
|
|
|
sudo chsh "$USER" -s /bin/zsh |
|
|
|
fi |