-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall_display_manager
executable file
·102 lines (93 loc) · 2.85 KB
/
install_display_manager
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
#!/bin/bash
echo "Select Display Manager to install:"
echo "1) SDDM"
echo "2) LightDM"
read -p "Enter your choice (1 or 2): " choice
# Detect the OS
if [[ -f /etc/os-release ]]; then
. /etc/os-release
OS=$ID
else
echo "Unsupported OS"
exit 1
fi
current_dir=$(pwd)
get_git_path() {
# Check if GIT_PATH is already set
if [ -z "$GIT_PATH" ]; then
read -p "Do you want to create a default location for git repositories? (y/n) " create_git_dir
if [[ $create_git_dir =~ ^[Yy]$ ]]; then
read -p "Enter the path for git repositories (default: $HOME/git): " git_path
GIT_PATH=$git_path
export GIT_PATH
if [ ! -d "$GIT_PATH" ]; then
mkdir -p "$GIT_PATH"
echo "Created git directory at $GIT_PATH"
else
echo "Git directory already exists at $GIT_PATH"
fi
else
echo "Skipping git directory creation."
fi
else
echo "GIT_PATH is already set to $GIT_PATH"
fi
}
if [[ $choice -eq 1 ]]; then
read -p "Do you want to compile, install, and set up the Tokyo Night theme for SDDM? (y/n): " install_theme
if [[ $install_theme == "y" ]]; then
get_git_path
cd $GIT_PATH
git clone https://github.com/rototrash/tokyo-night-sddm.git
# Check if the themes directory exists, create it if not
sudo mkdir -p /usr/share/sddm/themes/
sudo cp -R tokyo-night-sddm /usr/share/sddm/themes/
echo "Tokyo Night theme installed. Please configure it in /etc/sddm.conf."
fi
fi
cd $current_dir
case $OS in
arch)
if [[ $choice -eq 1 ]]; then
sudo pacman -S --needed sddm
sudo systemctl enable sddm
elif [[ $choice -eq 2 ]]; then
sudo pacman -S --needed lightdm lightdm-gtk-greeter
sudo systemctl enable lightdm
else
echo "Invalid choice"
exit 1
fi
;;
rocky)
if [[ $choice -eq 1 ]]; then
sudo dnf install sddm
sudo systemctl enable sddm
sudo systemctl set-default graphical.target
elif [[ $choice -eq 2 ]]; then
sudo dnf install lightdm lightdm-gtk
sudo systemctl enable lightdm
sudo systemctl set-default graphical.target
else
echo "Invalid choice"
exit 1
fi
;;
debian)
if [[ $choice -eq 1 ]]; then
sudo apt install sddm
sudo systemctl enable sddm
elif [[ $choice -eq 2 ]]; then
sudo apt install lightdm lightdm-gtk-greeter
sudo dpkg-reconfigure lightdm
else
echo "Invalid choice"
exit 1
fi
;;
*)
echo "Unsupported OS"
exit 1
;;
esac
echo "Installation complete."