xrdp 更换gnome桌面环境为kde plasma

发布时间 2023-03-31 09:00:36作者: M1927

需要修改的文件:/etc/xrdp/startwm.sh
修改内容:SESSION="plasma"

wm_start()
{
  #To customize system-wise session, edit this file.想全局生效,修改/etc/xrdp/startwm.sh
  #To customize user specific session, copy this file to $HOME and edit it. 想对指定系统用户生效,将/etc/xrdp/startwm.sh复制到用户家目录下再修改
  #Please refer to DefaultWindowManager and UserWindowManager in /etc/xrdp/sesman.ini for more details.

  #The default session is gnome (GNOME Session) 默认使用GNOME
  #sle means SLE-Classic Session

  SESSION="gnome" #修改这个变量即可

  case $SESSION in
    sle)
      if [ -r /usr/bin/gnome-session ]; then
        export XDG_SESSION_TYPE=x11
        export GNOME_SHELL_SESSION_MODE=sle-classic
        /usr/bin/gnome-session --session gnome-classic
      elif [ -r /usr/bin/icewm-session ]; then
        /usr/bin/icewm-session
      fi
      ;;
    gnome)
      if [ -r /usr/bin/gnome-session ]; then
        export XDG_SESSION_TYPE=x11
        /usr/bin/gnome-session
      elif [ -r /usr/bin/icewm-session ]; then
        /usr/bin/icewm-session
      fi
      ;;
    plasma)
      if [ -r /usr/bin/startplasma-x11 ]; then
        export XDG_SESSION_TYPE=x11
        /usr/bin/startplasma-x11
      elif [ -r /usr/bin/icewm-session ]; then
        /usr/bin/icewm-session
      fi
      ;;
    icewm)
      if [ -r /usr/bin/icewm-session ]; then
        /usr/bin/icewm-session
      fi
      ;;
  esac
}