diff options
author | Camil Staps | 2021-06-28 12:22:48 +0200 |
---|---|---|
committer | Camil Staps | 2021-06-28 12:22:48 +0200 |
commit | a73acb9b474ce77af4bc54657d32bd2714ce53ec (patch) | |
tree | 1016bbbb59b629c0e905fce3a0b464a40f6f97a2 | |
parent | Add vim settings for gas and cabal (diff) |
Cleanup binaries
-rwxr-xr-x | i3/bin/cloogle_stats.py | 50 | ||||
-rwxr-xr-x | i3/bin/nowplaying | 2 | ||||
-rwxr-xr-x | i3/bin/setbg-cloogle | 13 | ||||
-rwxr-xr-x | i3/bin/setbg-pgfplots | 24 | ||||
-rwxr-xr-x | i3/bin/setbg-texample | 40 | ||||
-rwxr-xr-x | system/bin/askpass (renamed from i3/bin/askpass) | 0 | ||||
-rwxr-xr-x | system/bin/dualmon (renamed from i3/bin/dualmon) | 0 | ||||
-rwxr-xr-x | system/bin/dualmon-dp (renamed from i3/bin/dualmon-dp) | 0 | ||||
-rwxr-xr-x | system/bin/singlemon (renamed from i3/bin/singlemon) | 0 | ||||
-rwxr-xr-x | system/bin/singlemon-dp (renamed from i3/bin/singlemon-dp) | 0 | ||||
-rwxr-xr-x | zenbook/bin/record-webcam | 7 | ||||
-rwxr-xr-x | zenbook/bin/wifi-restart | 4 |
12 files changed, 4 insertions, 136 deletions
diff --git a/i3/bin/cloogle_stats.py b/i3/bin/cloogle_stats.py deleted file mode 100755 index a572207..0000000 --- a/i3/bin/cloogle_stats.py +++ /dev/null @@ -1,50 +0,0 @@ -#!/usr/bin/env python3 -import json -import ssl -import sys -import time -import websocket - -def print_and_flush(s): - print(s) - sys.stdout.flush() - -def format_query(query): - if 'className' in query: - return 'class ' + query['className'] - elif 'typeName' in query: - return 'type ' + query['typeName'] - elif 'unify' in query: - if 'name' in query and query['name'] != '': - return query['name'] + ' :: ' + query['unify'] - else: - return ':: ' + query['unify'] - else: - return query['name'] - -def on_message(ws, msg): - try: - print_and_flush(format_query(json.loads(msg))) - except: - pass - -def on_open(ws): - print_and_flush('Opened connection.') - -def on_error(ws, err): - print_and_flush(err) - -def on_close(ws): - print_and_flush('Lost connection.') - time.sleep(3) - start() - -def start(): - ws = websocket.WebSocketApp('wss://cloogle.org:31216', - subprotocols=['cloogle-stats'], - on_message=on_message, - on_open=on_open, on_error=on_error, on_close=on_close) - ws.run_forever(sslopt={'cert_reqs': ssl.CERT_NONE}) - -if __name__ == '__main__': - start() diff --git a/i3/bin/nowplaying b/i3/bin/nowplaying deleted file mode 100755 index 650e6e8..0000000 --- a/i3/bin/nowplaying +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -cmus-remote -Q | grep '^tag \(artist\|album\|title\) ' | cut -d' ' -f 3- | tr '\n' '\t' | awk 'BEGIN { FS = "\t" } ; { print $3 " (" $2 ", " $1 ")" }'; echo -n ' ' diff --git a/i3/bin/setbg-cloogle b/i3/bin/setbg-cloogle deleted file mode 100755 index f205a80..0000000 --- a/i3/bin/setbg-cloogle +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -# Test internet -timeout 4 wget -q --spider http://cloogle.org || setbg-backup || exit 1 - -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 & diff --git a/i3/bin/setbg-pgfplots b/i3/bin/setbg-pgfplots deleted file mode 100755 index bd66b4e..0000000 --- a/i3/bin/setbg-pgfplots +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash - -SCR_WIDTH=1980 -SCR_HEIGHT=1080 -PADDING=50 -FONT_SIZE=20 - -let "SCR_WIDTH -= 2 * $PADDING" -let "SCR_WIDTH /= 2" -let "SCR_HEIGHT -= 2 * $PADDING" - -NR=$RANDOM -let "NR %= 524" - -# Test internet -timeout 4 wget -q --spider http://cloogle.org || setbg-backup || exit 1 - -wget -qO- "http://pgfplots.sourceforge.net/example_$NR.pdf" | convert -size "x$SCR_HEIGHT" -density 300 - /tmp/bg.png -wget -qO- "http://pgfplots.sourceforge.net/gallery.html" | sed -n "/example_$NR\.pdf/,/<\/div>/p" | tail -n +6 | head -n -1 | pygmentize -l latex -O font_size=$FONT_SIZE -o /tmp/bg-src.png - -montage -geometry "+$PADDING+$PADDING" /tmp/bg-src.png /tmp/bg.png "/tmp/bg-$NR.png" -rm /tmp/bg{,-src}.png - -feh -B white --bg-max "/tmp/bg-$NR.png" diff --git a/i3/bin/setbg-texample b/i3/bin/setbg-texample deleted file mode 100755 index c1968a5..0000000 --- a/i3/bin/setbg-texample +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/bash - -SCR_WIDTH=1980 -SCR_HEIGHT=1080 -PADDING=50 -FONT_SIZE=20 - -CURL="curl -s" - -# Test internet -timeout 4 wget -q --spider http://texample.net || setbg-backup || exit 1 - -let "SCR_WIDTH -= 2 * $PADDING" -let "SCR_WIDTH /= 2" -let "SCR_HEIGHT -= 2 * $PADDING" - -PAGE=$RANDOM; let "PAGE %= 22"; let "PAGE += 1" - -echo "TeXample page: http://texample.net/tikz/examples/all/?page=$PAGE" - -# Fetch list of texamples -cd /tmp -$CURL -o texample.html "http://texample.net/tikz/examples/all/?page=$PAGE" || setbg-backup || exit 1 - -EXAMPLES="$(grep '^<dl' texample.html | wc -l)" -awk -v n=0 "BEGIN{srand();n=int(rand()*$EXAMPLES)+1} /^<dl/{l++} (l==n){print} END{}" texample.html | sponge texample.html - -PDF="$(grep '\/media\/tikz\/examples\/PDF' texample.html | sed "s/.*<a href=\"\([^\"]*\)\">PDF<\/a>.*/\1/")" -TEX="$(grep '\/media\/tikz\/examples\/TEX' texample.html | grep -v overleaf | sed "s/.*<a href=\"\(.*\)\">TEX<\/a>.*/\1/")" - -echo "PDF: $PDF" -echo "TeX: $TEX" - -$CURL "http://texample.net$PDF" | convert -size "x$SCR_HEIGHT" -density 300 - /tmp/bg-page-%d.png -$CURL "http://texample.net$TEX" | sed -n '/\\begin{document}/,/\\end{document}/p' | pygmentize -l latex -O font_size=$FONT_SIZE -o /tmp/bg-src.png - -montage -geometry "+$PADDING+$PADDING" /tmp/bg-src.png /tmp/bg-page-0.png "/tmp/bg-$PAGE.png" -rm /tmp/bg-{page-*,src}.png || setbg-backup || exit 1 - -feh -B white --bg-max "/tmp/bg-$PAGE.png" diff --git a/i3/bin/askpass b/system/bin/askpass index e37b29a..e37b29a 100755 --- a/i3/bin/askpass +++ b/system/bin/askpass diff --git a/i3/bin/dualmon b/system/bin/dualmon index c14e380..c14e380 100755 --- a/i3/bin/dualmon +++ b/system/bin/dualmon diff --git a/i3/bin/dualmon-dp b/system/bin/dualmon-dp index c8de3c0..c8de3c0 100755 --- a/i3/bin/dualmon-dp +++ b/system/bin/dualmon-dp diff --git a/i3/bin/singlemon b/system/bin/singlemon index 05ccbed..05ccbed 100755 --- a/i3/bin/singlemon +++ b/system/bin/singlemon diff --git a/i3/bin/singlemon-dp b/system/bin/singlemon-dp index 82893b7..82893b7 100755 --- a/i3/bin/singlemon-dp +++ b/system/bin/singlemon-dp diff --git a/zenbook/bin/record-webcam b/zenbook/bin/record-webcam deleted file mode 100755 index 723985b..0000000 --- a/zenbook/bin/record-webcam +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh -# https://unix.stackexchange.com/q/58526/37050 -DATE="$(date +%Y-%m-%d-%H-%M-%S)" -cvlc \ - v4l2:///dev/video0:width=640:height=480 \ - :input-slave=alsa://hw:1,0 \ - --sout="#transcode{vcodec=theo,vb=2000,fps=8,acodec=vorb,ab=90,channels=1,samplerate=44100}:standard{access=file,mux=ogg,dst=$DATE.ogg}" diff --git a/zenbook/bin/wifi-restart b/zenbook/bin/wifi-restart new file mode 100755 index 0000000..e9537c6 --- /dev/null +++ b/zenbook/bin/wifi-restart @@ -0,0 +1,4 @@ +#!/bin/sh +sudo ifdown wlp2s0 +sudo ifup wlp2s0 + |