From cd0dc9d9883c1df53df6af81a50fbb6c23e42813 Mon Sep 17 00:00:00 2001 From: AnthonyAxenov Date: Sun, 9 Jan 2022 17:14:15 +0800 Subject: [PATCH] =?UTF-8?q?=D0=A4=D0=B8=D0=BA=D1=81=D1=8B=20$HOME,=20$USER?= =?UTF-8?q?=20+=20dotfiles?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dotfiles/{.aliases => .bash_aliases} | 0 dotfiles/.zshrc | 4 ++-- install/010-git.sh | 10 +++++----- install/050-syncthing.sh | 6 +++--- install/130-postman.sh | 2 +- install/200-golang.sh | 6 +++--- install/500-kde-appmenu.sh | 2 +- install/999-dotfiles.sh | 21 +++++++++++++-------- start.sh | 7 +------ 9 files changed, 29 insertions(+), 29 deletions(-) rename dotfiles/{.aliases => .bash_aliases} (100%) diff --git a/dotfiles/.aliases b/dotfiles/.bash_aliases similarity index 100% rename from dotfiles/.aliases rename to dotfiles/.bash_aliases diff --git a/dotfiles/.zshrc b/dotfiles/.zshrc index 6734b9d..f820082 100644 --- a/dotfiles/.zshrc +++ b/dotfiles/.zshrc @@ -2,7 +2,7 @@ # export PATH=$HOME/bin:/usr/local/bin:$PATH # Path to your oh-my-zsh installation. -export ZSH="/home/anthony/.oh-my-zsh" +export ZSH="$HOME/.oh-my-zsh" # Set name of the theme to load --- if set to "random", it will # load a random theme each time oh-my-zsh is loaded, in which case, @@ -103,4 +103,4 @@ source $ZSH/oh-my-zsh.sh # alias zshconfig="mate ~/.zshrc" # alias ohmyzsh="mate ~/.oh-my-zsh" -source ~/.aliases +source ~/.bash_aliases diff --git a/install/010-git.sh b/install/010-git.sh index db2338c..1dee6dd 100755 --- a/install/010-git.sh +++ b/install/010-git.sh @@ -7,7 +7,7 @@ echo if installed git; then [ ! -d "/usr/src/git" ] && sudo git clone https://github.com/git/git.git --depth=1 /usr/src/git - sudo chown -R anthony: /usr/src/git + sudo chown -R $USER: /usr/src/git cd /usr/src/git/ sudo make prefix=/usr/local all sudo make prefix=/usr/local install @@ -21,9 +21,9 @@ else cd /usr/src sudo rm -rf git sudo git clone https://github.com/git/git.git --depth=1 /usr/src/git - sudo chown -R anthony: /usr/src/git + sudo chown -R $USER: /usr/src/git fi -git config set --global user.name 'AnthonyAxenov' -git config set --global user.email 'anthonyaxenov@gmail.com' +ENVDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" +DOTFILESDIR="$ENVDIR"/dotfiles git --version -# TODO: cp $DOTFILESDIR/.gitconfig $HOME/.gitconfig +cp $DOTFILESDIR/.gitconfig $HOME/.gitconfig \ No newline at end of file diff --git a/install/050-syncthing.sh b/install/050-syncthing.sh index c4f801b..308eab5 100755 --- a/install/050-syncthing.sh +++ b/install/050-syncthing.sh @@ -20,7 +20,7 @@ echo "deb [signed-by=/usr/share/keyrings/syncthing-archive-keyring.gpg] https:// sudo apt update sudo apt install -y --autoremove syncthing -wget "https://raw.githubusercontent.com/syncthing/syncthing/main/etc/linux-desktop/syncthing-start.desktop" -O /home/anthony/.local/share/applications/syncthing-start.desktop -wget "https://raw.githubusercontent.com/syncthing/syncthing/main/etc/linux-desktop/syncthing-ui.desktop" -O /home/anthony/.local/share/applications/syncthing-ui.desktop -ln -s /home/anthony/.local/share/applications/syncthing-start.desktop /home/anthony/.config/autostart/syncthing-start.desktop +wget "https://raw.githubusercontent.com/syncthing/syncthing/main/etc/linux-desktop/syncthing-start.desktop" -O $HOME/.local/share/applications/syncthing-start.desktop +wget "https://raw.githubusercontent.com/syncthing/syncthing/main/etc/linux-desktop/syncthing-ui.desktop" -O $HOME/.local/share/applications/syncthing-ui.desktop +ln -s $HOME/.local/share/applications/syncthing-start.desktop $HOME/.config/autostart/syncthing-start.desktop # или демоном: https://habr.com/ru/post/350892/ diff --git a/install/130-postman.sh b/install/130-postman.sh index 25d498b..cd1d5b7 100755 --- a/install/130-postman.sh +++ b/install/130-postman.sh @@ -21,5 +21,5 @@ Categories=Utility,Network Terminal=false Type=Application Encoding=UTF-8 -" > /home/anthony/.local/share/applications/Postman.desktop +" > $HOME/.local/share/applications/Postman.desktop sudo update-desktop-database diff --git a/install/200-golang.sh b/install/200-golang.sh index f226ce8..fd566e9 100755 --- a/install/200-golang.sh +++ b/install/200-golang.sh @@ -16,10 +16,10 @@ sudo rm -rf /usr/local/go wget "https://golang.org/dl/$FILE" -O /tmp/$FILE sudo tar -xzf $FILE -C /usr/local rm -rf /tmp/$FILE -sudo chown anthony: -R /usr/local/go +sudo chown $USER: -R /usr/local/go -echo "export PATH=$PATH:/usr/local/go/bin" >> /home/anthony/.profile -echo "export GOPATH=~/.go" >> /home/anthony/.profile +echo "export PATH=$PATH:/usr/local/go/bin" >> $HOME/.profile +echo "export GOPATH=~/.go" >> $HOME/.profile # source ~/.profile echo diff --git a/install/500-kde-appmenu.sh b/install/500-kde-appmenu.sh index 62a0a78..659250b 100755 --- a/install/500-kde-appmenu.sh +++ b/install/500-kde-appmenu.sh @@ -33,7 +33,7 @@ else sudo rm -rf /usr/src/appmenu-applet/applet-window-appmenu-master sudo rm -f /usr/src/appmenu-applet.zip fi -sudo chown -R anthony: /usr/src/appmenu-applet +sudo chown -R $USER: /usr/src/appmenu-applet cd /usr/src/appmenu-applet/ sh ./install.sh echo diff --git a/install/999-dotfiles.sh b/install/999-dotfiles.sh index 8d673d4..59ab44a 100755 --- a/install/999-dotfiles.sh +++ b/install/999-dotfiles.sh @@ -1,10 +1,15 @@ #!/bin/bash -# . "../src/01-common.sh" || exit 5 -# title "Copying dotfiles..." -# require_start +echo +echo "===============================================" +echo "Installing dotfiles..." +echo "===============================================" +echo -# cp $DOTFILESDIR/.aliases $HOME/.aliases -# cp $DOTFILESDIR/.bashrc $HOME/.bashrc -# cp $DOTFILESDIR/.zshrc $HOME/.zshrc -# cp $DOTFILESDIR/.gitconfig $HOME/.gitconfig -# cp -R $DOTFILESDIR/Шаблоны $HOME/Шаблоны +ENVDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" +DOTFILESDIR="$ENVDIR"/dotfiles + +cp $DOTFILESDIR/.bash_aliases $HOME/.bash_aliases +cp $DOTFILESDIR/.bashrc $HOME/.bashrc +cp $DOTFILESDIR/.zshrc $HOME/.zshrc +cp $DOTFILESDIR/.gitconfig $HOME/.gitconfig +cp -R $DOTFILESDIR/Шаблоны $HOME/Шаблоны diff --git a/start.sh b/start.sh index e670442..4c8cf9d 100755 --- a/start.sh +++ b/start.sh @@ -1,11 +1,6 @@ #!/bin/bash set -e -OLDDIR=`pwd` -ENVDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" -INSTALLDIR="$ENVDIR"/install -DOTFILESDIR="$ENVDIR"/dotfiles - -for script in "$INSTALLDIR"/*.sh +for script in "$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"/install/*.sh do . "$script" done