Dev Alias Manager is a Bash script tool for managing USB device aliases. It allows users to listen for new devices, view recorded devices, display detailed device information, delete device records, and rename device aliases.
- Listen for new (USB) device connections
- Assign aliases to new devices
- View list of recorded devices
- Display detailed device information
- Delete device records
- Rename device aliases
- Multi-language support (English, Chinese, Japanese)
- Automatic language detection
- Configurable settings
- Logging functionality
- Backup management for udev rules
- Clone the repository:
git clone https://github.com/XKHoshizora/dev-mgmt-tools.git
- Enter the project directory:
cd dev-mgmt-tools
- Ensure the script has execution permissions:
chmod +x dev_alias_manager.sh
Run the script:
sudo ./dev_alias_manager.sh
Note: Some operations (such as modifying udev rules) require root
privileges, so it's recommended to run the script with sudo
.
Follow the on-screen prompts to select an operation:
- Listen for new devices
- View recorded devices
- Show detailed device information
- Delete device record
- Rename device alias
- Exit
The configuration file is located at config/dev_alias_manager.conf
. You can customize the following settings:
MAX_RETRIES
: Maximum number of retries for symlink creationTIMEOUT
: Timeout for device operationsDEVICE_RECORD_FILE
: Location of the udev rules fileLOG_LEVEL
: Logging level (DEBUG, INFO, WARNING, ERROR)AUTO_NAMING
: Enable/disable automatic device namingAUTO_NAME_PREFIX
: Prefix for automatically generated namesLANGUAGE
: Force a specific language (en, zh, ja)MAX_BACKUPS
: Maximum number of backup files to keep
A default configuration file dev_alias_manager.conf.default
is provided as a template.
Log files are located at logs/dev_alias_manager.log
.
The script automatically detects your system language and displays messages in English, Chinese, or Japanese accordingly. If your system language is not one of these, English will be used as the default. You can also set the language manually in the configuration file.
The script creates backups of the udev rules file before making changes. Backups are stored in the backups
directory. The number of backups kept is configurable.
- This script modifies system udev rules. Use with caution.
- The script creates a backup of the udev rules file before any operation.
- Check the log file for more information if you encounter any issues.
- The script uses a lock file to prevent multiple instances from running simultaneously.
Issues and Pull Requests are welcome to help improve this project.
This project is licensed under the MIT License - see the LICENSE file for details.