-
Notifications
You must be signed in to change notification settings - Fork 10
/
.functions
54 lines (43 loc) · 1.53 KB
/
.functions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/usr/bin/env bash
ANDROID_EMULATOR_NIX_FOLDER="$DOTFILES/nix/android"
ANDROID_EMULATOR_CONFIG_FILE="$HOME/.android/avd/device.avd/config.ini"
function android-emulator() {
cd $ANDROID_EMULATOR_NIX_FOLDER
if [ ! -f "$ANDROID_EMULATOR_CONFIG_FILE" ]; then
nix-build "$ANDROID_EMULATOR_NIX_FOLDER/emulator.nix"
$DOTFILES/nix/android/result/bin/run-test-emulator & pidsave=$!
sleep 10
kill $pidsave
ln -sf "$DOTFILES/nix/android/emulator-config.ini" "$ANDROID_EMULATOR_CONFIG_FILE"
fi
nix-build "$ANDROID_EMULATOR_NIX_FOLDER/emulator.nix"
$DOTFILES/nix/android/result/bin/run-test-emulator
}
function unity-apk-install() {
adb connect $DEVICE_IP &&
sleep 2 &&
adb -s $DEVICE_IP uninstall com.gregcodes.$1 &&
adb -s $DEVICE_IP install ~/games-dev/apks/$1.apk &&
adb -s $DEVICE_IP shell am start -n com.gregcodes.$1/com.unity3d.player.UnityPlayerActivity
}
# Miband
function miband-build() {
TZ=Europe/Berlin wine ~/Documents/MiBand/MiBandWFTool_1.4.1/PaletteImageMode/WatchFace.exe $1
}
function miband-watch() {
inotifywait -m -e close_write *.png $1 |
while read -r filename event; do
if [ ${#filename} -eq 8 ] || [ "$filename" = "$1" ]; then
miband-build *.json
fi
done
}
# Raspberry
PI_IP="192.168.1.29"
function midi-to-pi() {
scp "$1" pi@$PI_IP:/home/pi/Piano-LED-Visualizer/Songs/"$2"
}
function midi-from-pi() {
scp pi@$PI_IP:/home/pi/Piano-LED-Visualizer/Songs/"$1" "$2"
}
source $HOME/.gregflix-functions 2> /dev/null