dotfiles/scripts/copy-env-var

12 lines
234 B
Text
Raw Normal View History

#!/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