www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit ba77b7cdeb50faa424fc738c58469c2b1ed74887
parent 2146d856c16f06d940803bbd9b873d1142a665f5
Author: Ilia Bozhinov <ammen99@gmail.com>
Date:   Fri,  3 Apr 2020 14:25:21 +0200

start_wayfire.sh: move logs to ~/.local/share/wayfire/wayfire.log

XDG_RUNTIME_DIR can be cleaned between reboots which is less than ideal
in case the system freezes.

Diffstat:
Mstart_wayfire.sh.in | 18+++++++++++++-----
1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/start_wayfire.sh.in b/start_wayfire.sh.in @@ -5,14 +5,22 @@ LD_LIBRARY_PATH=$LD_LIBRARY_PATH # path is needed for wf-shell clients PATH=$PATH -if [ -d "$XDG_RUNTIME_DIR" ]; then - LOG_FILE=$XDG_RUNTIME_DIR/wayfire.log +if [ -d "$XDG_DATA_HOME" ]; then + DEFAULT_LOG_DIR=$XDG_DATA_HOME/wayfire +else + DEFAULT_LOG_DIR=$HOME/.local/share/wayfire +fi + +mkdir -p $DEFAULT_LOG_DIR +if [ $? != 0 ]; then + echo "Could not create log directory $DEFAULT_LOG_DIR" + echo "Using stdout as log" + wayfire +else + LOG_FILE=$DEFAULT_LOG_DIR/wayfire.log if [ -f $LOG_FILE ]; then cp $LOG_FILE $LOG_FILE.old fi - echo "Using log file: $LOG_FILE" wayfire &> $LOG_FILE -else - wayfire fi