diff options
author | Joe <rbo@gmx.us> | 2024-12-26 16:53:29 +0100 |
---|---|---|
committer | Joe <rbo@gmx.us> | 2024-12-26 16:53:29 +0100 |
commit | 157917bfed4b955a1fbc45b8e80ea92574e1cf2d (patch) | |
tree | e0efa62b367d660840d291e111ecd603c258a490 | |
parent | up (diff) | |
download | dotfiles-bsd-157917bfed4b955a1fbc45b8e80ea92574e1cf2d.tar.gz dotfiles-bsd-157917bfed4b955a1fbc45b8e80ea92574e1cf2d.tar.bz2 dotfiles-bsd-157917bfed4b955a1fbc45b8e80ea92574e1cf2d.tar.xz dotfiles-bsd-157917bfed4b955a1fbc45b8e80ea92574e1cf2d.tar.zst dotfiles-bsd-157917bfed4b955a1fbc45b8e80ea92574e1cf2d.zip |
up
-rwxr-xr-x | .local/bin/dmbook | 38 | ||||
-rwxr-xr-x | .local/bin/dmlog | 14 |
2 files changed, 45 insertions, 7 deletions
diff --git a/.local/bin/dmbook b/.local/bin/dmbook new file mode 100755 index 0000000..4aa8738 --- /dev/null +++ b/.local/bin/dmbook @@ -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__ diff --git a/.local/bin/dmlog b/.local/bin/dmlog index 73627c2..8d70ca5 100755 --- a/.local/bin/dmlog +++ b/.local/bin/dmlog @@ -16,15 +16,15 @@ use constant { HOSTNAME => (split /\./, hostname()) }; use constant LIST => [ - 'Lock screen', - 'Sleep', - 'Logout', - 'Reboot', - 'Shutdown' + 'lock screen', + 'sleep', + 'logout', + 'reboot', + 'shutdown' ]; use constant CONFIRM => [ - "No", - "Yes" + "no", + "yes" ]; sub confirm |