improved ifinstalled
and made noisereduce
use it (#930)
* made noisereduce executable * improved `ifinstalled` script * made `noisereduce` use `ifinstalled` script * quoting for quiet shellcheck
This commit is contained in:
parent
f16713bcf7
commit
4231d6bd33
2 changed files with 7 additions and 5 deletions
|
@ -6,6 +6,8 @@
|
||||||
# various other scripts for clarity's sake.
|
# various other scripts for clarity's sake.
|
||||||
|
|
||||||
for x in "$@";do
|
for x in "$@";do
|
||||||
pacman -Qq "$x" >/dev/null 2>&1 ||
|
notify() { notify-send "📦 $x" "must be installed for this function." && exit 1 ;}
|
||||||
{ notify-send "📦 $x" "must be installed for this function." && exit 1 ;}
|
which_out="$( /usr/bin/which "$x" >/dev/null 2>&1 )" && exit 0 #you might have compiled the prog, and not install the repo pkg...
|
||||||
|
pkgname="$(pacman -Qqo "$which_out" >/dev/null 2>&1 )" #...thats why two variables.
|
||||||
|
pacman -Qq "$pkgname" >/dev/null 2>&1 || notify
|
||||||
done
|
done
|
||||||
|
|
4
.local/bin/noisereduce
Normal file → Executable file
4
.local/bin/noisereduce
Normal file → Executable file
|
@ -7,8 +7,8 @@ usage ()
|
||||||
}
|
}
|
||||||
|
|
||||||
# Tests for requirements
|
# Tests for requirements
|
||||||
ffmpeg -version >/dev/null || { echo >&2 "We require 'ffmpeg' but it's not installed. Install it by 'sudo apt-get install ffmpeg' Aborting."; exit 1; }
|
ifinstalled ffmpeg || { echo >&2 "We require 'ffmpeg' but it's not installed."; exit 1; }
|
||||||
sox --version >/dev/null || { echo >&2 "We require 'sox' but it's not installed. Install it by 'sudo apt-get install sox' Aborting."; exit 1; }
|
ifinstalled sox || { echo >&2 "We require 'ffmpeg' but it's not installed."; exit 1; }
|
||||||
|
|
||||||
if [ "$#" -ne 2 ]
|
if [ "$#" -ne 2 ]
|
||||||
then
|
then
|
||||||
|
|
Loading…
Reference in a new issue