黑猴子的家:华为 OpenEuler(欧拉) Linux 系统之配置图形化界面openEuler-20.03-LTS

阅读: 评论:0

1、安装yum依赖

[root@openeuler100 ~]# yum install -y gnome-shell gdm gnome-session gnome-terminal

2、设置图形化启动

[root@openeuler100 ~]# systemctl enable gdm.service
[root@openeuler100 ~]# systemctl set-default graphical.target

3、避免中文乱码

[root@openeuler100 ~]# yum -y groupinstall fonts

4、复制Xsession文件

Xsession 默认没有这个文件,需要自己创建一下,是一个小Bug

[root@openeuler100 ~]# cp -R Xsession /etc/X11/xinit/
[root@openeuler100 ~]# cd /etc/X11/xinit
[root@openeuler100 xinit]# chmod 755 Xsession

5、查看Xsession文件内容

[root@openeuler100 ~]# cd /etc/X11/xinit/
[root@openeuler100 xinit]# pwd
/etc/X11/xinit
[root@openeuler100 xinit]# vim Xsession
#!/bin/bash
# Copyright (C) 1999 - 2004 Red Hat, Inc. All rights reserved. This
# copyrighted material is made available to anyone wishing to use, modify,
# copy, or redistribute it subject to the terms and conditions of the
# GNU General Public License version 2.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

# redirect errors to a file in user's home directory if we can
if [ -z "$GDMSESSION" ]; then
    # GDM redirect output itself in a smarter fashion
    errfile="$HOME/.xsession-errors"
    if ( umask 077 && cp /dev/null "$errfile" 2> /dev/null ); then
        chmod 600 "$errfile"
        [ -x /sbin/restorecon ] && /sbin/restorecon $errfile
        exec > "$errfile" 2>&1
    else
        errfile=$(mktemp -q /tmp/xses-$USER.XXXXXX)
        if [ $? -eq 0 ]; then
            exec > "$errfile" 2>&1
        fi
    fi
fi

SWITCHDESKPATH=/usr/share/switchdesk

# Mandatorily source xinitrc-common, which is common code shared between the
# Xsession and xinitrc scripts which has been factored out to avoid duplication
. /etc/X11/xinit/xinitrc-common

# This Xsession.d implementation, is intended to obsolte and replace the
# various mechanisms present in the 'case' statement which follows, and to
# eventually be able to easily remove all hard coded window manager specific
# content from this script.  See bug #142260 for additional explanation and
# details.  All window manager rpm packages and desktop environment
# packages should be modified to provide the Xsession.d/Xsession.$wm scripts
# to start themselves up.  In the future, the legacy switchdesk mechanisms
# and hard coded window managers and desktop environments will be removed from
# this script. 
XCLIENTS_D=/etc/X11/xinit/Xclients.d
if [ "$#" -eq 1 ] && [ -x "$XCLIENTS_D/Xclients.$1.sh" ]; then
    exec -l $SHELL -c "$CK_XINIT_SESSION $SSH_AGENT $XCLIENTS_D/Xclients.$1.sh"
else
# now, we see if xdm/gdm/kdm has asked for a specific environment
case $# in
1)
    if [ -x "$SWITCHDESKPATH/Xclients.$1" ]; then
       exec -l $SHELL -c "$SWITCHDESKPATH/Xclients.$1";
    fi;

    case "$1" in
    failsafe)
        exec -l $SHELL -c "xterm -geometry 80x24-0-0"
        ;;
    gnome|gnome-session)
        # lack of SSH_AGENT is intentional, see #441123.  though
        # the whole thing should really happen in xinitrc.d anyway.
        exec -l $SHELL -c gnome-session
        exec /bin/sh -c "exec -l $SHELL -c "gnome-session"" 
        ;;
    kde|kde1|kde2)
        exec $CK_XINIT_SESSION $SSH_AGENT /bin/sh -c "exec -l $SHELL -c "startkde""
        ;;
    twm)
        # fall back to twm
        exec $CK_XINIT_SESSION $SSH_AGENT /bin/sh -c "exec -l $SHELL -c "twm""
        ;;
    *)
       # GDM provies either a command line as the first argument or
       # provides 'failsafe', 'default' or 'custom'.  KDM will do the
       # same at some point
        if [ "$1" != "default" -a "$1" != "custom" ]; then
        exec $CK_XINIT_SESSION $SSH_AGENT /bin/sh -c "exec -l $SHELL -c "$1""
        fi
        ;;
    esac
esac
fi

# otherwise, take default action
if [ -x "$HOME/.xsession" ]; then
    exec -l $SHELL -c "$CK_XINIT_SESSION $SSH_AGENT $HOME/.xsession"
elif [ -x "$HOME/.Xclients" ]; then
    exec -l $SHELL -c "$CK_XINIT_SESSION $SSH_AGENT $HOME/.Xclients"
elif [ -x /etc/X11/xinit/Xclients ]; then
    exec -l $SHELL -c "$CK_XINIT_SESSION $SSH_AGENT /etc/X11/xinit/Xclients"
else
    # should never get here; failsafe fallback
    exec -l $SHELL -c "xsm"
fi

6、重启

[root@openeuler100 ~]# reboot

7、桌面

桌面 浏览器

本文发布于:2025-03-05 21:22:00,感谢您对本站的认可!

本文链接:https://www.4u4v.net/it/1741180953581709.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:华为   猴子   图形化   界面   欧拉
留言与评论(共有 0 条评论)
   
验证码:

Copyright ©2019-2022 Comsenz Inc.Powered by ©

网站地图1 网站地图2 网站地图3 网站地图4 网站地图5 网站地图6 网站地图7 网站地图8 网站地图9 网站地图10 网站地图11 网站地图12 网站地图13 网站地图14 网站地图15 网站地图16 网站地图17 网站地图18 网站地图19 网站地图20 网站地图21 网站地图22/a> 网站地图23