-
Notifications
You must be signed in to change notification settings - Fork 471
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FEAT] Truncate field in format #1043
Comments
Please test the dev branch |
@CarterLi This works great! I just have one slight request that I didn't think about in the original issue. For example: $ ./fastfetch -l none -s command --command-text 'echo 12345 67890' --command-format 'output({1})'
Command: output(12345 67890)
$ ./fastfetch -l none -s command --command-text 'echo 12345 67890' --command-format 'output({1:6})'
Command: output(12345)
$ ./fastfetch -l none -s command --command-text 'echo 12345 67890' --command-format 'output({1:-6})'
Command: output(12345…)
$ ./fastfetch -l none -s command --command-text 'echo 12345 67890' --command-format 'output({:6})'
Command: output(12345)
$ ./fastfetch -l none -s command --command-text 'echo 12345 67890' --command-format 'output({:-6})'
Command: output(12345…)
$ ./fastfetch -l none -s command --command-text 'echo 12345 67890' --command-format 'output({:0})'
Command: output()
$ ./fastfetch -l none -s command --command-text 'echo 12345 67890' --command-format 'output({:})'
Command: output() I don't see any usecase in which someone would want the field to sometimes end in a space, depending on where it truncated. |
White spaces can be used for aligning texts |
@CarterLi wouldn't one want these to be hard coded into the format string then? rather than generated from the truncated fields? |
Wanted features:
I would like to be able to truncate format fields to arbitrary lengths.
For example, this could be implemented like this
format: "{1:10}"
which would display the first 10 characters of field 1.Thoughts:
...
)?format: "{:10}"
)?Motivation:
I'd like to be able to shorten very long hardware names (in order to avoid wrapped lines in smaller terminals), such as Sound cards, Cameras, and Cpus.
For an example of this issue. This is shown without the logo, but when the logo is displayed and a terminal is tiled across half the screen, then the text in each line will wrap, interrupting the logo:
> fastfetch -s monitor:cpu:gpu:sound:camera -l none Monitor (AUO20EC): 1366x768 px - 344x193 mm (15.53 inches, 100.91 ppi) CPU: 11th Gen Intel(R) Core(TM) i5-1135G7 (8) @ 4.20 GHz GPU: Intel Iris Xe Graphics @ 1.30 GHz [Integrated] Sound: Tiger Lake-LP Smart Sound Technology Audio Controller Speaker (13%) Camera: HP TrueVision HD Camera: HP Tru - sRGB (640x360 px)
While modifying
format
strings can fix some of these issues, very long hardware names (likeTiger Lake-LP Smart Sound Technology Audio Controller Speaker
) are impossible to fix without removing the information or writing a COMMAND module.Why this should be added to the format specs
media
module.The text was updated successfully, but these errors were encountered: