Skip to content

Instantly share code, notes, and snippets.

@drandarov-io
Last active July 5, 2024 18:26
Show Gist options
  • Save drandarov-io/438facdb538b17b6b3229e42b514da15 to your computer and use it in GitHub Desktop.
Save drandarov-io/438facdb538b17b6b3229e42b514da15 to your computer and use it in GitHub Desktop.
# ===== WINFETCH CONFIGURATION =====
# https://gist.github.com/assets/13102251/3f80c619-0142-4499-8477-fd5ec7297ac4
$image = "$($USERPATHS.config)/winfetch.png"
# $noimage = $true
# Display image using ASCII characters
$ascii = $true
# Set the version of Windows to derive the logo from.
# $logo = "Windows 10"
# Specify width for image/logo
$imgwidth = $ascii ? 58 : 52
# Specify minimum alpha value for image pixels to be visible
# $alphathreshold = 50
# Custom ASCII Art
# This should be an array of strings, with positive
# height and width equal to $imgwidth defined above.
# $CustomAscii = @(
# "⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢠⣾⣿⣦⠀ ⠀"
# "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢠⣶⣶⣾⣷⣶⣆⠸⣿⣿⡟⠀ ⠀"
# "⠀⠀⠀⠀⠀⠀⠀⠀⣠⣾⣷⡈⠻⠿⠟⠻⠿⢿⣷⣤⣤⣄⠀⠀ ⠀"
# "⠀⠀⠀⠀⠀⠀⠀⣴⣿⣿⠟⠁⠀⠀⠀⠀⠀⠀⠈⠻⣿⣿⣦⠀ ⠀"
# "⠀⠀⠀⢀⣤⣤⡘⢿⣿⡏⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢹⣿⣿⡇ ⠀"
# "⠀⠀⠀⣿⣿⣿⡇⢸⣿⡁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢈⣉⣉⡁ ⠀"
# "⠀⠀⠀⠈⠛⠛⢡⣾⣿⣇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣸⣿⣿⡇ ⠀"
# "⠀⠀⠀⠀⠀⠀⠀⠻⣿⣿⣦⡀⠀⠀⠀⠀⠀⠀⢀⣴⣿⣿⠟⠀ ⠀"
# "⠀⠀⠀⠀⠀⠀⠀⠀⠙⢿⡿⢁⣴⣶⣦⣴⣶⣾⡿⠛⠛⠋⠀⠀ ⠀"
# "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⠿⠿⢿⡿⠿⠏⢰⣿⣿⣧⠀⠀ ⠀"
# "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⢿⣿⠟⠀⠀ ⠀"
# )
# Make the logo blink
# $blink = $true
# Display all built-in info segments.
# $all = $true
# Add a custom info line
function info_custom_time {
return @{
title = "Time"
content = (Get-Date -Format "dddd, dd MMMM yyyy HH:mm:ss.fff")
}
}
function info_custom_weather {
$uri = "https://wttr.in/Braunschweig"
return @{
title = "Weather"
content = try {
$wttr = (Invoke-RestMethod -TimeoutSec 1 "$uri`?format=`"%t+-+%C+(%l)`"").TrimStart("+")
$wttr.StartsWith("Unknown") ? "wttr.in is down" : "`e]8;;$uri`a$wttr`e]8;;`a"
} catch {
"$e[91m(Network Error)"
}
}
}
# Configure which disks are shown
$ShowDisks = @("C:", "D:", "E:", "X:", "Y:", "P:", "W:")
# Show all available disks
# $ShowDisks = @("*")
# Configure which package managers are shown
# disabling unused ones will improve speed
# $ShowPkgs = @("winget", "scoop", "choco")
# Use the following option to specify custom package managers.
# Create a function with that name as suffix, and which returns
# the number of packages. Two examples are shown here:
# $CustomPkgs = @("cargo", "just-install")
# function info_pkg_cargo {
# return (cargo install --list | Where-Object {$_ -like "*:" }).Length
# }
# function info_pkg_just-install {
# return (just-install list).Length
# }
# Configure how to show info for levels
# Default is for text only.
# 'bar' is for bar only.
# 'textbar' is for text + bar.
# 'bartext' is for bar + text.
# $cpustyle = 'textbar'
$memorystyle = 'bartext'
$diskstyle = 'bartext'
# $batterystyle = 'bartext'
# 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
"custom_time"
"uptime"
# "ps_pkgs" # takes some time
# "pkgs"
"pwsh"
"resolution"
"terminal"
# "theme"
"cpu"
"gpu"
# "cpu_usage"
"memory"
"disk"
# "battery"
"locale"
# "weather"
"custom_weather"
# "local_ip"
# "public_ip"
"blank"
"colorbar"
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment