From 0c1d116be593ee45a3040879e2c5b608789b7ef4 Mon Sep 17 00:00:00 2001
From: JozanLeClerc <bousset.rudy@gmail.com>
Date: Tue, 16 Mar 2021 17:47:12 +0100
Subject: New script

---
 .config/vifm/vifmrc |  4 ++--
 .local/bin/dmsearch | 28 ++++++++++++++++++++++++++++
 2 files changed, 30 insertions(+), 2 deletions(-)
 create mode 100755 .local/bin/dmsearch

diff --git a/.config/vifm/vifmrc b/.config/vifm/vifmrc
index 80cbdc8..1cdbf58 100644
--- a/.config/vifm/vifmrc
+++ b/.config/vifm/vifmrc
@@ -1,5 +1,5 @@
 " vim: filetype=vifm
-source ~/.config/vifm/vifmshortcuts
+" source ~/.config/vifm/vifmshortcuts
 
 set vicmd="nvim"
 set shell=/usr/local/bin/dash
@@ -81,4 +81,4 @@ filextype *.xcf gimp %f 2>/dev/null &
 
 set vifminfo=dhistory,chistory,tui,shistory,phistory,fhistory,dirstack,registers,bookmarks,bmarks
 
-source /home/jozan/.local/packs/vifm_devicons/favicons.vifm
+" source /home/jozan/.local/packs/vifm_devicons/favicons.vifm
diff --git a/.local/bin/dmsearch b/.local/bin/dmsearch
new file mode 100755
index 0000000..68fb77c
--- /dev/null
+++ b/.local/bin/dmsearch
@@ -0,0 +1,28 @@
+#!/usr/local/bin/perl
+
+use strict;
+use warnings;
+use constant BROWSER_PATH => '/usr/local/bin/firefox';
+
+sub main
+{
+	my $choice;
+	my $url;
+	my $pid;
+
+	$choice = `printf "" | dmenu -i -m 0 -p 'Search:'`;
+	if (not $choice) {
+		return (0);
+	}
+	$choice =~ s/ /+/g;
+	$url = 'https://duckduckgo.com/?q=' . $choice;
+	$pid = fork();
+	if (not $pid) {
+		exec(BROWSER_PATH, '--kiosk', $url);
+	}
+	return (0);
+}
+
+main();
+
+__END__
-- 
cgit v1.2.3