diff options
author | joe <rbo@gmx.us> | 2025-09-30 17:54:44 +0200 |
---|---|---|
committer | joe <rbo@gmx.us> | 2025-09-30 17:54:44 +0200 |
commit | 9ce4f10eeda968206bdf591b0a64a95fa41f1411 (patch) | |
tree | 668743746310033f7ebb3371c5397b2e3c7612f9 /.local/bin | |
parent | up (diff) | |
download | dotfiles-bsd-9ce4f10eeda968206bdf591b0a64a95fa41f1411.tar.gz dotfiles-bsd-9ce4f10eeda968206bdf591b0a64a95fa41f1411.tar.bz2 dotfiles-bsd-9ce4f10eeda968206bdf591b0a64a95fa41f1411.tar.xz dotfiles-bsd-9ce4f10eeda968206bdf591b0a64a95fa41f1411.tar.zst dotfiles-bsd-9ce4f10eeda968206bdf591b0a64a95fa41f1411.zip |
up
Diffstat (limited to '')
-rwxr-xr-x | .local/bin/dmbookm | 12 | ||||
-rwxr-xr-x | .local/bin/setwp | 23 |
2 files changed, 18 insertions, 17 deletions
diff --git a/.local/bin/dmbookm b/.local/bin/dmbookm index dcd0e36..9190dca 100755 --- a/.local/bin/dmbookm +++ b/.local/bin/dmbookm @@ -4,11 +4,8 @@ use strict; use warnings; use Sys::Hostname; -# debug -use Data::Dumper; - use constant { - BROWSER => '/bin/firefox', + BROWSER => 'surf', HOSTNAME => (split /\./, hostname())[0] }; @@ -47,7 +44,6 @@ sub main my $choice; my $url; my $pid; - my $prefix; my $list; my $color; @@ -55,10 +51,6 @@ sub main if (@ARGV == 1) { $color = $ARGV[0]; } - $prefix = '/usr'; - if (HOSTNAME eq "mars") { - $prefix += '/local'; - } for (sort keys %{LIST()}) { $list .= $_ . "\n"; } @@ -69,7 +61,7 @@ sub main chomp $choice; $pid = fork(); if (not $pid) { - exec($prefix . BROWSER, LIST->{$choice}); + exec(BROWSER, LIST->{$choice}); } return; } diff --git a/.local/bin/setwp b/.local/bin/setwp index 02241bd..0786461 100755 --- a/.local/bin/setwp +++ b/.local/bin/setwp @@ -76,21 +76,30 @@ sub main { my $wp; my $ret; + my $arg; - if (@ARGV != 0 && -f $ARGV[0]) { - $ret = set_wp($ARGV[0]); + $arg = 0; + if (@ARGV != 0 && $ARGV[0] eq '-nw') { + $arg = 1; } - elsif (@ARGV != 0 && -d $ARGV[0]) { - $wp = choose_wp(get_pool_files($ARGV[0])); + if (@ARGV != 0 && -f $ARGV[$arg]) { + $ret = set_wp($ARGV[$arg]); + } + elsif (@ARGV != 0 && -d $ARGV[$arg]) { + $wp = choose_wp(get_pool_files($ARGV[$arg])); $ret = set_wp($wp); } else { $wp = choose_wp(get_pool_files(WP_POOL)); $ret = set_wp($wp); } - if (@ARGV == 0 || (@ARGV != 0 && $ARGV[0] ne "-nw")) { - exec('herbe', ' wp set') if ($ret == 0); - exec('herbe', ' wp is not a valid file') if ($ret != 0); + if (@ARGV == 0 || (@ARGV != 0 && $ARGV[0] ne '-nw')) { + my $arg = fork(); + if (not $arg) { + setsid(); + exec('herbe', ' wp set') if ($ret == 0); + exec('herbe', ' wp is not a valid file') if ($ret != 0); + } } return; } |