-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·44 lines (30 loc) · 1.15 KB
/
Copy pathinstall.sh
File metadata and controls
executable file
·44 lines (30 loc) · 1.15 KB
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
#!/bin/bash
set -e
source "./config.sh"
echo "Checking if the system is supported..."
python3 check_platform.py || exit 1
if ! command -v apt >/dev/null 2>&1; then
echo "APT package manager not found. Unsupported system."
exit 1
fi
echo "Copying the binary..."
sudo install -d "$py_install_dir"
sudo install -m 755 "$project_name"/*.py "$py_install_dir/"
echo "Installing the dependencies..."
sudo apt update
sudo apt install python3-gi python3-pydbus python3-psutil python3
echo "Copying the configuration files..."
sudo install -d "$config_file_dir"
sudo install -m 644 configs/* "$config_file_dir/"
echo "Creating systemd units..."
install -d "$user_unit_dir"
install -m 644 "systemd/$screen_monitor_service" "$user_unit_dir/"
sudo install -m 644 "systemd/$controller_service" "$system_unit_dir/"
echo "Reloading systemd and enabling services..."
sudo systemctl daemon-reload
sudo systemctl enable "$controller_service"
systemctl --user daemon-reload
systemctl --user enable "$screen_monitor_service"
echo "Installation complete!"
echo "The configuration files are located in $config_file_dir"
echo "Services will start automatically after the next reboot"