summaryrefslogtreecommitdiffstats
path: root/.local/bin/dmsearch
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2021-03-16 17:47:12 +0100
committerJozanLeClerc <bousset.rudy@gmail.com>2021-03-16 17:47:12 +0100
commit0c1d116be593ee45a3040879e2c5b608789b7ef4 (patch)
treed7eae0ca124be75529f1a32e30f87104932276f6 /.local/bin/dmsearch
parentBrowser fix (diff)
downloaddotfiles-bsd-0c1d116be593ee45a3040879e2c5b608789b7ef4.tar.gz
dotfiles-bsd-0c1d116be593ee45a3040879e2c5b608789b7ef4.tar.bz2
dotfiles-bsd-0c1d116be593ee45a3040879e2c5b608789b7ef4.tar.xz
dotfiles-bsd-0c1d116be593ee45a3040879e2c5b608789b7ef4.tar.zst
dotfiles-bsd-0c1d116be593ee45a3040879e2c5b608789b7ef4.zip
New script
Diffstat (limited to '.local/bin/dmsearch')
-rwxr-xr-x.local/bin/dmsearch28
1 files changed, 28 insertions, 0 deletions
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__