DistroHopper/quickgui

33 lines
1.3 KiB
Bash
Executable File

#!/bin/bash
version="0.2"
# DEBUG mod
#bash -x quickyad 2>&1 | tee output.log
# YAD gui script using Forked excellent quickemu
#TODO Add homepages to right click
echo "Running..."
# dependencies checks
if ! command -v yad >/dev/null 2>&1; then
echo "You are missing yad..." >&2
exit 1
fi
# generate random key for yad (for connecting tabs in notebook together)
key=$((RANDOM % 9000 + 1000))
# set current dir as QUICKEMU_VMS_DIR
#QUICKEMU_VMS_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
# distrohopper config file
CONFIG_DIR="$HOME/.config/distrohopper"
source "$CONFIG_DIR/distrohopper.conf"
# show YAD notebook
yad --plug="$key" --tabnum=1 --icons --listen --read-dir="$CONFIG_DIR"/vms_ready --sort-by-name --no-buttons --borders=0 --icon-size=48 --item-width=76 &
yad --plug="$key" --tabnum=2 --icons --listen --read-dir="$CONFIG_DIR"/vms_supported --sort-by-name --no-buttons --borders=0 --icon-size=48 --item-width=76 &
yad --plug="$key" --tabnum=3 --icons --listen --read-dir="$CONFIG_DIR" --sort-by-name --no-buttons --borders=0 --icon-size=48 --item-width=76 &
yad --dynamic --notebook --key="$key" --width=900 --height=800 --title="DistroHopper $version" --listen --no-buttons --tab="run VM" --tab="download VM" --tab="settings"
# exit peacfully
exit 0