www

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

start_wayfire.sh.in (810B)


      1 #!/bin/bash
      2 
      3 # if $XDG_DATA_DIRS is not set, set it to the spec recommended value
      4 [ -z "$XDG_DATA_DIRS" ] && export XDG_DATA_DIRS="/usr/local/share:/usr/share"
      5 
      6 # path for wf-config and wlroots
      7 LD_LIBRARY_PATH=$LD_LIBRARY_PATH
      8 # path is needed for wf-shell clients
      9 PATH=$PATH
     10 # path to find .desktop files like wcm
     11 XDG_DATA_DIRS=$XDG_DATA_DIRS
     12 
     13 if [ -d "$XDG_DATA_HOME" ]; then
     14     DEFAULT_LOG_DIR=$XDG_DATA_HOME/wayfire
     15 else
     16     DEFAULT_LOG_DIR=$HOME/.local/share/wayfire
     17 fi
     18 
     19 mkdir -p $DEFAULT_LOG_DIR
     20 if [ $? != 0 ]; then
     21     echo "Could not create log directory $DEFAULT_LOG_DIR"
     22     echo "Using stdout as log"
     23     wayfire
     24 else
     25     LOG_FILE=$DEFAULT_LOG_DIR/wayfire.log
     26     if [ -f $LOG_FILE ]; then
     27         cp $LOG_FILE $LOG_FILE.old
     28     fi
     29     echo "Using log file: $LOG_FILE"
     30     wayfire &> $LOG_FILE
     31 fi