aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rw-r--r--bin/.gitignore1
-rw-r--r--bin/Makefile3
-rwxr-xr-xbin/askpass4
-rwxr-xr-xbin/beep1
-rwxr-xr-xbin/cloogle_stats.py35
-rwxr-xr-xbin/docker-rm-untagged-images2
-rwxr-xr-xbin/dualmon4
-rwxr-xr-xbin/i3status.py72
-rwxr-xr-xbin/kbdbacklight19
-rw-r--r--bin/kbdlayout.c54
-rwxr-xr-xbin/lxc-setup20
-rwxr-xr-xbin/newws2
-rwxr-xr-xbin/nowplaying2
-rwxr-xr-xbin/passmenu26
-rwxr-xr-xbin/pylint.sh19
l---------bin/setbg1
-rwxr-xr-xbin/setbg-pgfplots22
-rwxr-xr-xbin/setbg-texample46
-rwxr-xr-xbin/singlemon4
19 files changed, 0 insertions, 337 deletions
diff --git a/bin/.gitignore b/bin/.gitignore
deleted file mode 100644
index 95d9967..0000000
--- a/bin/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-kbdlayout
diff --git a/bin/Makefile b/bin/Makefile
deleted file mode 100644
index 221dde7..0000000
--- a/bin/Makefile
+++ /dev/null
@@ -1,3 +0,0 @@
-kbdlayout: kbdlayout.c
- $(CC) $(CCFLAGS) -lX11 $< -o $@
-
diff --git a/bin/askpass b/bin/askpass
deleted file mode 100755
index dfa595a..0000000
--- a/bin/askpass
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/bash
-p=$(echo -e "GETPIN\nBYE\n" | pinentry | grep D)
-echo "${p:2}"
-
diff --git a/bin/beep b/bin/beep
deleted file mode 100755
index edd6b63..0000000
--- a/bin/beep
+++ /dev/null
@@ -1 +0,0 @@
-echo -en "\a" > /dev/tty5
diff --git a/bin/cloogle_stats.py b/bin/cloogle_stats.py
deleted file mode 100755
index 0c48b70..0000000
--- a/bin/cloogle_stats.py
+++ /dev/null
@@ -1,35 +0,0 @@
-#!/usr/bin/env python3
-import json
-import ssl
-import websocket
-
-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(format_query(json.loads(msg)))
- except:
- pass
-
-def on_error(ws, err):
- print(err)
-
-def on_close(ws):
- print('Closed.')
-
-if __name__ == '__main__':
- ws = websocket.WebSocketApp('wss://cloogle.org:31216',
- subprotocols=['cloogle-stats'],
- on_message=on_message, on_error=on_error, on_close=on_close)
- ws.run_forever(sslopt={'cert_reqs': ssl.CERT_NONE})
diff --git a/bin/docker-rm-untagged-images b/bin/docker-rm-untagged-images
deleted file mode 100755
index 2b4c73b..0000000
--- a/bin/docker-rm-untagged-images
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/bin/bash
-docker rmi $(docker images | grep '<none>' | awk '{print $3}')
diff --git a/bin/dualmon b/bin/dualmon
deleted file mode 100755
index 02ae65d..0000000
--- a/bin/dualmon
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/bash
-xrandr --output eDP1 --below HDMI2 --primary --output HDMI2 --auto
-xinput disable Atmel
-setbg
diff --git a/bin/i3status.py b/bin/i3status.py
deleted file mode 100755
index 1e00e62..0000000
--- a/bin/i3status.py
+++ /dev/null
@@ -1,72 +0,0 @@
-#!/usr/bin/env python
-import json
-from select import select
-from subprocess import Popen, PIPE
-import sys
-
-def remove_empty_outputs(obj):
- return [o for o in obj if o['full_text'].strip() != '']
-
-first = True
-def print_i3stat(j):
- global first
- j = remove_empty_outputs(j)
- sys.stdout.write(('' if first else ',') + json.dumps(j) + '\n')
- sys.stdout.flush()
- first = False
-
-def parse_i3stat(s):
- if s[0] == ',':
- s = s[1:]
- j = json.loads(s)
- return j
-
-def parse_kbdlayout(s):
- colors = { 'us(intl)' : '#66ccff',
- 'us(dvorak-intl)' : '#dc68fc',
- 'ru(phonetic)' : '#ff3300',
- 'il(biblicalSIL)' : '#66ff66'
- }
- return [{'full_text': s, 'color': colors[s]}]
-
-def parse_cloogle(s):
- return [{'full_text': s}]
-
-def merge_status_items(*args):
- return [item for sublist in args for item in sublist]
-
-if __name__ == '__main__':
- timeout = 0.1
-
- # open subprocesses
- i3stat = Popen(['i3status'], stdout=PIPE, bufsize=1, close_fds=True)
- kbdlayout = Popen(['unbuffer', 'kbdlayout'],
- stdout=PIPE, bufsize=1, close_fds=True)
- cloogle = Popen(['unbuffer', 'cloogle_stats.py'],
- stdout=PIPE, bufsize=1, close_fds=True)
-
- # skip i3status header
- sys.stdout.write(i3stat.stdout.readline())
- sys.stdout.write(i3stat.stdout.readline())
-
- stat, kbd, clg = [], [], []
- try:
- stdouts = [p.stdout for p in [i3stat, kbdlayout, cloogle]]
- while True:
- fs = select(stdouts, [], [])[0]
- for f in fs:
- line = f.readline()[:-1]
- if f == kbdlayout.stdout:
- kbd = parse_kbdlayout(line)
- elif f == cloogle.stdout:
- clg = parse_cloogle(line)
- elif f == i3stat.stdout:
- stat = parse_i3stat(line)
-
- print_i3stat(merge_status_items(kbd, clg, stat))
-
- except Exception, e:
- print(e)
- i3stat.kill()
- kbdlayout.kill()
- cloogle.kill()
diff --git a/bin/kbdbacklight b/bin/kbdbacklight
deleted file mode 100755
index f8d1e02..0000000
--- a/bin/kbdbacklight
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/bin/sh
-FILE="/sys/class/leds/asus::kbd_backlight/brightness"
-SETTING=`cat "$FILE"`
-COMMAND="$1"
-
-if [ "$COMMAND" = "set" ]; then
- echo $2 > "$FILE"
-elif [ "$COMMAND" = "up" ]; then
- echo "$(($SETTING+1))" > "$FILE"
-elif [ "$COMMAND" = "down" ]; then
- if [ "$SETTING" != "0" ]; then
- echo "$(($SETTING-1))" > "$FILE"
- fi
-elif [ "$COMMAND" = "party" ]; then
- while :; do
- $0 set 0; sleep 1; $0 set 3; sleep 1
- done
-fi
-
diff --git a/bin/kbdlayout.c b/bin/kbdlayout.c
deleted file mode 100644
index bb030bb..0000000
--- a/bin/kbdlayout.c
+++ /dev/null
@@ -1,54 +0,0 @@
-#include <X11/XKBlib.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-
-char* getActiveLayout(char* names, unsigned char active) {
- int i;
- for (i = 0; names[i]; i++) {
- if (names[i] == '+') {
- if (active <= 0) {
- int j = ++i;
- for (; names[j] && names[j] != '+' && names[j] != ':'; j++);
- char* ret = malloc(j - i + 1);
- strncpy(ret, names + i, j - i);
- ret[j - i] = '\0';
- return ret;
- } else {
- active--;
- }
- }
- }
- return NULL;
-}
-
-int main(void) {
- int evCode, errRet, rsnRet;
- int maj = XkbMajorVersion;
- int min = XkbMinorVersion;
-
- Display* disp = XkbOpenDisplay("", &evCode, &errRet, &maj, &min, &rsnRet);
-
- // State
- XkbStatePtr state = calloc(1, sizeof(XkbStateRec));
- XkbGetState(disp, 0x100, state);
-
- // Names
- XkbDescPtr desc = XkbAllocKeyboard();
- XkbGetNames(disp, XkbSymbolsNameMask, desc);
-
- Atom symNameAtom = desc->names->symbols;
- char* layouts = XGetAtomName(disp, symNameAtom);
-
- printf("%s\n", getActiveLayout(layouts, state->group));
-
- unsigned int mask = XkbStateNotifyMask;
- XkbSelectEvents(disp, XkbUseCoreKbd, mask, mask);
-
- XkbEvent event;
- while (1) {
- XNextEvent(disp, &event.core);
- if (event.state.changed & 0x90)
- printf("%s\n", getActiveLayout(layouts, event.state.group));
- }
-}
diff --git a/bin/lxc-setup b/bin/lxc-setup
deleted file mode 100755
index 08824a8..0000000
--- a/bin/lxc-setup
+++ /dev/null
@@ -1,20 +0,0 @@
-# https://wiki.debian.org/LXC
-# https://lists.linuxcontainers.org/pipermail/lxc-devel/2014-February/008088.html
-# https://lists.debian.org/debian-user/2015/05/msg00162.html
-# https://wiki.debian.org/LXC/SimpleBridge
-# http://box.matto.nl/lxconlaptop.html
-# https://coderwall.com/p/k0gutq/clean-lxc-nat-configuration-debian-wheezy
-
-for d in /sys/fs/cgroup/*
-do
- f=$(basename $d)
- echo "looking at $f"
- if [ "$f" = "cpuset" ]; then
- echo 1 | sudo tee -a $d/cgroup.clone_children;
- elif [ "$f" = "memory" ]; then
- echo 1 | sudo tee -a $d/memory.use_hierarchy;
- fi
- sudo mkdir $d/$USER
- sudo chown -R $USER: $d/$USER
- echo $$ > $d/$USER/tasks
-done
diff --git a/bin/newws b/bin/newws
deleted file mode 100755
index 386b353..0000000
--- a/bin/newws
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/bin/sh
-i3-msg workspace $(($(i3-msg -t get_workspaces | tr , '\n' | grep '"num":' | cut -d : -f 2 | sort -rn | head -1) + 1))
diff --git a/bin/nowplaying b/bin/nowplaying
deleted file mode 100755
index 650e6e8..0000000
--- a/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/bin/passmenu b/bin/passmenu
deleted file mode 100755
index 9b5239d..0000000
--- a/bin/passmenu
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/usr/bin/env bash
-
-shopt -s nullglob globstar
-
-typeit=0
-if [[ $1 == "--type" ]]; then
- typeit=1
- shift
-fi
-
-prefix=${PASSWORD_STORE_DIR-~/.password-store}
-password_files=( "$prefix"/**/*.gpg )
-password_files=( "${password_files[@]#"$prefix"/}" )
-password_files=( "${password_files[@]%.gpg}" )
-
-password=$(printf '%s\n' "${password_files[@]}" | dmenu "$@")
-
-[[ -n $password ]] || exit
-
-if [[ $typeit -eq 0 ]]; then
- pass show -c "$password" 2>/dev/null
-else
- pass show "$password" |
- awk 'BEGIN{ORS=""} {print; exit}' |
- xdotool type --clearmodifiers --file -
-fi
diff --git a/bin/pylint.sh b/bin/pylint.sh
deleted file mode 100755
index 546f8c8..0000000
--- a/bin/pylint.sh
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/bin/bash
-PYMAJOR=$1
-
-if [ "$1" = "--version" ]
-then
- pylint --version
- return
-fi
-
-if [[ "$PYMAJOR" != "2" ]] && [[ "$PYMAJOR" != "3" ]]
-then
- PYMAJOR=2
- grep '#!.*python3' "${@: -1}" >/dev/null && PYMAJOR=3
-fi
-
-echo "Using python$PYMAJOR"
-
-/usr/bin/env "python$PYMAJOR" -m pylint "${@:2}"
-
diff --git a/bin/setbg b/bin/setbg
deleted file mode 120000
index d445e5c..0000000
--- a/bin/setbg
+++ /dev/null
@@ -1 +0,0 @@
-setbg-texample \ No newline at end of file
diff --git a/bin/setbg-pgfplots b/bin/setbg-pgfplots
deleted file mode 100755
index 7343f35..0000000
--- a/bin/setbg-pgfplots
+++ /dev/null
@@ -1,22 +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"
-
-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/bin/setbg-texample b/bin/setbg-texample
deleted file mode 100755
index ee996d3..0000000
--- a/bin/setbg-texample
+++ /dev/null
@@ -1,46 +0,0 @@
-#!/bin/bash
-
-SCR_WIDTH=1980
-SCR_HEIGHT=1080
-PADDING=50
-FONT_SIZE=20
-
-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://texample.net
-if [ $? -ne 0 ]; then fail; fi
-
-let "SCR_WIDTH -= 2 * $PADDING"
-let "SCR_WIDTH /= 2"
-let "SCR_HEIGHT -= 2 * $PADDING"
-
-PAGE=$RANDOM; let "PAGE %= 22"; let "PAGE += 1"
-
-# Fetch list of texamples
-cd /tmp
-wget -qO texample.html "http://texample.net/tikz/examples/all/?page=$PAGE"
-if [ $? -ne 0 ]; then fail; fi
-
-EXAMPLES="$(grep '^<dl' texample.html | wc -l)"
-awk -v n=0 "BEGIN{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 writelatex | sed "s/.*<a href=\"\(.*\)\">TEX<\/a>.*/\1/")"
-
-echo $PDF $TEX
-
-wget -qO- "http://texample.net$PDF" | convert -size "x$SCR_HEIGHT" -density 300 - /tmp/bg.png
-wget -qO- "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.png "/tmp/bg-$PAGE.png"
-rm /tmp/bg{,-src}.png
-if [ $? -ne 0 ]; then fail; fi
-
-feh -B white --bg-max "/tmp/bg-$PAGE.png"
-
diff --git a/bin/singlemon b/bin/singlemon
deleted file mode 100755
index 8034639..0000000
--- a/bin/singlemon
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/bash
-xrandr --output eDP1 --primary --auto --output HDMI2 --off
-xinput enable Atmel
-setbg