-
Notifications
You must be signed in to change notification settings - Fork 0
/
install
44 lines (35 loc) · 1.37 KB
/
install
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
#!/usr/bin/env bash
set -e
if [ -d ~/.icons/HypnOS ]; then
echo 'Existing installation detected.'
read -p 'Do you want to replace the existing installation? [y/N]: ' confirm
if [[ $confirm == [yY] || $confirm == [yY][eE][sS] ]]; then
echo 'Removing existing installation...'
rm -rf ~/.icons/HypnOS
else
echo 'Aborting installation.'
exit 1
fi
fi
temp_dir=$(mktemp -d)
if command -v git &> /dev/null; then
git clone https://github.com/Bergbok/HypnOS-Linux-Cursor.git "$temp_dir"/HypnOS-Linux-Cursor 2>&1 | grep "Cloning into"
else
echo 'Error: git is not installed. Falling back to curl...'
if command -v curl &> /dev/null; then
echo "Downloading into $temp_dir..."
curl -fsSL -o "$temp_dir"/HypnOS-Linux-Cursor.zip https://github.com/Bergbok/HypnOS-Linux-Cursor/archive/refs/heads/main.zip
unzip -q "$temp_dir"/HypnOS-Linux-Cursor.zip -d "$temp_dir"
mv "$temp_dir"/HypnOS-Linux-Cursor-main "$temp_dir"/HypnOS-Linux-Cursor
else
echo 'Error: curl is not installed. Please install git or curl and try again.'
exit 127
fi
fi
echo 'Moving cursor to ~/.icons/HypnOS...'
mv "$temp_dir"/HypnOS-Linux-Cursor/cursor/HypnOS ~/.icons/
echo "Removing $temp_dir..."
rm -rf "$temp_dir"
echo ''
echo 'Successfully installed cursor!'
echo 'To apply, use your desktop environment settings.'