aboutsummaryrefslogtreecommitdiff
path: root/i3/bin/setbg-cloogle
diff options
context:
space:
mode:
authorCamil Staps2017-10-27 11:03:17 +0200
committerCamil Staps2017-10-27 11:03:17 +0200
commitf6c3f81a3b6a26f72bf48eb59898548e7239ac61 (patch)
treecd360482f66b7b5b4eb97dfd4743e6943e91d21b /i3/bin/setbg-cloogle
parentAdd install_clean (diff)
Add setbg-cloogle
Diffstat (limited to 'i3/bin/setbg-cloogle')
-rwxr-xr-xi3/bin/setbg-cloogle20
1 files changed, 20 insertions, 0 deletions
diff --git a/i3/bin/setbg-cloogle b/i3/bin/setbg-cloogle
new file mode 100755
index 0000000..64c3316
--- /dev/null
+++ b/i3/bin/setbg-cloogle
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+function fail() {
+ if [ -f ~/.bg.png ]; then
+ feh --bg-max -B white ~/.bg.png
+ fi
+ exit -1;
+}
+
+# Test internet
+timeout 4 wget -q --spider http://cloogle.org || fail
+
+stdbuf -i0 -o0 -e0 cloogle_stats.py | while read request
+do
+ if [ "$request" == "Opened connection." ] || [ "$request" == "Lost connection" ]; then
+ continue
+ fi
+ echo "$request" | pygmentize -l clean -O line_numbers=false -o /tmp/bg-cloogle.png
+ feh -B white --bg-center /tmp/bg-cloogle.png
+done &