Update installer.sh

This commit is contained in:
dataprolet 2024-05-29 19:05:02 +02:00
parent 2acaf339e6
commit 7c6e408fa6
1 changed files with 22 additions and 5 deletions

View File

@ -3,30 +3,47 @@
set -eou pipefail set -eou pipefail
# Create systemd user directory # Create systemd user directory
echo "Create systemd user directory." echo "Creating systemd user directory:"
mkdir -vp ~/.config/systemd/user mkdir -vp ~/.config/systemd/user
echo echo
# Copy unit files # Copy unit files
echo "Copy unit files." echo "Copying unit files:"
cp -v theme-switcher.{service,timer} ~/.config/systemd/user cp -v theme-switcher.{service,timer} ~/.config/systemd/user
echo echo
# Add username to service file # Add username to service file
echo "Edit service unit file." echo "Editing service unit file:"
sed -i "s/username/$(whoami)/g" ~/.config/systemd/user/theme-switcher.service sed -i "s/username/$(whoami)/g" ~/.config/systemd/user/theme-switcher.service
echo echo
# Make directory for scripts # Make directory for scripts
echo "Create script directory in /home." echo "Creating script directory in /home:"
mkdir -vp ~/.theme-switcher mkdir -vp ~/.theme-switcher
echo echo
# Copy script file # Copy script file
echo "Copy script into directory." echo "Copying script into directory:"
cp -v *.sh ~/.theme-switcher cp -v *.sh ~/.theme-switcher
echo echo
# Make script executable
echo "Making script executable"
chmod +x ~/.theme-switcher/theme-switcher.sh
# Create autostart directory
echo "Creating autostart directory:"
mkdir -vp ~/.config/autostart
# Copy autostart file
echo "Copying autostart file:"
cp -v theme-switcher.sh.desktop ~/.config/autostart
# Add username to autostart file
echo "Editing autostart file:"
sed -i "s/username/$(whoami)/g" ~/.config/autostart/theme-switcher.sh.desktop
echo
# Enable and start timer # Enable and start timer
echo "Enabling timer." echo "Enabling timer."
systemctl --user enable theme-switcher.timer systemctl --user enable theme-switcher.timer