minor edits
This commit is contained in:
parent
346fbd6653
commit
293c4b9965
2 changed files with 34 additions and 12 deletions
42
hyprshot.sh
42
hyprshot.sh
|
@ -6,6 +6,30 @@
|
|||
command -v "$@" >/dev/null 2>&1
|
||||
}
|
||||
|
||||
# ─< package variable >───────────────────────────────────────────────────────────────────
|
||||
unset PACKAGE
|
||||
|
||||
# ─< argument list variables >────────────────────────────────────────────────────────────
|
||||
silent=false
|
||||
|
||||
sleep 0.1
|
||||
|
||||
PACKAGE=hyprshot
|
||||
if command_exists "$PACKAGE"; then
|
||||
echo "$PACKAGE is already installed!"
|
||||
echo "Exiting now!"
|
||||
exit 69
|
||||
fi
|
||||
|
||||
# ─< parse arguments and get variable contents >──────────────────────────────────────────
|
||||
for arg in "$@"; do
|
||||
case "$arg" in
|
||||
--silent | -s)
|
||||
export silent=true
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
# WHY:
|
||||
# This import will give you the following variables:
|
||||
# _sudo="sudo -E" <- only if non root user
|
||||
|
@ -75,6 +99,14 @@
|
|||
}
|
||||
|
||||
main() {
|
||||
if $silent; then
|
||||
echo_warning "Executing script silently!"
|
||||
fi
|
||||
|
||||
if ! getDependencies; then
|
||||
echo_error "Error when installing dependencies.."
|
||||
fi
|
||||
|
||||
case "$distro" in
|
||||
arch)
|
||||
_install hyprshot
|
||||
|
@ -97,16 +129,6 @@
|
|||
}
|
||||
|
||||
if getImports; then
|
||||
case "$@" in
|
||||
--silent | -s)
|
||||
silent=true
|
||||
echo_warning "Running script silently!"
|
||||
;;
|
||||
*)
|
||||
silent=false
|
||||
;;
|
||||
esac
|
||||
getDependencies
|
||||
main </dev/tty
|
||||
fi
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue