Skip to content
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

Improvement of fastfetch configuration #1190

Open
CarterLi opened this issue May 31, 2024 · 4 comments
Open

Improvement of fastfetch configuration #1190

CarterLi opened this issue May 31, 2024 · 4 comments

Comments

@CarterLi
Copy link

CarterLi commented May 31, 2024

alias neofetch='/usr/bin/fastfetch -c /usr/share/ublue-os/bazzite/fastfetch.jsonc --logo-color-1 94 --logo-color-2 47 --logo-color-3 95 --logo-color-4 0 --logo-color-5 8 --logo-color-6 55'
alias neowofetch='/usr/bin/fastfetch -c /usr/share/ublue-os/bazzite/fastfetch.jsonc --logo-color-1 94 --logo-color-2 47 --logo-color-3 95 --logo-color-4 0 --logo-color-5 8 --logo-color-6 55'
alias hyfetch='/usr/bin/fastfetch -c /usr/share/ublue-os/bazzite/fastfetch.jsonc --logo-color-1 94 --logo-color-2 47 --logo-color-3 95 --logo-color-4 0 --logo-color-5 8 --logo-color-6 55'
alias fastfetch='/usr/bin/fastfetch -c /usr/share/ublue-os/bazzite/fastfetch.jsonc --logo-color-1 94 --logo-color-2 47 --logo-color-3 95 --logo-color-4 0 --logo-color-5 8 --logo-color-6 55'

--logo-color-1 94 --logo-color-2 47 --logo-color-3 95 --logo-color-4 0 --logo-color-5 8 --logo-color-6 55 can be put into config file

{
  "logo": {
    "color": {
      "1": "94",
      "2": "47",
      "3": "95",
      "4": "0",
      "5": "8",
      "6": "55"
    }
  }
}

IDE may report JSON validation errors. Just ignore them.


"shell": "/bin/bash" should be unnecessary. Fastfetch defaults to "/bin/sh" which is a symlink to "/bin/bash" on Fedora


        {
            "type": "command",
            "key": " 󰾰",
            "text": "cat /sys/devices/virtual/dmi/id/product_name",
            "shell": "/bin/bash"
        }

This is what host module does. I wonder why do you manually do it


        {
            "type": "command",
            "key": " 󰔠",
            "text": "ls -alct /|tail -1|awk '{print $6, $7, $8}'",
            "shell": "/bin/bash"
        }

Seems to be probematic. ls -alct /|tail -1 shows dr-xr-xr-x 427 root root 0 1970年 1月 1日 proc so that ls -alct /|tail -1|awk '{print $6, $7, $8}' will show 1970年 1月 1日 which means 1/1/1970 in English.

stat / | tail -1 should be better. Alternatively,

    {
      "type": "disk",
      "key": "OS Installation Time",
      "folders": "/",
      "format": "{create-time}"
    }

can be used

@KyleGospo
Copy link
Member

KyleGospo commented May 31, 2024

Hi there! Thanks for the suggestions. It's greatly appreciated.

I implemented some of these changes already, but a couple need further adjustment. Using disk and {create-time} is echoing the literal string {create-time} for me.

As for the change to stat / | tail -1, on our system this shows the last time the system was updated instead of the install date. Quirk of the ostree model.

Our reasoning for manually specifying /bin/bash was due to chsh changing the /bin/sh symlink, but our scripts already specify bash where needed so I went ahead and removed those lines.

@CarterLi
Copy link
Author

Using disk and {create-time} is echoing the literal string {create-time} for me.

It a new syntax added in the newly released fastfetch. It prints result of stat / | tail -1. Just ignore it

@CarterLi
Copy link
Author

CarterLi commented Jun 1, 2024

Another suggestion:

Instead of aliasing fastfetch to fastfetch -c /some/config/file, put the config file into /etc/fastfetch/config.jsonc.

fastfetch searches the config file in the order of fastfetch --list-config-paths. The global config /etc/fastfetch/config.jsonc has the lowest priority. So that if people want to have their own fastfetch config, they simply create one in ~/.config/fastfetch/config.jsonc and it will override the global one.

@zebh
Copy link

zebh commented Jun 2, 2024

ls is not recommended to be used in pipes or parsed by anyone other than humans as far as I know.

This seems to give the same result and should always be in ISO date format:
date -I -d"$(stat -c '%w' /sysroot)"

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

No branches or pull requests

3 participants