Skip to content

Instantly share code, notes, and snippets.

@crnisamuraj
Last active September 6, 2023 06:17
Show Gist options
  • Save crnisamuraj/49bc667c4c7c788c602bd29e58bbd049 to your computer and use it in GitHub Desktop.
Save crnisamuraj/49bc667c4c7c788c602bd29e58bbd049 to your computer and use it in GitHub Desktop.
install-xrdp-kde
#!/bin/bash -e
# Install XRDP.
sudo apt install -y xrdp
#sudo sed -e 's/^new_cursors=true/new_cursors=false/g' \
# -i /etc/xrdp/xrdp.ini
sudo systemctl enable xrdp
sudo systemctl restart xrdp
# Load Ubuntu config.
echo "startplasma-x11" > ~/.xsession
# D=/usr/share/plasma:/usr/local/share:/usr/share:/var/lib/snapd/desktop
# C=/etc/xdg/xdg-plasma:/etc/xdg
# C=${C}:/usr/share/kubuntu-default-settings/kf5-settings
# cat <<EOF > ~/.xsessionrc
# export XDG_SESSION_DESKTOP=KDE
# export XDG_DATA_DIRS=${D}
# export XDG_CONFIG_DIRS=${C}
# EOF
# Avoid Authentication Required dialog.
cat <<EOF | \
sudo tee /etc/polkit-1/localauthority/50-local.d/xrdp-NetworkManager.pkla
[Netowrkmanager]
Identity=unix-group:sudo
Action=org.freedesktop.NetworkManager.network-control
ResultAny=yes
ResultInactive=yes
ResultActive=yes
EOF
cat <<EOF | \
sudo tee /etc/polkit-1/localauthority/50-local.d/xrdp-packagekit.pkla
[Netowrkmanager]
Identity=unix-group:sudo
Action=org.freedesktop.packagekit.system-sources-refresh
ResultAny=yes
ResultInactive=auth_admin
ResultActive=yes
EOF
sudo systemctl restart polkit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment