View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update | 
|---|---|---|---|---|---|
| 0004815 | FreeCAD | Feature | public | 2021-12-28 23:19 | 2022-01-23 00:41 | 
| Reporter | mcgiwer | Assigned To | |||
| Priority | normal | Severity | feature | Reproducibility | N/A | 
| Status | feedback | Resolution | open | ||
| Platform | amd64 | OS | Debian | OS Version | 10+ | 
| Product Version | 0.20 | ||||
| Summary | 0004815: [Proposal] Run script (bash) for FreeCAD | ||||
| Description | Hello. 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 Information | Version 0.19 | ||||
|  |  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 &
 | 
|  | @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 | 
|  | Forum thread: https://forum.freecadweb.org/viewtopic.php?f=4&t=65585 | 
|  | This ticket has been migrated to GitHub as issue 6301. | 
| 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 | 
 FreeCAD
 FreeCAD