Guest User

install_zapclient.sh

a guest
Mar 25th, 2024
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.18 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # Update package lists
  4. sudo apt update
  5.  
  6. # Install required packages
  7. sudo apt-get install -y libudev-dev cmake xorg-dev libglu1-mesa-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libxkbcommon-dev libwayland-dev git g++ gcc libinput-dev libsoil-dev build-essential libx11-dev libxtst-dev
  8.  
  9. # Get the current username
  10. username=$(whoami)
  11.  
  12. # Set the directory path
  13. github_dir="/home/$username/github"
  14.  
  15. # Create github directory if it doesn't exist
  16. if [ ! -d "$github_dir" ]; then
  17. mkdir -p "$github_dir"
  18. fi
  19.  
  20. # Change directory to github directory
  21. cd "$github_dir"
  22.  
  23. # Clone GLFW repository
  24. git clone https://github.com/glfw/glfw.git
  25. cd glfw
  26. mkdir build
  27. cd build
  28.  
  29. # Build GLFW
  30. cmake ..
  31. make
  32. sudo make install
  33.  
  34. # Return to the parent directory
  35. cd ../..
  36.  
  37. # Clone zap-client repository
  38. git clone https://github.com/Gerosity/zap-client.git
  39. cd zap-client
  40. mkdir build
  41. cd build
  42.  
  43. # Build zap-client
  44. cmake ..
  45. make
  46.  
  47. # Create a shell script to run zapclient
  48. echo "#!/bin/bash" > "$github_dir/zapclient.sh"
  49. echo "cd $github_dir/zap-client/build" >> "$github_dir/zapclient.sh"
  50. echo "sudo ./zapclient" >> "$github_dir/zapclient.sh"
  51. chmod +x "$github_dir/zapclient.sh"
  52.  
  53. # Create a desktop shortcut for zapclient
  54. desktop_dir="/home/$username/Desktop"
  55. echo "[Desktop Entry]" > "$desktop_dir/zapclient.desktop"
  56. echo "Type=Application" >> "$desktop_dir/zapclient.desktop"
  57. echo "Name=Zap Client" >> "$desktop_dir/zapclient.desktop"
  58. echo "Exec=$github_dir/zapclient.sh" >> "$desktop_dir/zapclient.desktop"
  59. echo "Terminal=true" >> "$desktop_dir/zapclient.desktop"
  60. echo "Icon=utilities-terminal" >> "$desktop_dir/zapclient.desktop"
  61. chmod +x "$desktop_dir/zapclient.desktop"
  62.  
  63. # Create a menu entry for zapclient
  64. menu_dir="/usr/share/applications"
  65. sudo sh -c "echo '[Desktop Entry]' > $menu_dir/zapclient.desktop"
  66. sudo sh -c "echo 'Type=Application' >> $menu_dir/zapclient.desktop"
  67. sudo sh -c "echo 'Name=Zap Client' >> $menu_dir/zapclient.desktop"
  68. sudo sh -c "echo 'Exec=$github_dir/zapclient.sh' >> $menu_dir/zapclient.desktop"
  69. sudo sh -c "echo 'Terminal=true' >> $menu_dir/zapclient.desktop"
  70. sudo sh -c "echo 'Icon=utilities-terminal' >> $menu_dir/zapclient.desktop"
  71.  
Advertisement
Add Comment
Please, Sign In to add comment