added scripts
authorMatthew Owens <matthew@owens.tech>
Tue, 7 Jun 2022 20:11:45 +0000 (21:11 +0100)
committerMatthew Owens <matthew@owens.tech>
Tue, 7 Jun 2022 20:11:45 +0000 (21:11 +0100)
mpdf [new file with mode: 0755]
steamlaunch [new file with mode: 0755]

diff --git a/mpdf b/mpdf
new file mode 100755 (executable)
index 0000000..c3724c5
--- /dev/null
+++ b/mpdf
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+f=$1; mupdf $f & while inotifywait -e close_write $f; do pkill -HUP mupdf; done
diff --git a/steamlaunch b/steamlaunch
new file mode 100755 (executable)
index 0000000..de722c3
--- /dev/null
@@ -0,0 +1,26 @@
+#!/bin/bash
+
+STEAMDIR=~/.local/share/Steam/steamapps
+cd $STEAMDIR
+DMENU_CMD="dmenu -i -fn 'Terminus (TTF):size=12' -nb '#1c1c1c' -sb '#b35050' -nf '#b79e91' -sf '#1c1c1c'"
+
+MANIFESTS=($(find . -maxdepth 1 -name "*.acf"))
+COUNT=${#MANIFESTS[@]}
+APPIDS=($(echo ${MANIFESTS[@]} | grep -Eo "[0-9]+"))
+APPNAMES=()
+
+for ((i=0; i <COUNT; i++)); do
+       STR=$(cat ${MANIFESTS[$i]} | grep name | cut -f 4 | sed 's/"//g')
+       APPNAMES+=("$STR")
+done
+
+SELNAME=$(printf '%s\n' "${APPNAMES[@]}" | eval ${DMENU_CMD})
+
+[ -x "${SELNAME}" ] && exit
+#echo $SELNAME
+for ((i=0; i <COUNT; i++)); do
+       if [[ "${SELNAME}" = "${APPNAMES[$i]}" ]]; then
+               steam steam://rungameid/"${APPIDS[$i]}"
+               exit
+       fi
+done