-
Notifications
You must be signed in to change notification settings - Fork 0
/
customfetch
6 lines (6 loc) · 1.66 KB
/
customfetch
1
2
3
4
5
6
{
"name": "customfetch",
"description": "provides (customizable) info about your Typer system. Fork of webfetch",
"author": "grosik",
"executeit": "async (data) => { let d = stringReplaceVars('$global-customfetch-data'); let img = stringReplaceVars('$global-customfetch-image'); if(!img || !d) return `You have not set ${!d&&!img ? 'any data' : (!d ? 'the data' : 'the image')} for <b>customfetch</b>.<br>Please set those variables (if the text is green it means the variable is set):<br><span class=\"${!img ? 'red' : 'green'}\">global-customfetch-image</span>: (string) customfetch image<br><span class=\"${!d ? 'red' : 'green'}\">global-customfetch-data</span>: (string) data to show in customfetch<br>Data placeholders:<br>[browser] - the browser you are using<br>[packages] - the packages installed from TCM<br>[prefix] - your command prefix<br>[pcos] - your\\'s PC operating system<br>{nls} - the start of the line<br>{nle} - the end of the line`; return '<img src=\"'+stringReplaceVars(`$global-customfetch-image`)+`\" style=\"display: inline-block; border: solid ${placeholders['{fetch}'] ? placeholders['{fetch}'] : placeholders['{white}']} 2px; min-height: 7vw; min-width: 7vw; border-radius: 22px;\"> <div style=\"display: inline-block; margin-left: 0vw; margin-top: 1.5vh; vertical-align:top;\">`+stringReplaceVars(`$global-customfetch-data`).replaceAll(`[browser]`, fetch_browser()).replaceAll(`[packages]`, await fetch_packages()).replaceAll(`[prefix]`, prefix).replaceAll(`[pcos]`, fetch_system()).replaceAll('{nls}', '<span style=\"display: block;\"></span>').replaceAll('{nle}', '</span>').replaceAll('{nl}', '<span style=\"display: block;\"></span>')+'</div>' }"
}