From 082f5a06a46c2f4eb3860daa68887712c609ac77 Mon Sep 17 00:00:00 2001 From: Joe Date: Thu, 26 Dec 2024 16:53:50 +0100 Subject: up --- .local/bin/dmbook | 38 -------------------------------------- .local/bin/dmbookm | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 38 deletions(-) delete mode 100755 .local/bin/dmbook create mode 100755 .local/bin/dmbookm diff --git a/.local/bin/dmbook b/.local/bin/dmbook deleted file mode 100755 index 4aa8738..0000000 --- a/.local/bin/dmbook +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env perl - -use strict; -use warnings; -use Sys::Hostname; - -use constant { - BROWSER => '/bin/firefox', - HOSTNAME => (split /\./, hostname()) -}; - -sub main -{ - my $choice; - my $url; - my $pid; - my $prefix; - - $prefix = '/usr'; - if (HOSTNAME eq "mars") { - $prefix += '/local'; - } - $choice = `printf "" | dmenu -i -m 0 -p 'Search:'`; - if (not $choice) { - return; - } - $choice =~ s/ /+/g; - $url = 'https://www.startpage.com/sp/search?q=' . $choice; - $pid = fork(); - if (not $pid) { - exec($prefix . BROWSER, $url); - } - return; -} - -main(); - -__END__ diff --git a/.local/bin/dmbookm b/.local/bin/dmbookm new file mode 100755 index 0000000..4aa8738 --- /dev/null +++ b/.local/bin/dmbookm @@ -0,0 +1,38 @@ +#!/usr/bin/env perl + +use strict; +use warnings; +use Sys::Hostname; + +use constant { + BROWSER => '/bin/firefox', + HOSTNAME => (split /\./, hostname()) +}; + +sub main +{ + my $choice; + my $url; + my $pid; + my $prefix; + + $prefix = '/usr'; + if (HOSTNAME eq "mars") { + $prefix += '/local'; + } + $choice = `printf "" | dmenu -i -m 0 -p 'Search:'`; + if (not $choice) { + return; + } + $choice =~ s/ /+/g; + $url = 'https://www.startpage.com/sp/search?q=' . $choice; + $pid = fork(); + if (not $pid) { + exec($prefix . BROWSER, $url); + } + return; +} + +main(); + +__END__ -- cgit v1.2.3