Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop #142

Merged
merged 7 commits into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 49 additions & 33 deletions .backup/run.sh
Original file line number Diff line number Diff line change
@@ -1,36 +1,52 @@
#!/bin/bash

cp -TRv "${ZSH_CUSTOM:-$HOME}"/.psensor ../linux/.psensor
cp -TRv "${ZSH_CUSTOM:-$HOME}"/.p10k.zsh ../.p10k.zsh
cp -TRv "${ZSH_CUSTOM:-$HOME}"/.zshrc ../.zshrc

cp -TRv "${ZSH_CUSTOM:-$HOME}"/.config/bleachbit ../linux/.config/bleachbit
cp -TRv "${ZSH_CUSTOM:-$HOME}"/.config/autostart ../linux/.config/autostart
cp -TRv "${ZSH_CUSTOM:-$HOME}"/.config/compton ../linux/.config/compton
cp -TRv "${ZSH_CUSTOM:-$HOME}"/.config/nautilus ../linux/.config/nautilus
cp -TRv "${ZSH_CUSTOM:-$HOME}"/.config/terminator ../linux/.config/terminator
cp -TRv "${ZSH_CUSTOM:-$HOME}"/.config/ulauncher ../linux/.config/ulauncher
cp -TRv "${ZSH_CUSTOM:-$HOME}"/.config/Dharkael ../linux/.config/Dharkael

# shellcheck disable=SC1091
if [ -f "/etc/os-release" ]; then
. /etc/os-release
OS=$NAME

if [ "$OS" == "Ubuntu" ]; then
cp -TRv "${ZSH_CUSTOM:-$HOME}"/.config/dconf ../ubuntu/.config/dconf
cp -TRv "${ZSH_CUSTOM:-$HOME}"/.config/mimeapps.list ../ubuntu/.config/mimeapps.list
cp -TRv "${ZSH_CUSTOM:-$HOME}"/.config/gnome-shell ../ubuntu/.config/gnome-shell

cp -TRv "${ZSH_CUSTOM:-$HOME}"/.local/share/sounds ../ubuntu/.local/share/sounds
cp -TRv "${ZSH_CUSTOM:-$HOME}"/.local/share/grilo-plugins ../ubuntu/.local/share/grilo-plugins
cp -TRv "${ZSH_CUSTOM:-$HOME}"/.local/share/gnome-shell ../ubuntu/.local/share/gnome-shell

elif [ "$OS" == "Zorin OS" ]; then
cp -TRv "${ZSH_CUSTOM:-$HOME}"/.config/dconf ../zorin/.config/dconf
cp -TRv "${ZSH_CUSTOM:-$HOME}"/.config/mimeapps.list ../zorin/.config/mimeapps.list

cp -TRv "${ZSH_CUSTOM:-$HOME}"/.local/share/sounds ../zorin/.local/share/sounds
cp -TRv "${ZSH_CUSTOM:-$HOME}"/.local/share/gnome-shell ../zorin/.local/share/gnome-shell
OS=$(uname -s)

case "$OS" in
"Darwin")
echo "Running on MacOS"
;;
"Linux")
# shellcheck disable=SC1091
if [ -f "/etc/os-release" ]; then
. /etc/os-release
echo "Running on $NAME"

cp -TRv "${HOME}"/.p10k.zsh ../.p10k.zsh
cp -TRv "${HOME}"/.zshrc ../.zshrc

cp -TRv "${HOME}"/.psensor ../linux/.psensor
cp -TRv "${HOME}"/.config/bleachbit ../linux/.config/bleachbit
cp -TRv "${HOME}"/.config/autostart ../linux/.config/autostart
cp -TRv "${HOME}"/.config/compton ../linux/.config/compton
cp -TRv "${HOME}"/.config/nautilus ../linux/.config/nautilus
cp -TRv "${HOME}"/.config/terminator ../linux/.config/terminator
cp -TRv "${HOME}"/.config/ulauncher ../linux/.config/ulauncher
cp -TRv "${HOME}"/.config/Dharkael ../linux/.config/Dharkael

if [ "$NAME" == "Ubuntu" ]; then
cp -TRv "${HOME}"/.config/dconf ../ubuntu/.config/dconf
cp -TRv "${HOME}"/.config/mimeapps.list ../ubuntu/.config/mimeapps.list
cp -TRv "${HOME}"/.config/gnome-shell ../ubuntu/.config/gnome-shell

cp -TRv "${HOME}"/.local/share/sounds ../ubuntu/.local/share/sounds
cp -TRv "${HOME}"/.local/share/grilo-plugins ../ubuntu/.local/share/grilo-plugins
cp -TRv "${HOME}"/.local/share/gnome-shell ../ubuntu/.local/share/gnome-shell

elif [ "$NAME" == "Zorin OS" ]; then
cp -TRv "${HOME}"/.config/dconf ../zorin/.config/dconf
cp -TRv "${HOME}"/.config/mimeapps.list ../zorin/.config/mimeapps.list

