linutil icon indicating copy to clipboard operation
linutil copied to clipboard

NerdFonts installer script added and consequential change to tab_data TOML file.

Open fam007e opened this issue 1 year ago • 12 comments

Type of Change

  • [x] New feature
  • [ ] Bug fix
  • [ ] Documentation Update
  • [ ] Refactoring
  • [ ] Hotfix
  • [ ] Security patch
  • [ ] UI/UX improvement

Description

The NerdFonts installer script has been added, allowing users to select and install a variety of NerdFonts through a command-line interface. This feature ensures that the required fonts are downloaded and installed in the user’s ~/.local/share/fonts directory. Additionally, the font cache is updated to reflect the changes.

A consequential change has been made to the tab_data TOML file to integrate the new functionality and ensure smooth operation across the platform.

Key Features:

  • Users can select multiple fonts from a displayed list with scroll functionailty via less.
  • Fonts are downloaded from the latest NerdFonts GitHub release.
  • The font cache is automatically updated after installation.

Testing

  • Ran the script to verify correct downloading and installation of multiple fonts.
  • Verified that the font cache updates properly and fonts are available for use.
  • Tested the TOML changes for integration with the current configuration.

Impact

This feature will allow users to easily install and manage NerdFonts, reducing manual download and installation time. There are no new dependencies outside the standard utilities (curl, tar,less) except that of fc-cache from fontconfig.

Issue related to PR

  • Resolves #160
  • Resolve #308
  • Resolve #309

Additional Information

No additional information at this time.

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.

fam007e avatar Sep 17 '24 14:09 fam007e

No way to scroll here when the terminal with linutil is smaller

image

adamperkowski avatar Sep 17 '24 14:09 adamperkowski

The script should also check if fontconfig is installed.

adamperkowski avatar Sep 17 '24 14:09 adamperkowski

I'm sorry but I cannot approve 100% LLM generated PRs. You need to rewrite the code yourself.

adamperkowski avatar Sep 17 '24 14:09 adamperkowski

No way to scroll here when the terminal with linutil is smaller

image

I used my 15" laptop and I also think even if it's 14" or 13" its okay so how can you make it posix compliant and fit it in within the scope i.e. having to add scroll functionality is beyond my level of understanding... So forgive me I can NOT accomplish that task.

fam007e avatar Sep 17 '24 14:09 fam007e

how can you make it posix compliant and fit it in within the scope i.e. having to add scroll functionality is beyond my level of understanding...

You can use printf with read (#282) or just craft a string and more it.

adamperkowski avatar Sep 17 '24 14:09 adamperkowski

The script should also check if fontconfig is installed.

Shouldn't I add check for fc-cache command instead.

fam007e avatar Sep 17 '24 15:09 fam007e

Shouldn't I add check for fc-cache command instead.

You should check if fontconfig exists in the system. If not, install it.

You can do command_exists fc-cache and if not, install fontconfig.

adamperkowski avatar Sep 17 '24 15:09 adamperkowski

Shouldn't I add check for fc-cache command instead.

You should check if fontconfig exists in the system. If not, install it.

You can do command_exists fc-cache and if not, install fontconfig.

I think the issue with that is if debian has other utility which installs fontconfig.

fam007e avatar Sep 17 '24 15:09 fam007e

Shouldn't I add check for fc-cache command instead.

You should check if fontconfig exists in the system. If not, install it.

You can do command_exists fc-cache and if not, install fontconfig.

May be the "and if not" part be actually implemented in common-script rather than in individual cases like this... 🤔

fam007e avatar Sep 17 '24 15:09 fam007e

I think the issue with that is if debian has other utility which installs fontconfig.

You can use

case $PACKAGER in
apt|nala)
    # debian stuff
    ;;
...

adamperkowski avatar Sep 17 '24 15:09 adamperkowski

@fam007e Draft this with #447 & #448 for now. Chris is supposed to be streaming soon.

adamperkowski avatar Sep 17 '24 15:09 adamperkowski

@fam007e Draft this and #447 for now. Chris is supposed to be streaming soon.

I had another one of using cli to setup ssh to github along with nerdfonts and bootloader-switcher. These three were made into 1 PR. However, one maintainer suggested to do three separate so I had to use Claude LLM to write the PRs' text as I am quite busy this week. Sorry about all that. 🙏

fam007e avatar Sep 17 '24 15:09 fam007e