You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

66 lines
1.8 KiB

  1. #!/bin/bash
  2. echo "##########################################################################################"
  3. echo "# install script for qtile window manager"
  4. echo "# Dennis Buchhorn - code@b-eit.de"
  5. echo "##########################################################################################"
  6. echo ""
  7. if ! [[ $(id -u) == "0" ]]; then
  8. echo "The script need to be run as root!" >&2
  9. exit 1
  10. fi
  11. if [[ $SUDO_USER ]]; then
  12. REAL_USER=$SUDO_USER
  13. else
  14. REAL_USER=$(whoami)
  15. fi
  16. for ARG in "$@"; do
  17. if [[ $ARG == "--repo-dir="* ]]; then
  18. REPO_DIR=$(echo $ARG | cut -c 12-)
  19. fi
  20. done
  21. ## copied from https://github.com/JerrySM64/Qtile-Debian/blob/main/qtile-setup.sh
  22. # Remove the EXTERNALLY-MANAGED file so pip works again
  23. rm /usr/lib/python3.11/EXTERNALLY-MANAGED
  24. # Install the full python 3 suite, pip, git and all dependencies
  25. apt update
  26. apt install python3-full python3-pip libpangocairo-1.0-0 python3-cffi python3-xcffib git -y
  27. # Install cairocffi using pip
  28. sudo -u $REAL_USER pip install --no-cache-dir cairocffi
  29. if [[ $REPO_DIR == "" ]]; then
  30. REPO_DIR="/home/$REAL_USER/qtile"
  31. fi
  32. sudo -u $REAL_USER mkdir -p $REPO_DIR
  33. sudo -u $REAL_USER git clone https://github.com/qtile/qtile.git "$REPO_DIR"
  34. cd "$REPO_DIR"
  35. sudo -u $REAL_USER pip install .
  36. # Create xsessions desktop file
  37. tee << EOF /usr/share/xsessions/qtile.desktop > /dev/null
  38. [Desktop Entry]
  39. Name=Qtile
  40. Comment=Qtile Session
  41. Type=Application
  42. Keywords=wm;tiling
  43. Exec=/home/$REAL_USER/.local/bin/qtile start
  44. EOF
  45. # Create config for using qtile as xrdp desktop session and loading pulseaudio modules for xrdp
  46. sudo -u $REAL_USER tee -a << EOF /home/$REAL_USER/.profile > /dev/null
  47. ## start preferred desktop environment via xrdp
  48. [ -n "\$XRDP_SESSION" ] && export DESKTOP_SESSION=qtile
  49. ## load pulseaudio modules for xrdp
  50. /usr/libexec/pulseaudio-module-xrdp/load_pa_modules.sh
  51. EOF