From 1700199b8421b3842b841e1b3940291d04ba3ca5 Mon Sep 17 00:00:00 2001 From: Yipeng Liu Date: Tue, 23 May 2023 19:41:50 +0800 Subject: [PATCH] Customize terminal. --- config.json | 27 ++++++------- src/utils/bin/commands.ts | 82 ++++++++++++++++++++++----------------- src/utils/bin/sumfetch.ts | 12 +++--- 3 files changed, 66 insertions(+), 55 deletions(-) diff --git a/config.json b/config.json index d1fa47c..6546f12 100644 --- a/config.json +++ b/config.json @@ -1,21 +1,22 @@ { - "readmeUrl": "https://raw.githubusercontent.com/cveinnt/cveinnt/master/README.md", - "title": "LiveTerm", - "name": "John Doe", - "ascii": "liveterm", + "readmeUrl": "https://raw.githubusercontent.com/lwpie/lwpie/master/README.md", + "title": "Yipeng's Index", + "name": "Yipeng Liu", + "ascii": "Yipe.ng", "social": { - "github": "github", - "linkedin": "linkedin" + "github": "lwpie", + "phone": "15::24652" }, - "email": "contact@email.com", - "ps1_hostname": "liveterm", - "ps1_username": "visitor", - "repo": "https://github.com/Cveinnt/LiveTerm", - "resume_url": "https://upload.wikimedia.org/wikipedia/commons/c/cc/Resume.pdf", + "email": "liu@yipe.ng", + "ps1_hostname": "yipe.ng", + "ps1_username": "pwe", + "repo": "https://github.com/lwpie/LiveTerm", + "resume_url": "/cv", "donate_urls": { - "paypal": "https://paypal.me/cveinnt", - "patreon": "https://patreon.com/cveinnt" + "paypal": "KFC-CRAZY-THURSDAY", + "patreon": "VME50-THANKS" }, + "fake": "https://youtu.be/dQw4w9WgXcQ", "colors": { "light": { "background": "#FBF1C9", diff --git a/src/utils/bin/commands.ts b/src/utils/bin/commands.ts index 338c9f8..4754aec 100644 --- a/src/utils/bin/commands.ts +++ b/src/utils/bin/commands.ts @@ -31,7 +31,7 @@ export const repo = async (args: string[]): Promise => { // About export const about = async (args: string[]): Promise => { return `Hi, I am ${config.name}. -Welcome to my website! +Welcome to my terminal! More about me: 'sumfetch' - short summary. 'resume' - my latest resume. @@ -47,8 +47,8 @@ export const resume = async (args: string[]): Promise => { export const donate = async (args: string[]): Promise => { return `thank you for your interest. here are the ways you can support my work: -- paypal -- patreon +- ${config.donate_urls.paypal} +- ${config.donate_urls.patreon} `; }; @@ -60,38 +60,45 @@ export const email = async (args: string[]): Promise => { export const github = async (args: string[]): Promise => { window.open(`https://github.com/${config.social.github}/`); - return 'Opening github...'; }; -export const linkedin = async (args: string[]): Promise => { - window.open(`https://www.linkedin.com/in/${config.social.linkedin}/`); - - return 'Opening linkedin...'; -}; +// export const linkedin = async (args: string[]): Promise => { +// window.open(`https://www.linkedin.com/in/${config.social.linkedin}/`); +// return 'Opening linkedin...'; +// }; // Search -export const google = async (args: string[]): Promise => { - window.open(`https://google.com/search?q=${args.join(' ')}`); - return `Searching google for ${args.join(' ')}...`; -}; - -export const duckduckgo = async (args: string[]): Promise => { - window.open(`https://duckduckgo.com/?q=${args.join(' ')}`); - return `Searching duckduckgo for ${args.join(' ')}...`; -}; +// export const google = async (args: string[]): Promise => { +// window.open(`https://google.com/search?q=${args.join(' ')}`); +// return `Searching google for ${args.join(' ')}...`; +// }; + +// export const duckduckgo = async (args: string[]): Promise => { +// window.open(`https://duckduckgo.com/?q=${args.join(' ')}`); +// return `Searching duckduckgo for ${args.join(' ')}...`; +// }; + +// export const bing = async (args: string[]): Promise => { +// window.open(`https://bing.com/search?q=${args.join(' ')}`); +// return `Wow, really? You are using bing for ${args.join(' ')}?`; +// }; + +// export const reddit = async (args: string[]): Promise => { +// window.open(`https://www.reddit.com/search/?q=${args.join(' ')}`); +// return `Searching reddit for ${args.join(' ')}...`; +// }; -export const bing = async (args: string[]): Promise => { - window.open(`https://bing.com/search?q=${args.join(' ')}`); - return `Wow, really? You are using bing for ${args.join(' ')}?`; -}; +// Typical linux commands +export const logout = async (args: string[]): Promise => { + return `shell: logout: not login shell: use \`exit\'`; +} -export const reddit = async (args: string[]): Promise => { - window.open(`https://www.reddit.com/search/?q=${args.join(' ')}`); - return `Searching reddit for ${args.join(' ')}...`; -}; +export const exit = async (args: string[]): Promise => { + setTimeout(() => {open(`location`, '_self').close()}, 1000); + return `Connection to ${config.ps1_hostname} closed.`; +} -// Typical linux commands export const echo = async (args: string[]): Promise => { return args.join(' '); }; @@ -134,21 +141,24 @@ export const emacs = async (args?: string[]): Promise => { }; export const sudo = async (args?: string[]): Promise => { - window.open('https://www.youtube.com/watch?v=dQw4w9WgXcQ', '_blank'); // ...I'm sorry + window.open(config.fake, '_blank'); // ...I'm sorry return `Permission denied: with little power comes... no responsibility? `; }; // Banner export const banner = (args?: string[]): string => { return ` -█████ ███ ███████████ -░░███ ░░░ ░█░░░███░░░█ - ░███ ████ █████ █████ ██████ ░ ░███ ░ ██████ ████████ █████████████ - ░███ ░░███ ░░███ ░░███ ███░░███ ░███ ███░░███░░███░░███░░███░░███░░███ - ░███ ░███ ░███ ░███ ░███████ ░███ ░███████ ░███ ░░░ ░███ ░███ ░███ - ░███ █ ░███ ░░███ ███ ░███░░░ ░███ ░███░░░ ░███ ░███ ░███ ░███ - ███████████ █████ ░░█████ ░░██████ █████ ░░██████ █████ █████░███ █████ -░░░░░░░░░░░ ░░░░░ ░░░░░ ░░░░░░ ░░░░░ ░░░░░░ ░░░░░ ░░░░░ ░░░ ░░░░░ + █████ █████ ███ + ░░███ ░░███ ░░░ + ░░███ ███ ████ ████████ ██████ ████████ ███████ + ░░█████ ░░███ ░░███░░███ ███░░███ ░░███░░███ ███░░███ + ░░███ ░███ ░███ ░███░███████ ░███ ░███ ░███ ░███ + ░███ ░███ ░███ ░███░███░░░ ░███ ░███ ░███ ░███ + █████ █████ ░███████ ░░██████ ██ ████ █████░░███████ + ░░░░░ ░░░░░ ░███░░░ ░░░░░░ ░░ ░░░░ ░░░░░ ░░░░░███ + ░███ ███ ░███ + █████ ░░██████ + ░░░░░ ░░░░░░ Type 'help' to see the list of available commands. Type 'sumfetch' to display summary. diff --git a/src/utils/bin/sumfetch.ts b/src/utils/bin/sumfetch.ts index e55686e..0c36e3d 100644 --- a/src/utils/bin/sumfetch.ts +++ b/src/utils/bin/sumfetch.ts @@ -30,14 +30,14 @@ const sumfetch = async (args: string[]): Promise => { ▓▓ ▓▓▓  ▐▓▓  ▐▓▓  ▓▓   resume ▐▓▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▓ 爵 Github repo ▐▓  ▐▓ ----------- -▐▓  > L I V E T E R M ▐▓  CONTACT -▐▓  ▐▓  ${config.email} -▐▓▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▓  github.com/${config.social.github} - ▓▓ ▐▓▓  ▓▓  ▐▓▓  ▓▓   linkedin.com/in/${config.social.linkedin} +▐▓  > Y I P E . N G ▐▓  CONTACT +▐▓  ▐▓  ${config.social.phone} +▐▓▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▓  ${config.email} + ▓▓ ▐▓▓  ▓▓  ▐▓▓  ▓▓   github.com/${config.social.github} ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓  ----------- ▓▓▓  ▐▓▓  ▓▓  ▓▓▓ ▓▓▀   DONATE - ▀▓▓▄▄ ▀▓▓▄▓▓▄▓▓▓▄▄▓▓▀   ${config.donate_urls.paypal} - ▀▓▓▓▓▓▓▓▓▓▓▓▀▀   ${config.donate_urls.patreon} + ▀▓▓▄▄ ▀▓▓▄▓▓▄▓▓▓▄▄▓▓▀   ${config.donate_urls.paypal} + ▀▓▓▓▓▓▓▓▓▓▓▓▀▀   ${config.donate_urls.patreon} `; }