cp -TRv "${HOME}"/.local/share/sounds ../zorin/.local/share/sounds
cp -TRv "${HOME}"/.local/share/gnome-shell ../zorin/.local/share/gnome-shell
fi
elif command -v lsb_release &> /dev/null; then
echo "Running on $(lsb_release -s -d)"
else
echo "Linux distribution detection requires /etc/os-release or lsb_release"
fi
fi
;;
*)
echo "Running on $OS"
;;
esac
1 change: 0 additions & 1 deletion .github/workflows/test_macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,4 @@ jobs:
set -e
export CI=1
git submodule update --init
cd macos
bash install.sh
3 changes: 1 addition & 2 deletions .github/workflows/test_ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,5 @@ jobs:
set -e
export CI=1
git submodule update --init
cd linux
bash workflows/test_ubuntu.sh
bash linux/workflows/test_ubuntu.sh
bash install.sh
2 changes: 1 addition & 1 deletion Documents.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

======= change npm version =======
```bash
nvm install v22
nvm install v22 -g
nvm use v22
```

Expand Down
27 changes: 27 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash

OS=$(uname -s)

case "$OS" in
"Darwin")
echo "Running on MacOS"
cd macos || exit
bash install.sh "$1"
;;
"Linux")
# shellcheck disable=SC1091
if [ -f "/etc/os-release" ]; then
. /etc/os-release
echo "Running on $NAME"
cd linux || exit
bash install.sh "$1"
elif command -v lsb_release &> /dev/null; then
echo "Running on $(lsb_release -s -d)"
else
echo "Linux distribution detection requires /etc/os-release or lsb_release"
fi
;;
*)
echo "Running on $OS"
;;
esac
37 changes: 33 additions & 4 deletions macos/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ done

echo '####################################################################'
brewInstallation() {
APP_LIST=("openkey" "rectangle" "maccy" "keepingyouawake" "iterm2" "skype" "spotify" "anydesk" "teamviewer" "obs" "chatgpt" "slack" "gpg-suite" "notion" "zoom" "figma" "vlc")
APP_LIST=("openkey" "rectangle" "maccy" "keepingyouawake" "iterm2" "karabiner-elements" "skype" "spotify" "anydesk" "teamviewer" "obs" "chatgpt" "slack" "gpg-suite" "notion" "zoom" "figma" "vlc")

for appName in "${APP_LIST[@]}"; do
echo "=========================== $appName ==========================="
Expand Down Expand Up @@ -66,7 +66,6 @@ brewInstallation() {
echo ""
done
}
brewInstallation

brewFormulaInstallation() {
APP_LIST=("flameshot")
Expand Down Expand Up @@ -100,10 +99,40 @@ brewFormulaInstallation() {
echo ""
done
}
brewFormulaInstallation

while true; do
if [[ $ACCEPT_INSTALL =~ ^[Yy]$ ]]; then
yn="y"
else
read -r -p "Do you want to install packages, app with brew? (Y/N) " yn
fi
case $yn in
[Yy]*)
brewInstallation
brewFormulaInstallation
break
;;
[Nn]*) break ;;
*) echo "Please answer yes or no." ;;
esac
done

if [[ $ACCEPT_INSTALL =~ ^[Yy]$ ]]; then
sudo spctl --master-enable
fi

bash config.sh
while true; do
if [[ $ACCEPT_INSTALL =~ ^[Yy]$ ]]; then
yn="y"
else
read -r -p "Do you want to install zsh (Need if it not installed)? (Y/N) " yn
fi
case $yn in
[Yy]*)
bash config.sh
break
;;
[Nn]*) break ;;
*) echo "Please answer yes or no." ;;
esac
done
20 changes: 2 additions & 18 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ You will need to have an Ubuntu, Zorin OS, or macOS installed on your system.

# Installing

## Install for Linux
Before running this script, please clone the repository to your local machine.

```bash
Expand All @@ -39,15 +38,14 @@ cd dotfiles
Then, run the following command to install dotfiles.

```bash
cd linux
bash install.sh
```

Now, wait for a while, and you will see some messages questioning do you want to install some tools. If you want to
install some tools, please answer **yes(y)**.

> [!IMPORTANT]
> ## What to do after overwriting existing configurations?
> ## What to do after overwriting existing configurations? (Only for Linux)
> In the installing process, you see a message that says "**Do you want copy and overwrite existing config folders from
this source to your os?**".
>
Expand All @@ -62,21 +60,7 @@ this source to your os?**".
>
> 2. **LOG OUT** and **LOG IN AGAIN** to your OS.

## Install for macOS

Before running this script on a macOS system, please clone the repository to your local machine.

```bash
git clone https://github.com/tanhongit/dotfiles.git
cd dotfiles
```

Then, navigate to the macOS directory and run the installation script.

```bash
cd macos
bash install.sh
```
## Install with option for macOS

If you wish to install using the bundle parameter, please add it to the bash command as follows:

Expand Down
Loading