Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Feature Request: Align printout on separator #2064

Open
Jame5 opened this issue Mar 2, 2022 · 1 comment
Open

Feature Request: Align printout on separator #2064

Jame5 opened this issue Mar 2, 2022 · 1 comment

Comments

@Jame5
Copy link

Jame5 commented Mar 2, 2022

Description

I was wondering if it would be possible to align the printout of the title: value output on the separator? It tends to make things a bit easier to parse going down the list if there is a clean line between title and value.

I am attaching a rudimentary bash example to show a possible solution. I'm sure there is a smarter way to do this. But this was the quickest way I could find to show an example of the desired output.

Neofetch version

Neofetch 7.0.0

Screenshot

current output:
image

example desired output:
image

Possible fix

Example code:

cat padding.sh
#!/bin/bash

# Get longest Title
LONGEST_TITLE=`awk '{ if (length($0) > max) {max = length($0); maxline = $0} } END { print length(maxline) }' $1`

# Basic padding is $LONGEST_TITLE number of spaces
PADDING=`printf '%0.s ' $(seq 1 $LONGEST_TITLE)`
for title in `cat $1`; do
  printf "%s%s: details here\n" "${PADDING:${#title}}" $title
done

Example inputs:

cat somefile
OS
Kernel
Uptime
Packages
Shell
Theme
Icons
Terminal
CPU
GPU
Memory

Example output:

./padding.sh somefile
      OS: details here
  Kernel: details here
  Uptime: details here
Packages: details here
   Shell: details here
   Theme: details here
   Icons: details here
Terminal: details here
     CPU: details here
     GPU: details here
  Memory: details here
@NervousNullPtr
Copy link

I'd love this. My current Neofetch just... doesn't look clean with the different beginnings of the info.
image

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants