From bbfba0e1d4cae7552c86546923ceaaf3673074e0 Mon Sep 17 00:00:00 2001 From: Cveinnt <30604389+Cveinnt@users.noreply.github.com> Date: Thu, 12 May 2022 23:52:15 +0800 Subject: [PATCH] adding search functions --- src/utils/bin/commands.ts | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/utils/bin/commands.ts b/src/utils/bin/commands.ts index 66443c9..338c9f8 100644 --- a/src/utils/bin/commands.ts +++ b/src/utils/bin/commands.ts @@ -70,6 +70,27 @@ export const linkedin = async (args: string[]): Promise => { 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 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(' ')}...`; +}; + // Typical linux commands export const echo = async (args: string[]): Promise => { return args.join(' ');