mkrelease.sh 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. #!/bin/bash
  2. if [[ "$EUID" = 0 ]]; then
  3. echo "Please run as your user to install user configs in ~/"
  4. exit 1
  5. else
  6. sudo -k # make sure to ask for password on next sudo
  7. if sudo true; then
  8. echo "sudo activated"
  9. else
  10. echo "sudo authentication failed, try again"
  11. exit 2
  12. fi
  13. fi
  14. sys_path=/etc/gpuedit
  15. sudo rm -rf $sys_path
  16. sys_config_path=$sys_path/config
  17. echo "Copying configuration files to $sys_config_path..."
  18. sudo mkdir -p $sys_config_path
  19. sudo cp ./config/options.release.json $sys_path/options.json
  20. sudo cp ./config/commands.json $sys_config_path/.
  21. echo "Building highlighters..."
  22. bash mkhighlight.sh
  23. sys_highlighters_path=$sys_path/highlighters
  24. echo "Copying highlighters to $sys_highlighters_path..."
  25. sudo mkdir -p $sys_highlighters_path
  26. sudo cp ./src/highlighters/*.so $sys_highlighters_path/.
  27. sudo cp ./config/*_colors.txt $sys_highlighters_path/.
  28. sys_shaders_path=$sys_path/shaders
  29. echo "Copying shaders to $sys_shaders_path..."
  30. sudo mkdir -p $sys_shaders_path
  31. sudo cp ./src/shaders/* $sys_shaders_path/.
  32. echo "Building executable..."
  33. bash build.sh -d
  34. sudo cp ./gpuedit /usr/bin/gpuedit
  35. home_path=~/.gpuedit
  36. if [ ! -d $home_path ]; then
  37. echo "Generating user configs..."
  38. mkdir -p $home_path
  39. cp ./config/options.user.json $home_path/options.json
  40. cp ./config/commands.json $home_path/.
  41. # todo: get system level themes in case of other user
  42. # todo: generate user configs on startup rather than installation
  43. home_themes_path=$home_path/themes
  44. mkdir -p $home_themes_path
  45. cp ./config/themes/* $home_themes_path/.
  46. else
  47. echo "Found existing user configs. Skipping."
  48. fi
  49. echo "Done."