Advertisement
bluebyt

startwayfire

May 10th, 2025
1,134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2. export reuse_gl_names=0
  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. export LD_LIBRARY_PATH=/opt/wayfire/lib:$LD_LIBRARY_PATH
  8. # path is needed for wf-shell clients
  9. export PATH=/opt/wayfire/bin:$PATH
  10. # path to find .desktop files like wcm
  11. export XDG_DATA_DIRS=/opt/wayfire/share:$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. elif [ ! -z "$WAYLAND_DISPLAY" ] || [ ! -z "$DISPLAY" ]; then
  25.     echo "Running nested, using stdout as log"
  26.     wayfire "$@"
  27. else
  28.     LOG_FILE=$DEFAULT_LOG_DIR/wayfire.log
  29.     if [ -f $LOG_FILE ]; then
  30.         cp $LOG_FILE $LOG_FILE.old
  31.     fi
  32.     echo "Using log file: $LOG_FILE"
  33.     wayfire "$@" &> $LOG_FILE
  34. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement