ublue-os / bazzite

Bazzite is a custom image built upon Fedora Atomic Desktops that brings the best of Linux gaming to all of your devices - including your favorite handheld.
https://bazzite.gg
Apache License 2.0
3.63k stars 212 forks source link

Improvement of fastfetch configuration #1190

Open CarterLi opened 3 months ago

CarterLi commented 3 months ago

https://github.com/ublue-os/bazzite/blob/ebaa187b5ca99b8bbd47a7ddcbf34844aed2ea5a/system_files/desktop/shared/usr/etc/profile.d/bazzite-neofetch.sh#L1-L4

--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 commented 3 months ago

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 commented 3 months ago

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 commented 3 months ago

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 commented 3 months ago

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)"