From 16895af7988aaf53b0dcbeb19c598f601ba2773c Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Thu, 5 Dec 2019 16:09:52 -0600 Subject: [PATCH] Helpful bins --- bin/archive | 5 +++++ bin/clip | 5 +++++ bin/unarchive | 9 +++++++++ 3 files changed, 19 insertions(+) create mode 100755 bin/archive create mode 100755 bin/clip create mode 100755 bin/unarchive diff --git a/bin/archive b/bin/archive new file mode 100755 index 0000000..db48fa9 --- /dev/null +++ b/bin/archive @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +archive_name="${1}"; shift +tar czvf "${archive_name}.tar.gz" ${@} +echo "Archive created at: ${archive_name}" diff --git a/bin/clip b/bin/clip new file mode 100755 index 0000000..cf5e0d7 --- /dev/null +++ b/bin/clip @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +xclip -selection primary +xclip -selection primary -out | xclip -selection clipboard +xclip -selection primary -out | xclip -selection secondary diff --git a/bin/unarchive b/bin/unarchive new file mode 100755 index 0000000..6b64366 --- /dev/null +++ b/bin/unarchive @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +archive_name="${1}"; shift +to_dir="$(basename $archive_name)" +mkdir -p "${to_dir}" +pushd "${to_dir}" +tar xzvf "${archive_name}" +echo "Unarchived to: ${to_dir}" +popd