summaryrefslogtreecommitdiffstats
path: root/.local
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-x.local/bin/conky/weather.sh18
-rwxr-xr-x.local/bin/tmp_os.sh3
2 files changed, 20 insertions, 1 deletions
diff --git a/.local/bin/conky/weather.sh b/.local/bin/conky/weather.sh
new file mode 100755
index 0000000..273825c
--- /dev/null
+++ b/.local/bin/conky/weather.sh
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+os=$(cat /tmp/os)
+
+case $os in
+ 1)
+ ping -c1 -w1 1.1.1.1 >/dev/null 2>&1 || exit
+ ;;
+ 2)
+ ping -c1 -w1 1.1.1.1 >/dev/null 2>&1 || exit
+ ;;
+ 3)
+ ping -c1 -t1 1.1.1.1 >/dev/null 2>&1 || exit
+ ;;
+esac
+
+echo 'WEATHER ${hr}
+${font2}${color #ebdbb2}${alignc}${exec curl wttr.in/Lyon?T0 --silent --max-time 3}${font}'
diff --git a/.local/bin/tmp_os.sh b/.local/bin/tmp_os.sh
index e0fa13f..ad0be7f 100755
--- a/.local/bin/tmp_os.sh
+++ b/.local/bin/tmp_os.sh
@@ -1,5 +1,6 @@
#!/bin/sh
+tmpfile=/tmp/os
os="$(uname)"
if [ "$os" = "Linux" ]; then
@@ -10,4 +11,4 @@ else
echo "unknown OS"
exit 1
fi
-echo $os >$tmpfile
+echo -n $os >$tmpfile