This is a collection of dotfiles and scripts for my bspwm setup
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

57 lines
1.1 KiB

#!/bin/sh
emacs() {
# Create new frame if (there isnt one || no file specified)
if [ -z "$(pgrep emacsclient)" ] || [ "$1" = "" ]; then
emacsclient -a '' -c "$@" > /dev/null 2>&1 &
else
emacsclient -a '' "$@" > /dev/null 2>&1 &
fi
}
6 years ago
depend() {
pactree -u -d 1 "$1" | tail -n +2 | sort
6 years ago
}
java_doc() {
6 years ago
mkdir -p './doc';
javadoc -d './doc' -- *.java
6 years ago
}
java_run () {
6 years ago
mkdir -p './out';
javac -d './out' "$1.java";
java -cp './out' "$1"
}
raspbian() {
sudo systemctl start avahi-daemon.service
if ! ip a show usb0 | grep -q 'inet6'; then
sudo dhcpcd usb0
fi
ssh -6 pi@"$(avahi-resolve-host-name raspberrypi.local | awk '{ print $2 }')"%usb0
6 years ago
sudo systemctl stop avahi-daemon.service
}
# $1 = find, $2 = list, $3 = list separator
in_list() {
[ -z "$1" ] || [ -z "$2" ] && return 1
if ! echo "$2" | awk -v m="^$1$" -v RS="${3:-' '}" '$0 ~ m { exit 1 }'; then
return 0
else
return 1
fi
}
pastebin() {
echo "$1" | curl -F 'f:1=<-' ix.io
}
stream() {
[ -z "$2" ] && QUALITY="720p" || QUALITY="$2"
streamlink --player mpv "https://twitch.tv/$1" "$QUALITY" > /dev/null 2>&1 &
}
6 years ago
"$@"