~skiqqy/bin

2ffbd75ac95a0d869b3394ea2e4214ec321bacea — Stephen Cochrane 2 months ago c095477
init of copy
1 files changed, 51 insertions(+), 0 deletions(-)

A copy
A copy => copy +51 -0
@@ 0,0 1,51 @@
#!/usr/bin/env bash
# Simple xclip X dmenu script
scriptname="$(basename "$0")"

usage()
{
	cat << EOF
$scriptname ~ Simple copy buffer
EOF
	exit "${1:-0}"
}

main()
{
	buffer='/tmp/copy.buffer'

	while getopts hb: opt
	do
		case "$opt" in
			b)
				buffer="$OPTARG"
				[ ! -f "$buffer" ] && printf 'WARN: %s DNE!\n' "$buffer" && return 1
				;;
			h)
				usage
				;;
			*)
				usage 1
				;;
		esac
	done
	shift "$((OPTIND-1))"

	# TODO.

	local com
	com="$1"
	shift 1

	case "$com" in
		'')
			usage
			;;
		*)
			printf 'Unknown Command: %s\n' "$com"
			usage 1
			;;
	esac
}

main "$@"