42 lines
1.2 KiB
Bash
42 lines
1.2 KiB
Bash
#!/bin/bash
|
|
|
|
# Script to install unclutter, configure it, and enable autostart on reboot
|
|
# Author: Your Name
|
|
# Date: $(date)
|
|
|
|
# Set the idle time (in seconds) for mouse cursor auto-hide
|
|
IDLE_TIME=3
|
|
|
|
# Step 1: Update system and install unclutter
|
|
echo "Updating system and installing unclutter..."
|
|
sudo apt-get update
|
|
sudo apt-get install -y unclutter
|
|
|
|
# Step 2: Create autostart configuration directory
|
|
echo "Configuring unclutter to autostart..."
|
|
mkdir -p ~/.config/autostart
|
|
|
|
# Step 3: Create autostart configuration file
|
|
AUTOSTART_FILE=~/.config/autostart/unclutter.desktop
|
|
|
|
cat <<EOL > "$AUTOSTART_FILE"
|
|
[Desktop Entry]
|
|
Type=Application
|
|
Exec=unclutter -idle $IDLE_TIME
|
|
Hidden=false
|
|
NoDisplay=false
|
|
X-GNOME-Autostart-enabled=true
|
|
Name=Unclutter
|
|
Comment=Auto-hide mouse cursor after $IDLE_TIME seconds of inactivity
|
|
EOL
|
|
|
|
# Step 4: Display success message
|
|
echo "Unclutter has been installed and configured successfully."
|
|
echo "Mouse cursor will auto-hide after $IDLE_TIME seconds of inactivity."
|
|
echo "The configuration will persist across reboots."
|
|
echo "If you want to change the idle time, edit the file: $AUTOSTART_FILE"
|
|
|
|
# Step 5: Suggest reboot
|
|
echo "Please log out and log back in, or reboot your system for the changes to take effect."
|
|
|