From c09565a1e652b35b0b8a7fce40bbed282b0170ae Mon Sep 17 00:00:00 2001 From: Joe Date: Fri, 21 Jun 2024 00:23:23 +0200 Subject: up --- .local/bin/dmsearch | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to '.local/bin/dmsearch') diff --git a/.local/bin/dmsearch b/.local/bin/dmsearch index f13189d..edc91fb 100755 --- a/.local/bin/dmsearch +++ b/.local/bin/dmsearch @@ -2,14 +2,24 @@ use strict; use warnings; -use constant BROWSER_PATH => '/usr/local/bin/iridium'; +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; @@ -18,7 +28,7 @@ sub main $url = 'https://duckduckgo.com/?q=' . $choice; $pid = fork(); if (not $pid) { - exec(BROWSER_PATH, $url); + exec($prefix . BROWSER, $url); } return; } -- cgit v1.2.3