renew.sh
This commit is contained in:
parent
d9bd69fc27
commit
37736cf4e6
|
@ -1,16 +1,11 @@
|
|||
#!/bin/bash
|
||||
# shellcheck source=./distrohopper.conf
|
||||
|
||||
export LC_ALL=C
|
||||
|
||||
echo "Updating VMs..."
|
||||
# distrohopper config file
|
||||
# config path
|
||||
CONFIG_DIR="$HOME/.config/distrohopper"
|
||||
source "$CONFIG_DIR/distrohopper.conf"
|
||||
# shellcheck source=distrohopper.conf
|
||||
# remove desktop files (ready to run VMs)
|
||||
rm -r "$CONFIG_DIR/ready"
|
||||
mkdir "$CONFIG_DIR/ready"
|
||||
source "$CONFIG_DIR"/distrohopper.conf
|
||||
# Renew VMs
|
||||
renew_ready() {
|
||||
echo "Updating VMs..."
|
||||
# Enter ditrohopper VMs dir
|
||||
cd "$VMS_DIR" || exit
|
||||
# check for VMs .conf files (ready to run VMs)
|
||||
|
@ -38,10 +33,9 @@ Categories=System;Virtualization;"
|
|||
# create desktop files (ready to run VMs)
|
||||
echo "$desktop_file_content" > "$CONFIG_DIR"/ready/"$vm_desktop".desktop
|
||||
done
|
||||
}
|
||||
|
||||
# remove desktop files (supported VMs)
|
||||
rm -r "$CONFIG_DIR/supported"
|
||||
mkdir "$CONFIG_DIR/supported"
|
||||
renew_supported() {
|
||||
# get supported VMs
|
||||
quickget | sed 1d | cut -d':' -f2 | grep -o '[^ ]*' > "$CONFIG_DIR/supported.md"
|
||||
while read -r get_name; do
|
||||
|
@ -63,7 +57,7 @@ while read -r get_name; do
|
|||
Type=Application
|
||||
Name=$get_name
|
||||
releases=$releases
|
||||
replace='\"!\"'
|
||||
replace=$replace
|
||||
Exec=sh -c 'cd \"$VMS_DIR\" && yad --form --field=\"Release:CB\" \"${releases// /$replace}\" | cut -d\"|\" -f1 | xargs -I{} sh -c \"quickget $get_name {}\"'
|
||||
Icon=$icon_file
|
||||
Categories=System;Virtualization;"
|
||||
|
@ -82,3 +76,9 @@ Categories=System;Virtualization;"
|
|||
echo "$desktop_file_content" > "$CONFIG_DIR"/supported/"$vm_desktop".desktop
|
||||
fi
|
||||
done < "$CONFIG_DIR"/supported.md
|
||||
}
|
||||
|
||||
renew_supported
|
||||
renew_ready
|
||||
|
||||
echo "Done"
|
||||
|
|
Loading…
Reference in New Issue