-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
102 lines (89 loc) · 4.9 KB
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
log_file=~/config_logs.txt
config=~/.config
handle_error() {
local exit_code=$?
echo -e "\033[0;31m An error occurred. (try running this script as admin) \033[0m"
exit $exit_code
}
trap 'handle_error' ERR
# Scoop & winget check
if scoop -v 2>/dev/null | grep -q Scoop; then
echo "Scoop is already installed." | tee -a $log_file
scoop=true
else
echo "Please install Scoop https://scoop.sh/" | tee -a $log_file
fi
if winget 2>/dev/null | grep -q winget; then
echo "Winget is already installed." | tee -a $log_file
winget=true
else
echo "Please install Winget https://aka.ms/getwinget" | tee -a $log_file
fi
if [ "$scoop" = true ] && [ "$winget" = true ]; then
# Alacritty
if alacritty --version list 2>/dev/null | grep -q alacritty; then
echo "Alacritty is already installed."| tee -a $log_file
cp -r "./alacritty" $APPDATA
echo "Moving the config to $APPDATA/alacritty" | tee -a $log_file
echo "Alacritty done." | tee -a $log_file
else
echo "Alacritty is not installed." | tee -a $log_file
echo "Installing Alacritty..." | tee -a $log_file
scoop bucket add extras
scoop install extras/alacritty
#winget install Alacritty.Alacritty
echo "Successfully installed Alacritty." | tee -a $log_file
echo "Moving the config to $APPDATA/alacritty" | tee -a $log_file
cp -r "./alacritty" $APPDATA
echo "Alacritty done." | tee -a $log_file
fi
# MPV
if mpv.com --version 2>/dev/null | grep -q mpv; then
echo "mpv is already installed." | tee -a $log_file
echo "Moving the config to $USERPROFILE/scoop/apps/mpv/current/portable_config/" | tee -a $log_file
cp -r "./mpv"/* $USERPROFILE/scoop/apps/mpv/current/portable_config/
echo "mpv done." | tee -a $log_file
else
echo "mpv is not installed." | tee -a $log_file
echo "Installing mpv..." | tee -a $log_file
scoop install extras/mpv
echo "Successfully installed mpv." | tee -a $log_file
echo "Moving the config to $USERPROFILE/scoop/apps/mpv/current/portable_config/" | tee -a $log_file
cp -r "./mpv"/* $USERPROFILE/scoop/apps/mpv/current/portable_config/
echo "mpv done." | tee -a $log_file
fi
# GlazeWM
if scoop list 2>/dev/null | grep -q glazewm; then
echo "GlazeWM is already installed." | tee -a $log_file
echo "Moving the config to $USERPROFILE/.glaze-wm/" | tee -a $log_file
cp -r "./glaze-wm"/* $USERPROFILE/.glaze-wm/
echo "Creating a startmenu shortcut & auto startup..." | tee -a $log_file
powershell -Command "if (-not (Test-Path -Path 'C:\ProgramData\Microsoft\Windows\Start Menu\Programs\GlazeWM.lnk')) { New-Item -ItemType SymbolicLink -Path 'C:\ProgramData\Microsoft\Windows\Start Menu\Programs' -Name 'GlazeWM.lnk' -Value '$USERPROFILE/scoop/apps/glazewm/current/GlazeWM.exe' }"
powershell -Command "if (-not (Test-Path -Path '$APPDATA\Microsoft\Windows\Start Menu\Programs\GlazeWM.lnk')) { New-Item -ItemType SymbolicLink -Path '$APPDATA\Microsoft\Windows\Start Menu\Programs' -Name 'GlazeWM.lnk' -Value '$USERPROFILE/scoop/apps/glazewm/current/GlazeWM.exe' }"
powershell -Command "if (-not (Test-Path -Path '$APPDATA\Microsoft\Windows\Start Menu\Programs\Startup\GlazeWM.lnk')) { New-Item -ItemType SymbolicLink -Path '$APPDATA\Microsoft\Windows\Start Menu\Programs\Startup' -Name 'GlazeWM.lnk' -Value '$USERPROFILE/scoop/apps/glazewm/current/GlazeWM.exe' }"
echo "GlazeWM done." | tee -a $log_file
else
echo "GlazeWM is not installed." | tee -a $log_file
echo "Installing GlazeWM..." | tee -a $log_file
scoop install glazewm
echo "Successfully installed GlazeWM." | tee -a $log_file
echo "Moving the config to $USERPROFILE/.glaze-wm/" | tee -a $log_file
mkdir $USERPROFILE/.glaze-wm/
cp -r "./glaze-wm"/* $USERPROFILE/.glaze-wm/
echo "Creating a startmenu shortcut & auto startup..." | tee -a $log_file
powershell -Command "if (-not (Test-Path -Path 'C:\ProgramData\Microsoft\Windows\Start Menu\Programs\GlazeWM.lnk')) { New-Item -ItemType SymbolicLink -Path 'C:\ProgramData\Microsoft\Windows\Start Menu\Programs' -Name 'GlazeWM.lnk' -Value '$USERPROFILE/scoop/apps/glazewm/current/GlazeWM.exe' }"
powershell -Command "if (-not (Test-Path -Path '$APPDATA\Microsoft\Windows\Start Menu\Programs\Startup\GlazeWM.lnk')) { New-Item -ItemType SymbolicLink -Path '$APPDATA\Microsoft\Windows\Start Menu\Programs\Startup' -Name 'GlazeWM.lnk' -Value '$USERPROFILE/scoop/apps/glazewm/current/GlazeWM.exe' }"
powershell -Command "if (-not (Test-Path -Path '$APPDATA\Microsoft\Windows\Start Menu\Programs\GlazeWM.lnk')) { New-Item -ItemType SymbolicLink -Path '$APPDATA\Microsoft\Windows\Start Menu\Programs' -Name 'GlazeWM.lnk' -Value '$USERPROFILE/scoop/apps/glazewm/current/GlazeWM.exe' }"
echo "GlazeWM done." | tee -a $log_file
fi
else
echo "Please make sure to install winget & scoop." | tee -a $log_file
fi
#==============
# Give the user a summary of what has been installed
#==============
clear
echo -e "\n====== LOGS ======\n"
cat $log_file
echo
rm $log_file