linutil
linutil copied to clipboard
Add automated Git configuration, Nerd Fonts installer, and bootloader management scripts to linutil
Type of Change
- [x] New feature
- [ ] Bug fix
- [ ] Documentation Update
- [ ] Refactoring
- [ ] Hotfix
- [ ] Security patch
- [x] UI/UX improvement
Description
This pull request introduces several new features to linutil:
-
Automated Git Configuration Script: This script helps users set up Git by configuring their GitHub email, SSH key (either Ed25519 or RSA), and copying the SSH key to the clipboard for easy GitHub integration. It checks for necessary tools like
xclipand uses best practices for SSH key generation and GitHub authentication. -
Nerd Fonts Installer Script: This script automates the installation of Nerd Fonts by detecting the user’s Linux distribution and using the appropriate package manager to install dependencies (
curl,tar). It then provides an interactive prompt for selecting fonts, downloads them from GitHub, installs them locally, and refreshes the font cache. This feature simplifies the process of installing Nerd Fonts across different systems. -
Bootloader Switching and Backup Script: This new script facilitates seamless switching between GRUB and systemd-boot bootloaders. It includes:
- Interactive Menu: Detects the current bootloader and offers options to switch to the other bootloader, restore from backups, or exit.
- Backup and Restore: Backs up GRUB or systemd-boot configurations and allows restoring from previous backups.
- Automatic Detection: Automatically detects the current bootloader and provides appropriate actions based on the detected bootloader.
-
Edited Logo: Used ANSI color from
ratatuistyle's color and modifier to create a logo which is in depicted in readme. -
Minor correction of word "parent" in
hint.rsis made.
These changes aim to streamline user setup and enhance the configuration experience, making it easier for developers to quickly configure their environment and manage bootloader setups.
Testing
- The Git configuration script has been tested on various distributions (Ubuntu, Fedora, Arch) for SSH key generation, GitHub key addition, and correct handling of user input for key type and passphrase.
- The Nerd Fonts installer script has been tested across multiple distributions to ensure it correctly installs fonts, refreshes the font cache, and handles package dependencies.
- The Bootloader Switching and Backup script has been tested for interactive menu functionality, accurate detection of the current bootloader, and successful switching between
GRUBandsystemd-boot. Backup and restore functionalities have been verified.
Impact
- Performance: Minimal performance impact since all scripts run only during setup or maintenance processes.
- Dependencies: Introduces requirements for
xclipin the Git configuration script, and ensurescurlandtarare installed for the Nerd Fonts installer. The bootloader script uses common system tools and does not introduce additional runtime dependencies. - Behavior: Enhances the user setup experience by automating Git configuration, font installation, and providing a streamlined process for managing bootloaders.
- Colorful: Logo with ASCII art is colored adds to its visual appeal.
Issue related to PR
- Resolves #256
- Resolves #307
- Resolves #160
- Resolves #308
Additional Information
- The Git configuration script includes detailed user prompts and instructions for adding SSH keys to GitHub.
- The Nerd Fonts installer script uses modular, reusable functions for OS detection and dependency installation, ensuring it is extensible for future font management tasks.
- The Bootloader Switching and Backup script includes comprehensive backup and restoration processes, as well as an intuitive interactive menu for switching and restoring bootloaders.
Checklist
- [x] My code adheres to the coding and style guidelines of the project.
- [x] I have performed a self-review of my own code.
- [x] I have commented my code, particularly in hard-to-understand areas.
- [ ] I have made corresponding changes to the documentation.
- [x] My changes generate no errors/warnings/merge conflicts.
Why are you removing cargo.lock?
I hope the commits have fixed the issue.
BTW I saw a recent cargo run warning due to a new ratatui version...
cargo run warning mesage shown:
warning: use of deprecated method `ratatui::Frame::<'_>::set_cursor`: the method set_cursor_position indicates more clearly what about the cursor to set
--> src/filter.rs:111:19
|
111 | frame.set_cursor(x, y);
| ^^^^^^^^^^
|
= note: `#[warn(deprecated)]` on by default
warning: use of deprecated method `ratatui::Frame::<'_>::size`: use .area() as it's the more correct name
--> src/state.rs:81:26
|
81 | .split(frame.size());
| ^^^^
warning: `tui` (bin "linutil") generated 2 warnings
@fam007e These need to be put on separate lines with Resolves before them.
@fam007e You're adding too many things into 1 PR I'd recommend splitting this up into multiple.
OK I won't add anymore to this.
Sorry for the inconvenience. We had a massive restructure of the codebase to improve future development. Because of this can you update your PR to the new structure. Thank you for your assistance and contribution.
@fam007e This needs to be rebased.
❯ git pull origin main
From github.com:fam007e/linutil
* branch main -> FETCH_HEAD
Already up to date.
❯ git status
On branch main
Your branch is up to date with 'origin/main'.
nothing to commit, working tree clean
❯ git rebase origin/main
Current branch main is up to date.
Despite a successful rebase and a clean status, GitHub still indicates that there are conflicts. I’m perplexed by this.
Here’s what I did:
- Cleared my entire repository and re-added the files to incorporate recent structural changes.
- Added my scripts and made minor edits to
hint.rsto correct a few spelling mistakes. - Updated the logo to an ASCII representation of "Linutil" and used ANSI color codes in
ratatuito add color (blue) to both the "CTT" and the ASCII logo "Linutil" via changes instate.rs. - Adjusted the
tabs/system-setup/tab_data.tomlfile to accommodate the re-added scripts. - Ran
cargo clean && cargo build && ./target/debug/linutilto test my changes.
As a result, the image in the README.md was updated accordingly.
I would appreciate any guidance on resolving this issue.
Can you please split this PR into separate feature PRs
Can you please split this PR into separate feature PRs
I am going for the hard reset. I will make the fork again and make two batches of commits one is for the scripts and another for the .rs files.
Each of the script should be a separate PR so that it will be easy to check