dotfiles/scripts/copy-env-var

12 lines
234 B
Text
Raw Normal View History

2021-06-23 10:05:59 +00:00
#!/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