auto hide mouse + change port name

This commit is contained in:
quynhnm
2025-01-20 15:27:15 +07:00
parent a9c4a34b9e
commit 0aa1665855
5 changed files with 92 additions and 167 deletions

View File

@@ -14,4 +14,7 @@ sudo chmod +x /root/monitor/setup/serverlite.sh
sudo chmod +x /root/monitor/setup/datetime
sudo chmod +x /root/monitor/setup/update_serverlite.sh
sudo chmod +x /root/monitor/setup/install_font_style/installfont.sh
exit 0
sudo chmod +x /root/monitor/setup/setup_hide_mouse.sh
sudo chmod +x /root/monitor/setup/setup_usb_portname.sh
exit 0

View File

@@ -23,6 +23,9 @@ sudo chmod +x /root/monitor/setup/datetime
sudo chmod +x /root/monitor/setup/update_serverlite.sh
sudo chmod +x /root/monitor/setup/run_crontab.sh
sudo chmod +x /root/monitor/setup/install_font_style/installfont.sh
sudo chmod +x /root/monitor/setup/setup_hide_mouse.sh
sudo chmod +x /root/monitor/setup/setup_usb_portname.sh
# CHANGE NAME BOX
echo "BIFACE" > /etc/hostname
# ******************Install Lib Soud******************
@@ -113,11 +116,8 @@ cd /etc/lightdm/lightdm.conf.d
echo "autologin-user=root
autologin-user-timeout=0
" >> 11-armbian.conf
fi
#
#*************setup serverlite**********
sudo /root/monitor/setup/serverlite.sh
#
fi#
#*************install p7zip-full**************
sudo apt install p7zip-full
# Disable ttyS0
@@ -127,6 +127,17 @@ systemctl disable serial-getty@ttyS0.service
# Install font
sudo /root/monitor/setup/install_font_style/installfont.sh
#
#*************setup auto hide mouse**********
sudo /root/monitor/setup/setup_hide_mouse.sh
#*************setup change port name**********
sudo /root/monitor/setup/setup_usb_portname.sh
#*************setup serverlite**********
sudo /root/monitor/setup/serverlite.sh
#
sudo apt-get -y update
#
reboot
reboot

View File

@@ -0,0 +1,41 @@
#!/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."

View File

@@ -0,0 +1,30 @@
#!/bin/bash
# Script to create and apply udev rule to change USB port name
# Author: Your Name
# Date: $(date)
# Step 1: Define the udev rule file path
UDEV_RULE_FILE="/etc/udev/rules.d/10-usb-serial.rules"
# Step 2: Create the udev rule file
echo "Creating udev rule file at $UDEV_RULE_FILE..."
sudo bash -c "cat <<EOL > $UDEV_RULE_FILE
KERNEL==\"ttyUSB*\", SUBSYSTEM==\"tty\", DRIVERS==\"usb\", SYMLINK+=\"ttyUSB_DEVICE1\", MODE=\"0666\"
EOL"
# Step 3: Reload udev rules and apply changes
echo "Reloading udev rules and triggering..."
sudo udevadm control --reload-rules && sudo udevadm trigger
# Step 4: Confirm completion
if [ $? -eq 0 ]; then
echo "USB port name rule successfully applied."
echo "New symbolic link: /dev/ttyUSB_DEVICE1"
else
echo "Failed to apply USB port name rule."
fi
# Step 5: Suggest reboot for persistence
echo "You may need to reconnect the USB device or reboot the system for the changes to take effect."