Skip to content

Configuration

Josh Willox edited this page Mar 1, 2021 · 12 revisions

Basic configuration

The configuration is stored at ~/.config/winfetch/config.ps1 (or $env:XDG_CONFIG_HOME/winfetch/config.ps1).

It can be overridden by using the -configpath parameter or the WINFETCH_CONFIG_PATH environment variable.

The default configuration is generated automatically if your config doesn't exist, however, you can also reset your configuration back to default by using:

winfetch -genconf

The default configuration looks like this:

# ===== WINFETCH CONFIGURATION =====

# $image = "~/winfetch.png"
# $noimage = $true

# Add a custom info line
# function info_custom_time {
#     return @{
#         title = "Time"
#         content = (Get-Date)
#     }
# }

# Configure which disks are shown
# $ShowDisks = @("C:", "D:")
# Show all available disks
# $ShowDisks = @("*")


# Remove the '#' from any of the lines in
# the following to **enable** their output.

@(
    "title"
    "dashes"
    "os"
    "computer"
    "kernel"
    "motherboard"
    # "custom_time"  # use custom info line
    "uptime"
    "pkgs"
    "pwsh"
    "resolution"
    "terminal"
    "cpu"
    "gpu"
    "memory"
    "disk"
    # "battery"
    # "local_ip"
    # "public_ip"
    "blank"
    "colorbar"
)

To disable an information field, just add a # in front of that line:

  "disk"              # ENABLED
# "battery"	      # DISABLED

Custom info segments

You can add custom info segments to your winfetch config, which you can use to provide new info or to modify the output of built-in segments.

To do this create a function prefixed with info_, this function should return a hashtable with a title and content property. Info functions can return multiple info lines by returning an array of hashtables (see the built-in info_disk function). Finally, add the function name without the info_ prefix to the segment list as shown in the example below.

function info_custom_time {
    return @{
        title = "Time"
        content = (Get-Date)
    }
}

@(
    ...
    "motherboard"
    "custom_time"  # use custom info line
    "uptime"
    ...
)
Clone this wiki locally