From a659106248bdf63841ec19efdae210f684f25bd8 Mon Sep 17 00:00:00 2001 From: Keanu Date: Sat, 30 Jan 2021 14:17:07 +0100 Subject: [PATCH] [scripts/copy-env-var] Script to copy envvars. --- scripts/copy-env-var | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100755 scripts/copy-env-var diff --git a/scripts/copy-env-var b/scripts/copy-env-var new file mode 100755 index 0000000..9a4d88d --- /dev/null +++ b/scripts/copy-env-var @@ -0,0 +1,11 @@ +#!/usr/bin/env bash +set -euo pipefail + +if variable="$(set -euo pipefail; { + awk 'BEGIN{for(v in ENVIRON) print v}' +} | rofi -dmenu)" && [[ -n $variable ]]; then + + variable="${variable%% *}" + + echo ${!variable} | xclip -sel clip +fi