mirror of
https://github.com/AquaMorph/dotfiles.git
synced 2025-08-16 02:35:31 +00:00
Stow scripts
This commit is contained in:
27
scripts/bin/installers/bitwig-install.sh
Executable file
27
scripts/bin/installers/bitwig-install.sh
Executable file
@@ -0,0 +1,27 @@
|
||||
#! /bin/bash
|
||||
|
||||
# Automatic install script for Bitwig Studio
|
||||
|
||||
# Import library
|
||||
source $(dirname ${BASH_SOURCE[0]})/install-lib.sh
|
||||
|
||||
site='https://www.bitwig.com/download/'
|
||||
bitwig=$(searchProgramInstalled bitwig-studio)
|
||||
bitwigVersion=$(echo $bitwig | awk '{print $2;}'| filterVersion)
|
||||
urlVersion=$(curl -sL $site | grep 'Bitwig Studio' | filterVersion | head -n 1)
|
||||
url=https://downloads.bitwig.com/stable/$urlVersion/bitwig-studio-$urlVersion.deb
|
||||
|
||||
checkUptoDate Bitwig $bitwigVersion $urlVersion
|
||||
|
||||
echo Installing Bitwig Studio $urlVersion
|
||||
|
||||
# Setting up and downloading package
|
||||
downloadPackage bitwig $url $(basename $url)
|
||||
|
||||
# Converting to Fedora friendly package
|
||||
echo Creating rpm package
|
||||
package=$(sudo alien -r $(basename $url) | awk '{print $1;}')
|
||||
|
||||
# Installing package
|
||||
sudo rpm -Uvh --nodeps --force $package
|
||||
sudo ln -s /usr/lib64/libbz2.so.1.0** /usr/lib64/libbz2.so.1.0
|
49
scripts/bin/installers/blackmagic-parser.py
Normal file
49
scripts/bin/installers/blackmagic-parser.py
Normal file
@@ -0,0 +1,49 @@
|
||||
import json
|
||||
import os
|
||||
import re
|
||||
import urllib.request
|
||||
|
||||
# getJSONData returns JSON data from Blackmagic Design's website.
|
||||
def getJSONData():
|
||||
with urllib.request.urlopen('https://www.blackmagicdesign.com/api/support/us/downloads.json') as url:
|
||||
return json.loads(url.read().decode())
|
||||
|
||||
# getDownloads() returns a list of downloads.
|
||||
def getDownloads():
|
||||
return getJSONData()['downloads']
|
||||
|
||||
# getResolveStudioDownloads() returns a list of DaVinci Resolve Studio downlaods.
|
||||
def getResolveStudioDownloads():
|
||||
return [d for d in getDownloads() if 'davinci-resolve-and-fusion' in d['relatedFamilies'][0] and
|
||||
'Studio' in d['name'] and 'Resolve' in d['name']]
|
||||
|
||||
# filterOnlyLinuxSupport() filters a list of downloads to only ones that
|
||||
# support Linux.
|
||||
def filterOnlyLinuxSupport(downloads):
|
||||
return [d for d in downloads if 'Linux' in d['platforms']]
|
||||
|
||||
# getLinuxURL() returns the Linux download info.
|
||||
def getLinuxURL(download):
|
||||
return download['urls']['Linux'][0]
|
||||
|
||||
# getURLId() returns the download id.
|
||||
def getURLId(url):
|
||||
return url['downloadId']
|
||||
|
||||
# getURLVersion() returns the url version number.
|
||||
def getURLVersion(url):
|
||||
if 'Beta' in url['downloadTitle']:
|
||||
beta = re.search('Beta \d+', url['downloadTitle'])
|
||||
if beta:
|
||||
beta = re.search('\d+', beta.group()).group()
|
||||
else:
|
||||
beta = '99'
|
||||
return '{}.{}.{}.{}'.format(url['major'], url['minor'], url['releaseNum'], beta)
|
||||
|
||||
# getDownloadId() returns downlaod id hash.
|
||||
def getDownloadId(download):
|
||||
return download['id']
|
||||
|
||||
for d in filterOnlyLinuxSupport(getResolveStudioDownloads()):
|
||||
linux = getLinuxURL(d)
|
||||
print(getURLVersion(linux), getURLId(linux), getDownloadId(d))
|
28
scripts/bin/installers/dragonframe-install.sh
Executable file
28
scripts/bin/installers/dragonframe-install.sh
Executable file
@@ -0,0 +1,28 @@
|
||||
#! /bin/bash
|
||||
|
||||
# Automatic install script for Dragonframe
|
||||
|
||||
# Import library
|
||||
source $(dirname ${BASH_SOURCE[0]})/install-lib.sh
|
||||
|
||||
dragonframe=$(searchProgramInstalled dragonframe | \
|
||||
awk 'END {print $(NF-2), $(NF-1), $NF}')
|
||||
dragonframeVersion=$(echo $dragonframe | awk '{print $2;}' | filterVersion)
|
||||
url=$(curl -s https://www.dragonframe.com/downloads/ \
|
||||
-A "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:104.0) Gecko/20100101 Firefox/104.0" | \
|
||||
grep .rpm | grep downloadButton | grep downloadButton | \
|
||||
grep -io 'https://[a-z0-9+-._/]*.rpm' | head -n 1)
|
||||
urlVersion=$(echo $url | awk -F "-" '{ print $2 }')
|
||||
|
||||
# Check if installed to the most recent version
|
||||
checkUptoDate dragonframe $dragonframeVersion $urlVersion
|
||||
echo Installing Dragonframe $urlVersion
|
||||
|
||||
# Setting up and downloading package
|
||||
mkdir -p ~/Downloads/installers/dragonframe
|
||||
cd ~/Downloads/installers/dragonframe
|
||||
wget $url
|
||||
|
||||
# Install package
|
||||
sudo dnf install $(basename "$url") -y
|
||||
|
62
scripts/bin/installers/install-lib.sh
Executable file
62
scripts/bin/installers/install-lib.sh
Executable file
@@ -0,0 +1,62 @@
|
||||
# Program version number comparison.
|
||||
function versionGreater() {
|
||||
if [[ $1 == $2 ]];then
|
||||
return 0
|
||||
fi
|
||||
local IFS=.
|
||||
local i ver1=($1) ver2=($2)
|
||||
# fill empty fields in ver1 with zeros
|
||||
for ((i=${#ver1[@]}; i<${#ver2[@]}; i++)); do
|
||||
ver1[i]=0
|
||||
done
|
||||
for ((i=0; i<${#ver1[@]}; i++)); do
|
||||
if [[ -z ${ver2[i]} ]]; then
|
||||
# fill empty fields in ver2 with zeros
|
||||
ver2[i]=0
|
||||
fi
|
||||
if ((10#${ver1[i]} > 10#${ver2[i]})); then
|
||||
return 1
|
||||
fi
|
||||
if ((10#${ver1[i]} < 10#${ver2[i]})); then
|
||||
return 2
|
||||
fi
|
||||
done
|
||||
return 0
|
||||
}
|
||||
|
||||
# Check if installed to the most recent version.
|
||||
function checkUptoDate() {
|
||||
if versionGreater $2 $3; then
|
||||
echo $1 is up to date. Installed version $2 web version $3
|
||||
exit
|
||||
else
|
||||
echo Updating $1 from $2 to $3...
|
||||
fi
|
||||
}
|
||||
|
||||
# Returns installed programs with a given name.
|
||||
function searchProgramInstalled() {
|
||||
dnf list -q | grep $1
|
||||
}
|
||||
|
||||
# Filters string to Semantic Versioning.
|
||||
function filterVersion() {
|
||||
grep -Po -m 1 '\d{1,4}\.\d{1,4}\.*\d{0,4}'
|
||||
}
|
||||
|
||||
# Downloads a file to the given download directory with
|
||||
# the given name.
|
||||
function downloadPackage() {
|
||||
mkdir -p ~/Downloads/installers/${1}
|
||||
cd ~/Downloads/installers/${1}
|
||||
wget -O ${3} ${2}
|
||||
}
|
||||
|
||||
# Get package manager
|
||||
function packageManager() {
|
||||
if command -v dnf &> /dev/null; then
|
||||
echo dnf
|
||||
elif command -v apt &> /dev/null; then
|
||||
echo apt
|
||||
fi
|
||||
}
|
25
scripts/bin/installers/keeweb-install.sh
Executable file
25
scripts/bin/installers/keeweb-install.sh
Executable file
@@ -0,0 +1,25 @@
|
||||
#! /bin/bash
|
||||
|
||||
# Automatic install script for KeeWeb password manager
|
||||
|
||||
# Import library
|
||||
source $(dirname ${BASH_SOURCE[0]})/install-lib.sh
|
||||
|
||||
keeweb=$(searchProgramInstalled KeeWeb)
|
||||
keewebVersion=$(echo $keeweb | awk '{print $2;}' | filterVersion)
|
||||
url=$(curl -s https://github.com/keeweb/keeweb/releases | grep .rpm | grep -Po '(?<=href=")[^"]*.rpm'| head -n 1)
|
||||
url='https://github.com'$url
|
||||
urlVersion=$(echo $url | filterVersion | head -n 1)
|
||||
|
||||
# Check if installed to the most recent version
|
||||
checkUptoDate keeweb $keewebVersion $urlVersion
|
||||
echo Installing KeeWeb $urlVersion
|
||||
|
||||
# Setting up and downloading package
|
||||
mkdir -p ~/Downloads/installers/keeweb
|
||||
cd ~/Downloads/installers/keeweb
|
||||
wget $url
|
||||
|
||||
# Install package
|
||||
sudo dnf install $(basename $url) -y
|
||||
|
26
scripts/bin/installers/reaper-install.sh
Executable file
26
scripts/bin/installers/reaper-install.sh
Executable file
@@ -0,0 +1,26 @@
|
||||
#! /bin/bash
|
||||
|
||||
# Automatic install script for Reaper
|
||||
|
||||
# Import library
|
||||
source $(dirname ${BASH_SOURCE[0]})/install-lib.sh
|
||||
|
||||
# Get download url
|
||||
reaperVersion=$(head /opt/REAPER/whatsnew.txt | filterVersion)
|
||||
reaperSite='https://www.reaper.fm/'
|
||||
downloadPage=$(curl -s ${reaperSite}download.php)
|
||||
urlVersion=$(echo "$downloadPage" | grep -A 2 'Linux x86_64' | filterVersion)
|
||||
url=$reaperSite$(echo "$downloadPage" | grep linux_x86_64 | grep -Po '(?<=href=")[^"]*')
|
||||
|
||||
checkUptoDate Reaper $reaperVersion $urlVersion
|
||||
|
||||
# Setting up and downloading package
|
||||
downloadPackage reaper $url $(basename $url)
|
||||
|
||||
# Install Reaper. Requires user input
|
||||
tar -xf $(basename $url)
|
||||
reaperDir=reaper_linux_x86_64
|
||||
sudo sh ./$reaperDir/install-reaper.sh --install /opt --integrate-sys-desktop --usr-local-bin-symlink
|
||||
|
||||
# Delete extracted directory
|
||||
rm -rd $reaperDir
|
94
scripts/bin/installers/resolve-install.sh
Executable file
94
scripts/bin/installers/resolve-install.sh
Executable file
@@ -0,0 +1,94 @@
|
||||
#! /bin/bash
|
||||
|
||||
# Automatic install script for DaVinci Resolve
|
||||
|
||||
# Import library
|
||||
source $(dirname ${BASH_SOURCE[0]})/install-lib.sh
|
||||
|
||||
versionFile=/opt/resolve/version.txt
|
||||
|
||||
resolveVersion=$(cat /opt/resolve/docs/ReadMe.html | grep 'DaVinci Resolve Studio' | filterVersion)
|
||||
url=$(python $(dirname ${BASH_SOURCE[0]})/blackmagic-parser.py | head -n 1)
|
||||
urlVersion=$(echo $url | awk '{print $1;}')
|
||||
downloadID=$(echo $url | awk '{print $2;}')
|
||||
referId=$(echo $url | awk '{print $3;}')
|
||||
|
||||
# Check for beta
|
||||
major=$(echo $urlVersion | cut -d. -f1)
|
||||
minor=$(echo $urlVersion | cut -d. -f2)
|
||||
micro=$(echo $urlVersion | cut -d. -f3)
|
||||
beta=$(echo $urlVersion | cut -d. -f4)
|
||||
|
||||
if [ "$beta" == '99' ]; then
|
||||
packageName="DaVinci_Resolve_Studio_${major}.${minor}"
|
||||
elif [ -n "$beta" ]; then
|
||||
packageName="DaVinci_Resolve_Studio_${major}.${minor}b${beta}"
|
||||
else
|
||||
packageName="DaVinci_Resolve_Studio_${urlVersion}"
|
||||
fi
|
||||
|
||||
# Get version if beta installed
|
||||
if [ -n $resolveVersion ]; then
|
||||
resolveVersion=$(cat $versionFile)
|
||||
fi
|
||||
|
||||
checkUptoDate Resolve $resolveVersion $urlVersion
|
||||
|
||||
downloadUrl="https://www.blackmagicdesign.com/api/register/us/download/${downloadID}"
|
||||
useragent="User-Agent: Mozilla/5.0 (X11; Linux) \
|
||||
AppleWebKit/537.36 (KHTML, like Gecko) \
|
||||
Chrome/77.0.3865.75 \
|
||||
Safari/537.36"
|
||||
reqjson="{ \
|
||||
\"firstname\": \"Fedora\", \
|
||||
\"lastname\": \"Linux\", \
|
||||
\"email\": \"user@getfedora.org\", \
|
||||
\"phone\": \"919-555-7428\", \
|
||||
\"country\": \"us\", \
|
||||
\"state\": \"North Carolina\", \
|
||||
\"city\": \"Raleigh\", \
|
||||
\"product\": \"DaVinci Resolve\" \
|
||||
}"
|
||||
zipUrl="$(curl \
|
||||
-s \
|
||||
-H 'Host: www.blackmagicdesign.com' \
|
||||
-H 'Accept: application/json, text/plain, */*' \
|
||||
-H 'Origin: https://www.blackmagicdesign.com' \
|
||||
-H "$useragent" \
|
||||
-H 'Content-Type: application/json;charset=UTF-8' \
|
||||
-H "Referer: https://www.blackmagicdesign.com/support/download/${referId}/Linux" \
|
||||
-H 'Accept-Encoding: gzip, deflate, br' \
|
||||
-H 'Accept-Language: en-US,en;q=0.9' \
|
||||
-H 'Authority: www.blackmagicdesign.com' \
|
||||
-H 'Cookie: _ga=GA1.2.1849503966.1518103294; _gid=GA1.2.953840595.1518103294' \
|
||||
--data-ascii "$reqjson" \
|
||||
--compressed \
|
||||
"$downloadUrl")"
|
||||
|
||||
# Setting up and downloading package
|
||||
downloadPackage resolve $zipUrl "${packageName}.zip"
|
||||
|
||||
# Installing package
|
||||
sudo dnf install libxcrypt-compat
|
||||
unzip -o $packageName
|
||||
installerName="DaVinci_Resolve_Studio_${major}.${minor}.${micro}"
|
||||
if [ ! -f ./*${installerName}_Linux.run ]; then
|
||||
installerName="${packageName}"
|
||||
fi
|
||||
echo "Installing ./*${installerName}_Linux.run"
|
||||
chmod +x ./*${installerName}_Linux.run
|
||||
sudo ./*${installerName}_Linux.run -i -y
|
||||
|
||||
# Version number backup
|
||||
sudo echo $urlVersion > $versionFile
|
||||
|
||||
# Graphics card fix
|
||||
sudo rm /etc/OpenCL/vendors/mesa.icd
|
||||
sudo rm /etc/OpenCL/vendors/pocl.icd
|
||||
|
||||
# gLib fix
|
||||
sudo mkdir /opt/resolve/libs/_disabled
|
||||
sudo mv /opt/resolve/libs/libglib-2.0.so* /opt/resolve/libs/_disabled
|
||||
|
||||
# Keyboard mapping fix
|
||||
setxkbmap -option 'caps:super'
|
6
scripts/bin/installers/rust-install.sh
Executable file
6
scripts/bin/installers/rust-install.sh
Executable file
@@ -0,0 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Import library
|
||||
source $(dirname ${BASH_SOURCE[0]})/install-lib.sh
|
||||
|
||||
sudo $(packageManager) install rust cargo
|
41
scripts/bin/installers/superslicer-install.sh
Executable file
41
scripts/bin/installers/superslicer-install.sh
Executable file
@@ -0,0 +1,41 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Automatic install script for SuperSlicer.
|
||||
|
||||
# Import library
|
||||
source $(dirname ${BASH_SOURCE[0]})/install-lib.sh
|
||||
|
||||
function desktopFile() {
|
||||
echo 'Creating desktop file'
|
||||
echo '[Desktop Entry]' > $1
|
||||
echo "Name=${2}" >> $1
|
||||
echo 'Comment=3D printing slicer' >> $1
|
||||
echo "Exec=${3}" >> $1
|
||||
echo 'Icon=' >> $1
|
||||
echo 'Type=Application' >> $1
|
||||
echo 'Terminal=false' >> $1
|
||||
}
|
||||
|
||||
program='SuperSlicer'
|
||||
programPath="${HOME}/.local/bin/${program}.AppImage"
|
||||
programVersion=$($programPath --help | grep SuperSlicer | filterVersion)
|
||||
url=$(curl -s https://api.github.com/repos/supermerill/SuperSlicer/releases)
|
||||
urlVersion=$(echo $url | grep tag_name | filterVersion | head -n 1)
|
||||
url=$(echo "$url" | grep browser_download | grep ubuntu | head -n 1 | \
|
||||
tr -d '"'| awk '{print $2}')
|
||||
|
||||
# Check if installed to the most recent version
|
||||
checkUptoDate $program $programVersion $urlVersion
|
||||
echo Installing $program $urlVersion
|
||||
|
||||
# Setting up and downloading package
|
||||
cd $(dirname $programPath)
|
||||
rm $programPath
|
||||
wget $url -O $program.AppImage
|
||||
chmod +x $programPath
|
||||
|
||||
# Create desktop file
|
||||
desktopPath="${HOME}/.local/share/applications/${program}.desktop"
|
||||
if [ ! -f $desktopPath ]; then
|
||||
desktopFile $desktopPath $program $programPath
|
||||
fi
|
6
scripts/bin/installers/sway-install.sh
Executable file
6
scripts/bin/installers/sway-install.sh
Executable file
@@ -0,0 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Import library
|
||||
source $(dirname ${BASH_SOURCE[0]})/install-lib.sh
|
||||
|
||||
sudo $(packageManager) install sway waybar rofi mako alacritty
|
38
scripts/bin/installers/yabridge-install.sh
Executable file
38
scripts/bin/installers/yabridge-install.sh
Executable file
@@ -0,0 +1,38 @@
|
||||
#! /bin/bash
|
||||
|
||||
# Automatic install script for yabridge an audio bridge for linux.
|
||||
|
||||
# Import library
|
||||
source $(dirname ${BASH_SOURCE[0]})/install-lib.sh
|
||||
|
||||
# Install wine if not already installed
|
||||
if ! command -v wine &> /dev/null; then
|
||||
if command -v dnf &> /dev/null; then
|
||||
sudo dnf config-manager --add-repo \
|
||||
https://dl.winehq.org/wine-builds/fedora/36/winehq.repo
|
||||
fi
|
||||
sudo $(packageManager) install winehq-staging
|
||||
fi
|
||||
|
||||
program=yabridgectl
|
||||
programVersion=$(yabridgectl --version | filterVersion)
|
||||
url=$(curl -s https://api.github.com/repos/robbert-vdh/yabridge/releases | \
|
||||
grep .tar.gz | grep releases/download | \
|
||||
grep -Po 'https://[^"]*.tar.gz' | grep -v ubuntu | head -n 1)
|
||||
urlVersion=$(echo $url | filterVersion | head -n 1)
|
||||
|
||||
# Check if installed to the most recent version
|
||||
checkUptoDate $program $programVersion $urlVersion
|
||||
echo Installing $program $urlVersion
|
||||
|
||||
# Setting up and downloading package
|
||||
mkdir -p ~/Downloads/installers/${program}
|
||||
cd ~/Downloads/installers/${program}
|
||||
wget $url
|
||||
|
||||
# Install package
|
||||
tar -xvzf *${urlVersion}.tar.gz
|
||||
rm -rd ~/.local/share/yabridge
|
||||
mv ./yabridge ~/.local/share/
|
||||
sudo rm /bin/yabridgectl
|
||||
sudo ln -s ~/.local/share/yabridge/yabridgectl /bin/yabridgectl
|
9
scripts/bin/installers/zsh-install.sh
Executable file
9
scripts/bin/installers/zsh-install.sh
Executable file
@@ -0,0 +1,9 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Install and set zsh as the default shell.
|
||||
|
||||
# Import library
|
||||
source $(dirname ${BASH_SOURCE[0]})/install-lib.sh
|
||||
|
||||
sudo $(packageManager) install zsh
|
||||
chsh -s $(which zsh)
|
Reference in New Issue
Block a user