Victor-IX / Blender-Launcher-V2

Standalone client for managing official builds of Blender 3D
GNU General Public License v3.0
397 stars 18 forks source link

Add command line argument to just open quick launch version #81

Closed andersmmg closed 6 days ago

andersmmg commented 7 months ago

Is your feature request related to a problem? Please describe. I want to create a app menu shortcut to just open my main version directly, without having to manually update a shortcut every time I update it or change to a new version.

Describe the solution you'd like Add a command line option like --launch-quickstart that just launches it and exits, rather than opening the actual launcher.

Describe alternatives you've considered Currently I manually set up a shortcut which has to be changed all the time and is a pain, which kinda defeats the purpose of the launcher.

Additional context I'm on Linux

zeptofine commented 7 months ago

related to #71

I think this is very possible, and it also lines up with our idea to associate .blend files with BLV2 and launch its respective Blender version based on the file header

andersmmg commented 7 months ago

Currently, I have set up this bash script in ~/.local/bin/blender

#!/bin/bash

# Path to the ini file
INI_FILE="$HOME/.local/bin/Blender Launcher.ini"

# Read the value of 'favorite_path' from the ini file
FAVORITE_PATH=$(awk -F'=' '/^favorite_path/ {print $2}' "$INI_FILE")

# Check if the favorite path exists
if [ -d "$FAVORITE_PATH" ]; then
    # Execute blender with the full path to the binary, passing any provided arguments
    "$FAVORITE_PATH/blender" "$@"
else
    echo "Favorite path not found: $FAVORITE_PATH"
fi
hazre commented 5 months ago

I was looking for a solution like this but then I found out this exists. It's not automatic and you have to set it whenever you want to change it, but good enough for me.

image

Also since I already made this, might as well share it. It's @andersmmg's script but for windows. It's meant to work with "Open with" dialog.


param($FilePath)

# Path to the ini file
$IniFile = Join-Path -Path $env:USERPROFILE "./tools/Blender Launcher.ini"

# Read the value of 'favorite_path' from the ini file
$FavoritePath = Select-String -Path $IniFile -Pattern '^favorite_path\s*=\s*(.*)' | ForEach-Object { $_.Matches.Groups[1].Value }

# Check if the favorite path exists
if (Test-Path -Path $FavoritePath) {
    # Execute blender with the full path to the binary, passing the file path as an argument
    & "$FavoritePath\blender.exe" $FilePath
} else {
    Write-Host "Favorite path not found: $FavoritePath"
}
zeptofine commented 6 days ago

The quick launch version is the default behavior when performing ./Blender\ Launcher launch on the latest versions