Skip to content

Commit

Permalink
feat: Add setup script (#1)
Browse files Browse the repository at this point in the history
* feat: Add setup.sh with outline of needed steps

* feat: Add distrobox commands

* feat: Enable creation of desktop launcher

* docs: Revamp setup instructions

* docs: Clarify option 1 instructions more

* docs: Fix script use command

On my main system, `./setup.sh DaVinci_Resolve_version_Linux.run` works
fine, but not on other systems I tested on. Adding `./` in front of the
argument works around this

* fix: Create /opt/resolve for app launcher

* fix: mkdir before distrobox-export
  • Loading branch information
zelikos authored Sep 6, 2023
1 parent f369634 commit 02379cb
Show file tree
Hide file tree
Showing 7 changed files with 144 additions and 2 deletions.
46 changes: 44 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,51 @@ If using an Nvidia GPU, you will also need the `nvidia-container-runtime` packag

You will also need the latest release of DaVinci Resolve from [Blackmagic's website](https://www.blackmagicdesign.com/products/davinciresolve)

## Setup
Finally, I recommend that you download the `setup.sh` script from this repository to simplify the setup process.

The long-term plan is to automate this process with a setup script or app, but for now, follow the instructions below to get DaVinci Resolve up and running on your system.
## Easy Setup

This assumes you're using the `setup.sh` script from this repository.

First, you need to make `setup.sh` executable.

### Option 1

Open a terminal, then run `chmod +x /path/to/setup.sh`

Then, `/path/to/setup.sh /path/to/DaVinci_Resolve_versionnumber_Linux.run`

### Option 2

If you're more comfortable in a GUI:

If you're using GNOME, open Files and navigate to where you downloaded the script to. In the example below, the script is in the same folder that I extracted the DaVinci Resolve download to. I recommend you do the same for ease of use, as the rest of the instructions will assume you have done so.

![](screenshots/setup_01.webp)

Right-click, and select Properties.

![](screenshots/setup_02.webp)

Then, make sure "Executable as Program" is toggled on.

![](screenshots/setup_03.webp)

Right-click on an empty spot in the folder. You should see either "Open in Console" as in the screenshot, or "Open in Terminal." Either will be fine.

![](screenshots/setup_04.webp)

In the newly-opened terminal window, enter the command below. Replace 'version' with the version of DaVinci Resolve that you are installing (see screenshot for example):

```
./setup.sh ./DaVinci_Resolve_version_Linux.run
```

![](screenshots/setup_05.webp)

Then, follow any further prompts in the installation script.

## Manual Setup

First, download DaVinci Resolve from the link above. Then, extract the archive. Open a terminal in the directory that contains the `DaVinci_Resolve_<version>_Linux.run` file (\<version\> will correspond to the version of DaVinci Resolve you downloaded).

Expand Down
Binary file added screenshots/setup_01.webp
Binary file not shown.
Binary file added screenshots/setup_02.webp
Binary file not shown.
Binary file added screenshots/setup_03.webp
Binary file not shown.
Binary file added screenshots/setup_04.webp
Binary file not shown.
Binary file added screenshots/setup_05.webp
Binary file not shown.
100 changes: 100 additions & 0 deletions setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
#!/bin/bash

use_distrobox=false

# Check that argument containing DaVinci_Resolve_version_LInux.run was provided
if [[ $1 ]]
then
# Check if distrobox is installed
if ! command -v distrobox &> /dev/null
then
# If no distrobox, check for toolbox
echo "Distrobox not found. Checking for toolbox..."
if ! command -v toolbox &> /dev/null
then
echo "Toolbox not found."
# If neither are installed, inform the user, then exit
echo "Please install either distrobox or toolbox to use this script."
exit
else
echo "Toolbox found."
# TODO: Add Toolbox support
echo "Toolbox support is currently WIP. Please use distrobox for now."
exit
fi
else
use_distrobox=true
echo "Distrobox found."
fi
else
echo "Please provide path to DaVinci Resolve installer file."
echo "e.g. ./setup.sh /path/to/folder/DaVinci_Resolve_18.1.4_linux.run"
exit
fi

# Create davincibox on user's system
echo "Setting up davincibox..."

if $use_distrobox
then
distrobox create -i ghcr.io/zelikos/davincibox:latest -n davincibox
# Start up the container now after creation,
# rather than during the later steps
distrobox enter davincibox -- echo "davincibox initialized"
else
toolbox create -i ghcr.io/zelikos/davincibox:latest -c davincibox
fi

# Extract DaVinci Resolve installer
$1 --appimage-extract
if [ $? -eq 0 ]
then
if $use_distrobox
then
distrobox enter davincibox -- sudo squashfs-root/AppRun -i -a -y
# Workaround for an issue with Resolve's included libglib-2.0
# May not be needed in the future
distrobox enter davincibox -- sudo rm /opt/resolve/libs/libglib-2.0.so /opt/resolve/libs/libglib-2.0.so.0 /opt/resolve/libs/libglib-2.0.so.0.6800.4
# TODO: Add toolbox support
fi
else
echo "${1} is not a DaVinci Resolve installer."
exit
fi

# Cleanup
rm -rf squashfs-root/

# Prompt user about adding desktop launcher
add_launcher=false

echo "Add DaVinci Resolve launcher? y/N"
echo "Note: This currently requires administrative priveleges"
read response
case "$response" in
"y") add_launcher=true;;
"Y") add_launcher=true;;
*) add_launcher=false;;
esac

if $add_launcher
then
if $use_distrobox
then
# Because the .desktop file distrobox creatres requires the directory to exist
pkexec mkdir /opt/resolve
distrobox enter davincibox -- distrobox-export --app /opt/resolve/bin/resolve
# TODO: Toolbox support
fi
else
echo "If you would like to create a launcher later,"
if $use_distrobox
then
echo "run the following command:"
echo "distrobox enter davincibox -- distrobox-export --app /opt/resolve/bin/resolve"
# TODO: Toolbox
fi
echo ""
echo "Otherwise, to run DaVinci Resolve from the CLI, use:"
echo "distrobox enter davincibox -- /opt/resolve/bin/resolve"
fi

0 comments on commit 02379cb

Please sign in to comment.