mirror of
https://github.com/foo-dogsquared/dotfiles.git
synced 2025-01-31 04:57:57 +00:00
Update some scripts
This commit is contained in:
parent
b542f9f3b8
commit
5d1f441194
@ -3,4 +3,4 @@
|
|||||||
# Based from Luke Smith's prompt script.
|
# Based from Luke Smith's prompt script.
|
||||||
# https://github.com/LukeSmithxyz/voidrice/blob/master/.local/bin/prompt
|
# https://github.com/LukeSmithxyz/voidrice/blob/master/.local/bin/prompt
|
||||||
|
|
||||||
([ "$(printf "No\\nYes" | rofi -dmenu -p "$1")" = "Yes" ] && $2) || notify-send "The command "$2" failed to execute."
|
[ "$(printf "No\\nYes" | rofi -dmenu -p "$1")" = "Yes" ] && $2
|
||||||
|
@ -29,8 +29,8 @@ Usage: $0 [-o/--output <OUTPUT_PATH>] [-s/--select]
|
|||||||
Options:
|
Options:
|
||||||
--help - show the help section
|
--help - show the help section
|
||||||
-s, --select - set the screenshot capture to selection mode
|
-s, --select - set the screenshot capture to selection mode
|
||||||
-d, --delay <SECONDS> - set a delay for the capture
|
-d, --delay <SECONDS> - set a delay for the capture (in <SECONDS> seconds)
|
||||||
(in <SECONDS> seconds)
|
-c, --cursor - superimposes the cursor in the image
|
||||||
-o, --output <OUTPUT_PATH> - set the output path for the picture;
|
-o, --output <OUTPUT_PATH> - set the output path for the picture;
|
||||||
when given no output, the picture will
|
when given no output, the picture will
|
||||||
be moved to \$PICTURES_DIRECTORY (or
|
be moved to \$PICTURES_DIRECTORY (or
|
||||||
@ -57,13 +57,14 @@ do
|
|||||||
OUTPUT="$2"
|
OUTPUT="$2"
|
||||||
shift
|
shift
|
||||||
shift;;
|
shift;;
|
||||||
|
-c|--cursor)
|
||||||
|
CURSOR=1
|
||||||
|
shift;;
|
||||||
*)
|
*)
|
||||||
shift;;
|
shift;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
set -- "${POSITIONAL[@]}" # restore positional parameters
|
|
||||||
|
|
||||||
if [[ -n "$OUTPUT" ]]; then
|
if [[ -n "$OUTPUT" ]]; then
|
||||||
pic_filepath=$OUTPUT
|
pic_filepath=$OUTPUT
|
||||||
else
|
else
|
||||||
@ -98,6 +99,11 @@ if [[ $DELAY -gt 0 ]]; then
|
|||||||
notify-send "Delayed screenshot" "A delayed screenshot is about to be taken in $DELAY seconds." --expire-time=$(( ($DELAY * 1000) - 1000 ))
|
notify-send "Delayed screenshot" "A delayed screenshot is about to be taken in $DELAY seconds." --expire-time=$(( ($DELAY * 1000) - 1000 ))
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Checking if the cursor option is disabled.
|
||||||
|
if [[ $CURSOR -ne 1 ]]; then
|
||||||
|
maim_command+="--hidecursor "
|
||||||
|
fi
|
||||||
|
|
||||||
$($maim_command)
|
$($maim_command)
|
||||||
|
|
||||||
if [[ $? != 0 ]]; then
|
if [[ $? != 0 ]]; then
|
||||||
|
Loading…
Reference in New Issue
Block a user