Skip to content

Commit

Permalink
Added --no-gui flag to force CLI usage (allows for CLI usage with App…
Browse files Browse the repository at this point in the history
…Image build).

Forced --gui flag in AppImage build.
  • Loading branch information
lordofhyphens committed Sep 2, 2017
1 parent 66074f5 commit d6469b2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ Contributions by Henrik Brix Andersen, Vojtech Bubnik, Nicolas Dandrimont, Mark
GUI options:
--gui Forces the GUI launch instead of command line slicing (if you
supply a model file, it will be loaded into the plater)
--no-gui Forces the command line slicing instead of gui.
This takes precedence over --gui if both are present.
--autosave <file> Automatically export current configuration to the specified file

Output options:
Expand Down
2 changes: 1 addition & 1 deletion package/linux/appimage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ cd - > /dev/null
# disable parameter expansion to forward all arguments unprocessed to the VM
set -f
# run the VM and pass along all arguments as is
LD_LIBRARY_PATH="$DIR/usr/lib" "${DIR}/usr/bin/perl-local" -I"${DIR}/usr/lib/local-lib/lib/perl5" "${DIR}/usr/bin/slic3r.pl" "$@"
LD_LIBRARY_PATH="$DIR/usr/lib" "${DIR}/usr/bin/perl-local" -I"${DIR}/usr/lib/local-lib/lib/perl5" "${DIR}/usr/bin/slic3r.pl" --gui "$@"
EOF

chmod +x AppRun
Expand Down
5 changes: 4 additions & 1 deletion slic3r.pl
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ BEGIN

'debug' => \$Slic3r::debug,
'gui' => \$opt{gui},
'no-gui' => \$opt{no_gui},
'o|output=s' => \$opt{output},
'j|threads=i' => \$opt{threads},

Expand Down Expand Up @@ -105,7 +106,7 @@ BEGIN

# launch GUI
my $gui;
if ((!@ARGV || $opt{gui}) && !$opt{save} && eval "require Slic3r::GUI; 1") {
if ((!@ARGV || $opt{gui}) && !(!@ARGV || $opt{no_gui}) && !$opt{save} && eval "require Slic3r::GUI; 1") {
{
no warnings 'once';
$Slic3r::GUI::datadir = Slic3r::decode_path($opt{datadir} // '');
Expand Down Expand Up @@ -336,6 +337,8 @@ sub usage {
GUI options:
--gui Forces the GUI launch instead of command line slicing (if you
supply a model file, it will be loaded into the plater)
--no-gui Forces the command line slicing instead of gui.
This takes precedence over --gui if both are present.
--autosave <file> Automatically export current configuration to the specified file
Output options:
Expand Down

0 comments on commit d6469b2

Please sign in to comment.