diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-11-16 15:59:43 +0100 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-11-16 15:59:43 +0100 |
commit | c6299acc2a68cef3c854978fd1a9cf699ccdb77e (patch) | |
tree | 22ba181efaa5ec7a43f4f30b2cf5054fa0b44a84 /.local/bin/linkview | |
parent | More hier(7) respectful (diff) | |
download | dotfiles-bsd-c6299acc2a68cef3c854978fd1a9cf699ccdb77e.tar.gz dotfiles-bsd-c6299acc2a68cef3c854978fd1a9cf699ccdb77e.tar.bz2 dotfiles-bsd-c6299acc2a68cef3c854978fd1a9cf699ccdb77e.tar.xz dotfiles-bsd-c6299acc2a68cef3c854978fd1a9cf699ccdb77e.tar.zst dotfiles-bsd-c6299acc2a68cef3c854978fd1a9cf699ccdb77e.zip |
Linkview update
Diffstat (limited to '.local/bin/linkview')
-rwxr-xr-x | .local/bin/linkview | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/.local/bin/linkview b/.local/bin/linkview index 50b04c5..7681c05 100755 --- a/.local/bin/linkview +++ b/.local/bin/linkview @@ -8,6 +8,7 @@ use File::Basename qw(basename); use Cwd qw(cwd); use Term::ReadKey; use Term::ANSIColor qw(colored); +use Capture::Tiny qw(capture); use constant { MPVIEW_PATH => '/home/jozan/.local/bin/mpview', @@ -80,10 +81,20 @@ sub open_link ); $ret = -1; if ($a == 2) { - $ret = system(YTDL_PATH . " -q '" . $url . "' 2>/dev/null"); + (undef, undef, $ret) = capture { + system( + YTDL_PATH, + $url + ); + }; } else { - $ret = system(FETCH_PATH . " -q '" . $url . "' 2>/dev/null"); + (undef, undef, $ret) = capture { + system( + FETCH_PATH, + $url + ); + }; } if ($ret == 0) { system( @@ -142,7 +153,12 @@ sub open_link elsif ($a == 8) { $pid = fork(); if (not $pid) { - exec(FIREFOX_PATH . ' --kiosk ' . $url . ' >/dev/null 2>&1'); + capture { + exec( + FIREFOX_PATH, + '--kiosk', + $url); + }; } } elsif ($a == 9) { |