#!/usr/bin/python3 # Maintainer: Alexander Mcmillan # Imported Modules import os # native OS support import shutil # high-level file operations support import glob # support globbing * import time # sleep/wake command support import sys # import sytem functions # Golbal Variables linvstfileso="/usr/share/LinVst/64bit-32bit/linvst.so" # the linvst.so bridge file for the linvst bridge homedir=os.path.expanduser("~") # expand the current users home directory /home/ vstdir=(homedir + "/" + ".vst" + "/") # DAW scanned VST directory currentdir=os.getcwd() + "/" # get the current work directory # Executable Code print ("\033[1;38m" + "Start LinVst Bridge Creation" + "\033[0m") # print start message os.makedirs(vstdir, exist_ok=True) # create a /home// directory for i in glob.glob("*.dll"): # check for all files with a .dll extension vstname, extdll=os.path.splitext(i) # split the filename from its extension, store each value in a seperate variable extso=(".so") # the destination exstension .so for Linux DAW compatibility shutil.copy2(linvstfileso, vstname + extso) # copy the linvst.so bridge file to match the vstname .dll file. example: plugin.dll, plugin.so print("\033[1;33m" + vstname + ": " + "\033[1;36m" + "Link Generated..." + "\033[0m") # print the .so link to be generated if os.path.islink(vstdir + vstname + extso): # Check if link exists os.remove(vstdir + vstname + extso) # remove old link for vst bridge os.symlink(currentdir + vstname + extso, vstdir + vstname + extso) # generate link for vst bridge else: os.symlink(currentdir + vstname + extso, vstdir + vstname + extso) # generate link for vst bridge time.sleep(0.5) # sleep for half a second