View Issue Details

IDProjectCategoryView StatusLast Update
0004815FreeCADFeaturepublic2022-01-23 00:41
Reportermcgiwer Assigned To 
PrioritynormalSeverityfeatureReproducibilityN/A
Status feedbackResolutionopen 
Platformamd64OSDebianOS Version10+
Product Version0.20 
Summary0004815: [Proposal] Run script (bash) for FreeCAD
DescriptionHello. I had wrote a script in bash that (after placing in the same folder as for example bin) would allow to launch FreeCAD directly from it and with creates a log file.

I hope that it becomes included to the base FreeCAD. I also hope to recieve a upload permission on GitHub to be able to contribute as well.
Tags#pending-forum
FreeCAD InformationVersion 0.19

Activities

mcgiwer

2021-12-28 23:19

reporter  

run (1,271 bytes)   
#!/bin/bash

#########################
# Fix for the XCB issue #
#########################

sudo xhost +si:localuser:${USER}
export DISPLAY=:0

######################
# End of the XCB fix #
######################

## Supportive function to get app directory

function getpwd
{
    lnk="$(readlink -f $0)"
    ln="$(basename ${lnk})"
    ls=${#ln}

    ((ls=${ls}+1))
    ((ls=-${ls}))

    echo ${lnk::$ls}
}

## End of function


## Get the root folder

root="$(gwtpwd)"

# Create the link to the user home dir

if [ ! -d "${HOME}/.FreeCAD" -o ! -h "${HOME}/.FreeCAD" ]; then ln -vfs ${root} ${HOME}/.FreeCAD; fi

################################################################
#  TODO: Automatical discovery of the avaliable Python version #
################################################################

export PYTHONHOME=${root}

# Qt

export QT_XKB_CONFIG_ROOT=${LD_LIBRARY_PATH}:${root}/lib
# export QT_QPA_PLATFORM_PLUGIN_PATH=plugins
# export QTWEBENGINEPROCESS_PATH=libexec/QtWebEngineProcess

# Support for launching other applications from /usr/bin ( https://github.com/FreeCAD/FreeCAD-AppImage/issues/30)

if [ ! -z "$1" ] && [ -e "bin/$1" ] ; then
    MAIN="bin/$1" ; shift
else
    MAIN="bin/freecad"
fi

nice -n19 ${MAIN} "$@" &> ${root}/freecad.log &
run (1,271 bytes)   

openBrain

2022-01-03 10:57

developer   ~0016184

@mcgiwer : please address issues/proposals according our reporting guidelinesby opening a new thread in our forum.
Notice that there is no need to get write access to GH repo to contribute. Just fork, code, then do a pull request. This is how contributions are merged.
Thx

Kunda1

2022-01-23 00:41

administrator   ~0016254

Forum thread: https://forum.freecadweb.org/viewtopic.php?f=4&t=65585

yorik

2022-03-03 13:55

administrator   ~0017132

This ticket has been migrated to GitHub as issue 6301.

Issue History

Date Modified Username Field Change
2021-12-28 23:19 mcgiwer New Issue
2021-12-28 23:19 mcgiwer File Added: run
2022-01-03 10:57 openBrain Status new => feedback
2022-01-03 10:57 openBrain Note Added: 0016184
2022-01-03 10:57 openBrain Tag Attached: #post-to-forum
2022-01-23 00:41 Kunda1 Note Added: 0016254
2022-01-23 00:41 Kunda1 Tag Detached: #post-to-forum
2022-01-23 00:41 Kunda1 Tag Attached: #pending-forum