-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·40 lines (32 loc) · 1.12 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
#!/bin/bash
# Build the program using cargo
cargo install --path .
cargo install wallust
home_path=$(echo ~)
# Define the service file content
SERVICE_FILE_CONTENT="[Unit]
Description=Autotheme Service
[Service]
ExecStart=$home_path/.cargo/bin/gnome-autotheme
Environment=AUTOTHEME_SCRIPT=$home_path/.bin/autotheme.bash
Environment=RUST_LOG=info
Restart=always
[Install]
WantedBy=default.target"
# Create the systemd user service directory if it doesn't exist
mkdir -p ~/.config/systemd/user
# Write the service file
echo "$SERVICE_FILE_CONTENT" > ~/.config/systemd/user/autotheme.service
mkdir -p ~/.bin
mkdir -p ~/.config/autotheme
# Copy the autotheme.bash script to /usr/local/bin
cp ./autotheme.bash ~/.bin/autotheme.bash
cp wallust.toml ~/.config/autotheme/wallust.toml
cp wallust-light.toml ~/.config/autotheme/wallust-light.toml
cp -r templates/ ~/.config/autotheme/templates
# Reload the systemd manager configuration
systemctl --user daemon-reload
# Enable and start the service
systemctl --user enable autotheme.service
systemctl --user start autotheme.service --now
echo "Autotheme service installed and started successfully."