From 10abac3a8216f2d201bf22648fcffafa5440e954 Mon Sep 17 00:00:00 2001 From: LordMathis Date: Tue, 12 Jun 2018 15:10:25 +0200 Subject: [PATCH] Use libsecret to hide API key --- bin/openweathermap-simple.sh | 2 +- bin/setup.sh | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100755 bin/setup.sh diff --git a/bin/openweathermap-simple.sh b/bin/openweathermap-simple.sh index 6f050aa..122b211 100755 --- a/bin/openweathermap-simple.sh +++ b/bin/openweathermap-simple.sh @@ -24,7 +24,7 @@ get_icon() { echo $icon } -KEY="" +KEY=`secret-tool lookup openweathermap api_key` CITY="" UNITS="metric" SYMBOL="°" diff --git a/bin/setup.sh b/bin/setup.sh new file mode 100755 index 0000000..aeff3c4 --- /dev/null +++ b/bin/setup.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +echo "Enter OpenWeatherMap API key" +read line +echo $line | secret-tool store --label='OpenWeatherMap API Key' openweathermap api_key +secret-tool lookup openweathermap api_key