Added gnvim and spawn scripts.

in-use
Emily Frost 7 years ago
parent fcf73d03a1
commit 31c6eafb29
No known key found for this signature in database
GPG Key ID: FD1FA524668FB1FA

@ -0,0 +1,6 @@
#!/usr/bin/env bash
# Just a quick ugly script to keep nvim-qt's window size.
# This also redirects error messages because of a bug in nvim-qt.
nvim-qt --geometry 1000x500 "$@" 2> /dev/null

@ -0,0 +1,2 @@
#!/bin/sh
nohup kitty "$@" > /dev/null &

@ -31,6 +31,7 @@ if [ "$1" = "-u" ]; then
else else
vm_name="$1" vm_name="$1"
mountpoint="${MOUNTPOINT_PARENT}/${vm_name}.vm" mountpoint="${MOUNTPOINT_PARENT}/${vm_name}.vm"
awk_script="/${vm_name}/ && split(\$5, a, \"/\"){ print a[1] }"
if [ -z "${vm_name}" ]; then if [ -z "${vm_name}" ]; then
echo "Virtual machine name not provided." echo "Virtual machine name not provided."
@ -44,18 +45,17 @@ else
echo "Waiting for ${vm_name} to connect to the network..." echo "Waiting for ${vm_name} to connect to the network..."
vm_ip_address="" vm_ip_address=""
# TODO: Consider using a sleep here? # TODO: Exit if this failes or times out.
# TODO: This needs a proper timeout.
while [ "${vm_ip_address}" = "" ]; do while [ "${vm_ip_address}" = "" ]; do
virsh_line="" vm_ip_address="$(virsh net-dhcp-leases "${NETWORK_NAME}" | awk "${awk_script}")"
virsh_line="$(virsh net-dhcp-leases "${NETWORK_NAME}" | grep "${vm_name}") > /dev/null"
if [ "${virsh_line}" != "" ]; then
vm_ip_address="$(echo "${virsh_line}" | sed "s/\\( \\)*/\\1/g" | cut -d " " -f6 | cut -d "/" -f1)"
fi
done done
# TODO: Exit if this fails.
# TODO: Make sure this directory isn't made if the vm fails to start or connect. # TODO: Make sure this directory isn't made if the vm fails to start or connect.
mkdir -p "${mountpoint}" mkdir -p "${mountpoint}"
# TODO: Exit if this failes or times out.
# TODO: This needs a proper timeout. # TODO: This needs a proper timeout.
echo "Attempting to mount over ssh." echo "Attempting to mount over ssh."
until sshfs "${vm_ip_address}:${REMOTE_DIRECTORY}" "${mountpoint}"; do until sshfs "${vm_ip_address}:${REMOTE_DIRECTORY}" "${mountpoint}"; do

Loading…
Cancel
Save