Merge pull request #51 from siddheshgunjal/main

Added custom fastfetch config (Similar to yours)
This commit is contained in:
Chris Titus
2024-06-28 20:02:21 -05:00
committed by GitHub
2 changed files with 93 additions and 0 deletions

86
config.jsonc Normal file
View File

@@ -0,0 +1,86 @@
{
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
"logo": {
"type": "builtin",
"color":
{
"1": "white",
"2": "cyan"
}
},
"display": {
"separator": "  ",
"color": "cyan"
},
"modules": [
{
"type": "custom", // HardwareStart
"format": "┌─────────── \u001b[1mHardware Information\u001b[0m ───────────┐" // `\u001b` is `\033`, or `\e`
},
{
"type": "host",
"key": " 󰌢"
},
{
"type": "cpu",
"key": " "
},
{
"type": "gpu",
"key": " "
},
{
"type": "display",
"key": " 󱄄"
},
{
"type": "memory",
"key": " "
},
{
"type": "custom", // SoftwareStart
"format": "├─────────── \u001b[1mSoftware Information\u001b[0m ───────────┤"
},
{
"type": "os",
"key": " " // Just get your distro's logo off nerdfonts.com,
},
{
"type": "kernel",
"key": " ",
"format": "{1} {2}"
},
{
"type": "wm",
"key": " "
},
{
"type": "shell",
"key": " "
},
{
"type": "custom",
"format": "|────────────────────\u001b[1mUptime / Age\u001b[0m────────────────────|"
},
{
"type": "command",
"key": " OS Age ",
"keyColor": "magenta",
"text": "birth_install=$(stat -c %W /); current=$(date +%s); time_progression=$((current - birth_install)); days_difference=$((time_progression / 86400)); echo $days_difference days"
},
{
"type": "uptime",
"key": " Uptime ",
"keyColor": "magenta"
},
{
"type": "custom", // InformationEnd
"format": "└────────────────────────────────────────────┘"
},
{
"type": "colors",
"paddingLeft": 2,
"symbol": "circle"
}
]
}

View File

@@ -189,6 +189,10 @@ install_additional_dependencies() {
esac
}
create_fastfetch_config() {
fastfetch --gen-config
}
linkConfig() {
## Get the correct user home directory.
USER_HOME=$(getent passwd ${SUDO_USER:-$USER} | cut -d: -f6)
@@ -206,6 +210,8 @@ linkConfig() {
## Make symbolic link.
ln -svf ${GITPATH}/.bashrc ${USER_HOME}/.bashrc
ln -svf ${GITPATH}/starship.toml ${USER_HOME}/.config/starship.toml
echo -e "${YELLOW}Linking custom fastfetch config file...${RC}"
ln -svf ${GITPATH}/config.jsonc ${USER_HOME}/.config/fastfetch/config.jsonc
}
checkEnv
@@ -213,6 +219,7 @@ installDepend
installStarship
installZoxide
install_additional_dependencies
create_fastfetch_config
if linkConfig; then
echo -e "${GREEN}Done!\nRestart your shell to see the changes.${RC}"