/* This program was contributed by Shane Watts [modifications by AGM and kukuk] You need to add the following (or equivalent) to the /etc/pam.d/check_user file: # check authorization auth required pam_unix.so account required pam_unix.so */
DISPLAY is used by any X application to know which display to use and XAUTHORITY to provide a path to the user's .Xauthority file and thus the cookie needed to access the X server. If you plan on launching X applications from systemd units, these variables need to be set. Systemd provides a script in /etc/X11/xinit/xinitrc.d/50-systemd-user.sh to import those variables into the systemd user session on X launch. [3] So unless you start X in a nonstandard way, user services should be aware of the DISPLAY and XAUTHORITY
Jan 02 18:56:45 lpyarch dbus-daemon[474]: [session uid=1000 pid=474] Activating service name='org.gnome.keyring.SystemPrompter' requested by ':1.34' (uid=1000 pid=404 comm="/usr/bin/gnome-keyring-daemon --daemonize --login ") Jan 02 18:56:45 lpyarch org.gnome.keyring.SystemPrompter[1890]: Unable to init server: Could not connect: Connection refused Jan 02 18:56:45 lpyarch gcr-prompter[1890]: cannot open display: Jan 02 18:56:45 lpyarch dbus-daemon[474]: [session uid=1000 pid=474] Activated service 'org.gnome.keyring.SystemPrompter' failed: Process org.gnome.keyring.SystemPrompter exited with status 1 Jan 02 18:56:45 lpyarch gnome-keyring-daemon[404]: couldn't create system prompt: GDBus.Error:org.freedesktop.DBus.Error.Spawn.ChildExited: Process org.gnome.keyring.SystemPrompter exited with status 1
Jan 02 18:57:15 lpyarch dbus-daemon[474]: [session uid=1000 pid=474] Activating service name='org.gnome.keyring.SystemPrompter' requested by ':1.34' (uid=1000 pid=404 comm="/usr/bin/gnome-keyring-daemon --daemonize --login ") Jan 02 18:57:16 lpyarch org.gnome.keyring.SystemPrompter[1899]: Unable to init server: Could not connect: Connection refused Jan 02 18:57:16 lpyarch gcr-prompter[1899]: cannot open display: Jan 02 18:57:16 lpyarch dbus-daemon[474]: [session uid=1000 pid=474] Activated service 'org.gnome.keyring.SystemPrompter' failed: Process org.gnome.keyring.SystemPrompter exited with status 1 Jan 02 18:57:16 lpyarch gnome-keyring-daemon[404]: couldn't create system prompt: GDBus.Error:org.freedesktop.DBus.Error.Spawn.ChildExited: Process org.gnome.keyring.SystemPrompter exited with status 1
Jan 02 19:45:17 lpyarch dbus-daemon[474]: [session uid=1000 pid=474] Activating service name='org.gnome.keyring.SystemPrompter' requested by ':1.34' (uid=1000 pid=404 comm="/usr/bin/gnome-keyring-daemon --daemonize --login ") Jan 02 19:45:17 lpyarch gcr-prompter[3670]: Gcr: bus acquired: org.gnome.keyring.SystemPrompter Jan 02 19:45:17 lpyarch gcr-prompter[3670]: Gcr: registering prompter Jan 02 19:45:17 lpyarch gcr-prompter[3670]: Gcr: bus acquired: org.gnome.keyring.PrivatePrompter Jan 02 19:45:17 lpyarch dbus-daemon[474]: [session uid=1000 pid=474] Successfully activated service 'org.gnome.keyring.SystemPrompter' Jan 02 19:45:17 lpyarch gcr-prompter[3670]: Gcr: acquired name: org.gnome.keyring.SystemPrompter Jan 02 19:45:17 lpyarch gcr-prompter[3670]: Gcr: received BeginPrompting call from callback /org/gnome/keyring/Prompt/p56@:1.34 Jan 02 19:45:17 lpyarch gcr-prompter[3670]: Gcr: preparing a prompt for callback /org/gnome/keyring/Prompt/p56@:1.34 Jan 02 19:45:17 lpyarch gcr-prompter[3670]: Gcr: creating new GcrPromptDialog prompt Jan 02 19:45:17 lpyarch gcr-prompter[3670]: GLib-GIO: _g_io_module_get_default: Found default implementation gvfs (GDaemonVfs) for ‘gio-vfs’ Jan 02 19:45:17 lpyarch gcr-prompter[3670]: Gcr: automatically selecting secret exchange protocol Jan 02 19:45:17 lpyarch gcr-prompter[3670]: Gcr: generating public key Jan 02 19:45:18 lpyarch gcr-prompter[3670]: Gcr: beginning the secret exchange: [sx-aes-1]\npublic=2G5a5ux0oDxyKtwTtKQeVK1Y8xiejwsV88063Ue4SCKhagOPRZcHCF+XKSNjn6Xb74zHTN222E3/a5RrNbGcS8VRmPTVGxxUc9mNBlWlgUg4MtBNtKF4t9DPBTC4RA4zw1ybsu20vXqyCm+z1OCmic+SmrpBqQzSYYRFn3633l/WirlYBmK/B/W0OFtuCZYJH39M46n/RJCC2PsyVI0WATBN8wyjnIGWjeC/X87qs8hrYPQTFQVpdDwSZ3sTvfkM\n Jan 02 19:45:18 lpyarch gcr-prompter[3670]: Gcr: calling the PromptReady method on /org/gnome/keyring/Prompt/p56@:1.34 Jan 02 19:45:18 lpyarch gcr-prompter[3670]: Gcr: acquired name: org.gnome.keyring.PrivatePrompter Jan 02 19:45:18 lpyarch gcr-prompter[3670]: Gcr: returned from the PromptReady method on /org/gnome/keyring/Prompt/p56@:1.34 Jan 02 19:45:18 lpyarch gcr-prompter[3670]: Gcr: received PerformPrompt call from callback /org/gnome/keyring/Prompt/p56@:1.34 Jan 02 19:45:18 lpyarch gcr-prompter[3670]: Gcr: receiving secret exchange: [sx-aes-1]\npublic=DD1Zv/mXj0MFxWWAleJ1k8HlPzKHpAIsC3Xx8PNnEe0MhY17Nu4NXBNI9isZXxMY5yJXBQbFWXHe9oE2URrSwAMIkkd3I2Myb2jWTgRjH+oIFDonvPGJTKfojyUBkWEvyy3B5a17W5RanbZ3lf0BF3PgA1boQDBiFIXrXwWUQedUkrf8OUdYmlcLFMR5eUpJDDcllwP8qeNonWJI0zI8OeC+xMc71BWTxVHcx9P7ArL3nX4r5Ol5j4NNV/YGoyZ/\n Jan 02 19:45:18 lpyarch gcr-prompter[3670]: Gcr: deriving shared transport key Jan 02 19:45:18 lpyarch gcr-prompter[3670]: Gcr: deriving transport key Jan 02 19:45:18 lpyarch gcr-prompter[3670]: Gcr: starting password prompt for callback /org/gnome/keyring/Prompt/p56@:1.34 Jan 02 19:45:31 lpyarch gcr-prompter[3670]: Gcr: completed password prompt for callback :1.34@/org/gnome/keyring/Prompt/p56 Jan 02 19:45:31 lpyarch gcr-prompter[3670]: Gcr: encrypting data Jan 02 19:45:31 lpyarch gcr-prompter[3670]: Gcr: sending the secret exchange: [sx-aes-1]\npublic=2G5a5ux0oDxyKtwTtKQeVK1Y8xiejwsV88063Ue4SCKhagOPRZcHCF+XKSNjn6Xb74zHTN222E3/a5RrNbGcS8VRmPTVGxxUc9mNBlWlgUg4MtBNtKF4t9DPBTC4RA4zw1ybsu20vXqyCm+z1OCmic+SmrpBqQzSYYRFn3633l/WirlYBmK/B/W0OFtuCZYJH39M46n/RJCC2PsyVI0WATBN8wyjnIGWjeC/X87qs8hrYPQTFQVpdDwSZ3sTvfkM\nsecret=YJvt3wtzr/dkfsZxg2nl1w==\niv=eTAIkduomuAKw163hVZkGQ==\n Jan 02 19:45:31 lpyarch gcr-prompter[3670]: Gcr: calling the PromptReady method on /org/gnome/keyring/Prompt/p56@:1.34 Jan 02 19:45:31 lpyarch gcr-prompter[3670]: Gcr: returned from the PromptReady method on /org/gnome/keyring/Prompt/p56@:1.34 Jan 02 19:45:31 lpyarch gcr-prompter[3670]: Gcr: received PerformPrompt call from callback /org/gnome/keyring/Prompt/p56@:1.34 Jan 02 19:45:31 lpyarch gcr-prompter[3670]: Gcr: receiving secret exchange: [sx-aes-1]\npublic=DD1Zv/mXj0MFxWWAleJ1k8HlPzKHpAIsC3Xx8PNnEe0MhY17Nu4NXBNI9isZXxMY5yJXBQbFWXHe9oE2URrSwAMIkkd3I2Myb2jWTgRjH+oIFDonvPGJTKfojyUBkWEvyy3B5a17W5RanbZ3lf0BF3PgA1boQDBiFIXrXwWUQedUkrf8OUdYmlcLFMR5eUpJDDcllwP8qeNonWJI0zI8OeC+xMc71BWTxVHcx9P7ArL3nX4r5Ol5j4NNV/YGoyZ/\n Jan 02 19:45:31 lpyarch gcr-prompter[3670]: Gcr: starting password prompt for callback /org/gnome/keyring/Prompt/p56@:1.34 Jan 02 19:45:38 lpyarch gcr-prompter[3670]: Gcr: completed password prompt for callback :1.34@/org/gnome/keyring/Prompt/p56 Jan 02 19:45:38 lpyarch gcr-prompter[3670]: Gcr: encrypting data Jan 02 19:45:38 lpyarch gcr-prompter[3670]: Gcr: sending the secret exchange: [sx-aes-1]\npublic=2G5a5ux0oDxyKtwTtKQeVK1Y8xiejwsV88063Ue4SCKhagOPRZcHCF+XKSNjn6Xb74zHTN222E3/a5RrNbGcS8VRmPTVGxxUc9mNBlWlgUg4MtBNtKF4t9DPBTC4RA4zw1ybsu20vXqyCm+z1OCmic+SmrpBqQzSYYRFn3633l/WirlYBmK/B/W0OFtuCZYJH39M46n/RJCC2PsyVI0WATBN8wyjnIGWjeC/X87qs8hrYPQTFQVpdDwSZ3sTvfkM\nsecret=TOLxilfEWSSqacnL1hAEMw==\niv=uoSuwtbaJMNBvJt2sTdZpw==\n Jan 02 19:45:38 lpyarch gcr-prompter[3670]: Gcr: calling the PromptReady method on /org/gnome/keyring/Prompt/p56@:1.34 Jan 02 19:45:38 lpyarch gcr-prompter[3670]: Gcr: returned from the PromptReady method on /org/gnome/keyring/Prompt/p56@:1.34 Jan 02 19:45:38 lpyarch gcr-prompter[3670]: Gcr: received PerformPrompt call from callback /org/gnome/keyring/Prompt/p56@:1.34 Jan 02 19:45:38 lpyarch gcr-prompter[3670]: Gcr: stopping prompting for operation /org/gnome/keyring/Prompt/p56@:1.34 Jan 02 19:45:38 lpyarch gcr-prompter[3670]: Gcr: closing the prompt Jan 02 19:45:38 lpyarch gcr-prompter[3670]: Gcr: stopping prompting for operation /org/gnome/keyring/Prompt/p56@:1.34 Jan 02 19:45:38 lpyarch gcr-prompter[3670]: Gcr: couldn't find the callback for prompting operation /org/gnome/keyring/Prompt/p56@:1.34 Jan 02 19:45:38 lpyarch gcr-prompter[3670]: Gcr: stopping prompting for operation /org/gnome/keyring/Prompt/p56@:1.34 Jan 02 19:45:38 lpyarch gcr-prompter[3670]: Gcr: couldn't find the callback for prompting operation /org/gnome/keyring/Prompt/p56@:1.34 Jan 02 19:45:38 lpyarch gcr-prompter[3670]: Gcr: stopping prompting for operation /org/gnome/keyring/Prompt/p56@:1.34 Jan 02 19:45:38 lpyarch gcr-prompter[3670]: Gcr: couldn't find the callback for prompting operation /org/gnome/keyring/Prompt/p56@:1.34 Jan 02 19:45:38 lpyarch gcr-prompter[3670]: Gcr: calling the PromptDone method on /org/gnome/keyring/Prompt/p56@:1.34, and ignoring reply Jan 02 19:45:49 lpyarch gcr-prompter[3670]: Gcr: 10 second inactivity timeout, quitting Jan 02 19:45:49 lpyarch gcr-prompter[3670]: Gcr: unregistering prompter Jan 02 19:45:49 lpyarch gcr-prompter[3670]: Gcr: disposing prompter Jan 02 19:45:49 lpyarch gcr-prompter[3670]: Gcr: finalizing prompter
/etc/X11/Xsession.d/35x11-common_xhost-local Give access to the X server to the same user on the local host. If the xhost command is available, it will use it to allow any process of the same user running on the local host to access the X server.
# This file is sourced by Xsession(5), not executed.
# If xhost (from x11-xserver-utils) is installed, use it to give access # to the X server to any process from the same user on the local host. # Unlike other uses of xhost, this is safe since the kernel can check # the actual owner of the calling process.
iftype xhost >/dev/null 2>&1; then xhost +si:localuser:$(id -un) || : fi
xhost命令简介如下:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
NAME xhost - server access control program for X
SYNOPSIS xhost [[+-]name ...]
DESCRIPTION The xhost program is used to add and delete host names or user names to the list allowed to make connections to the X server. In the case of hosts, this provides a rudimentary form of privacy control and security. It is only sufficient for a workstation (single user) environment, although it does limit the worst abuses. Environments which require more sophisticated measures should implement the user- based mechanism or use the hooks in the protocol for passing other authentication data to the server.
An alternate client and/or server may be specified on the command line. The de‐ sired client program and its arguments should be given as the first command line arguments to xinit. To specify a particular server command line, append a double dash (—) to the xinit command line (after any client and arguments) followed by the desired server command.
Both the client program name and the server program name must begin with a slash (/) or a period (.). Otherwise, they are treated as an arguments to be appended to their respective startup lines. This makes it possible to add arguments (for example, foreground and background colors) without having to retype the whole command line.
关于xinit,很重要的一点是要理解它的行为,它会启动两个程序,一个叫做作 A(称为Client),另一个叫作B(称为Server),一旦它检测到 A 进程结束,它就会终止 B 进程。 也许可以这么说(我瞎猜的),xinit程序本身并不知道它所启动的到底是两个什么程序,它所做的事情仅仅是等待 A 完成,然后终止 B。只要按照约定将 X Client 程序传递给它作为 A,将 X Server 传递给它作为 B,就能实现 X Client 进程结束时自动终止 X Server 的效果。也许可以尝试使用SHELL脚本模拟这个过程。
理解了这个过程,就可以讨论 xinit 所接受的程序参数类型了。既然只要可以运行为一个进程就可以,也就不是必须传递给它二进制程序了,SHELL脚本也是可以的,因为可以由xinit创建一个sh进程执行脚本,然后将此sh进程作为所谓的的 Client 进程,等待它结束然后去终止 Server进程,同样的,所谓的 Server 进程也可以是shell脚本。
在实际使用中,几乎总是使用脚本作为程序参数传递给xinit,并在 Server 脚本的最后使用 exec 命令启动X Server,这样一来就能将此sh进程转变成 X Server 进程,在 Client 脚本的最后使用 exec 命令启动 X Client,然后xinit按照其运行逻辑等待 Client 进程结束并终止 Server 即可。
To determine the client to run, startx looks for the following files, in order:
$(HOME)/.startxrc
/usr/lib/x86_64-linux-gnu/sys.startxrc
$(HOME)/.xinitrc
/etc/X11/xinit/xinitrc
If command line client options are given, they override this behavior and revert to the xinit(1) behavior. To determine the server to run, startx first looks for a file called .xserverrc in the user's home directory. If that is not found, it uses the file xserverrc in the xinit library directory. If command line server options are given, they override this behavior and revert to the xinit(1) behav‐ ior. Users rarely need to provide a .xserverrc file. See the xinit(1) manual page for more details on the arguments.
The system-wide xinitrc and xserverrc files are found in the /etc/X11/xinit di‐ rectory.
基于Debian的系统-XSession文件
1 2 3 4 5 6 7
Note that in the Debian system, what many people traditionally put in the .xini‐ trc file should go in .xsession instead; this permits the same X environment to be presented whether startx, xdm, or xinit is used to start the X session. All discussion of the .xinitrc file in the xinit(1) manual page applies equally well to .xsession. Keep in mind that .xinitrc is used only by xinit(1) and completely ignored by xdm(1).
# # This is just a sample implementation of a slightly less primitive # interface than xinit. It looks for user .xinitrc and .xserverrc # files, then system xinitrc and xserverrc files, else lets xinit choose # its default. The system xinitrc should probably do things like check # for .Xresources files and merge them in, start up a window manager, # and pop a clock and several xterms. # # Site administrators are STRONGLY urged to write nicer versions. #
# 这个判断条件的意思是,$1不为空 # 看起来有点奇怪,可能是早期shell的限制导致不得不这么写吧 while [ x"$1" != x ]; do case"$1"in # '' required to prevent cpp from treating "/*" as a C comment. /''*|\./''*) # 匹配一个看起来像是路径的东西 # 这个 PATTERN 可能是专门用来匹配 client 或 server 程序的 # 这么奇怪可能与 xinit 对程序名这个参数的限制有关系 # 似乎要求必须以 / 或 . 开头 # 但是 xinit i3 又能正常执行启动i3桌面,又如何解释呢? # xinit 文档里是这么说的 # An alternate client and/or server may be specified on the command line. The de‐ # sired client program and its arguments should be given as the first command line # arguments to xinit. To specify a particular server command line, append a double # dash (--) to the xinit command line (after any client and arguments) followed by # the desired server command. # # Both the client program name and the server program name must begin with a slash # (/) or a period (.). Otherwise, they are treated as an arguments to be appended # to their respective startup lines. This makes it possible to add arguments (for # example, foreground and background colors) without having to retype the whole # command line. # 当前处理的是关于client的参数(--分隔符之前) if [ "$whoseargs" = "client" ]; then # 如何还未设置client及其options(按照约定client路径应该作为第一个参数) if [ x"$client" = x ] && [ x"$clientargs" = x ]; then client="$1"# 设置 client else clientargs="$clientargs$1"# 设置 client options fi else # 当前处理的是关于server的参数(--分隔符之前) if [ x"$server" = x ] && [ x"$serverargs" = x ]; then server="$1"# 设置 server else serverargs="$serverargs$1"# 设置 server options fi fi ;;
# 遇到这个分隔符,表明接下来的是 server 相关参数 --) whoseargs="server" ;; *) if [ "$whoseargs" = "client" ]; then clientargs="$clientargs$1" else # display must be the FIRST server argument if [ x"$serverargs" = x ] && \ expr"$1" : ':[0-9][0-9]*$' > /dev/null 2>&1; then display="$1" else serverargs="$serverargs$1" fi fi ;; esac shift done
# process client arguments # 如果未通过commandline options确定client,就根据顺序选定一个配置脚本作为client if [ x"$client" = x ]; then client=$defaultclient
# For compatibility reasons, only use startxrc if there were no client command line arguments if [ x"$clientargs" = x ]; then if [ -f "$userclientrc" ]; then client=$userclientrc elif [ -f "$sysclientrc" ]; then client=$sysclientrc fi fi fi
# if no client arguments, use defaults if [ x"$clientargs" = x ]; then clientargs=$defaultclientargs fi
# 如果未通过commandline options确定server,就根据顺序选定一个配置脚本作为server # process server arguments if [ x"$server" = x ]; then server=$defaultserver
# When starting the defaultserver start X on the current tty to avoid # the startx session being seen as inactive: # "https://bugzilla.redhat.com/show_bug.cgi?id=806491" tty=$(tty) ifexpr"$tty" : '/dev/tty[0-9][0-9]*$' > /dev/null; then tty_num=$(echo"$tty" | grep -oE '[0-9]+$') vtarg="vt$tty_num -keeptty" fi
# For compatibility reasons, only use xserverrc if there were no server command line arguments if [ x"$serverargs" = x -a x"$display" = x ]; then if [ -f "$userserverrc" ]; then server=$userserverrc elif [ -f "$sysserverrc" ]; then server=$sysserverrc fi fi fi
# if no server arguments, use defaults if [ x"$serverargs" = x ]; then serverargs=$defaultserverargs fi
# 设置vt参数(虚拟终端编号) # if no vt is specified add vtarg (which may be empty) have_vtarg="no" for i in$serverargs; do ifexpr"$i" : 'vt[0-9][0-9]*$' > /dev/null; then have_vtarg="yes" fi done if [ "$have_vtarg" = "no" ]; then serverargs="$serverargs$vtarg" fi
# if no display, use default if [ x"$display" = x ]; then display=$defaultdisplay fi
# 这一部分控制身份验证相关的内容,还没仔细看 if [ x"$enable_xauth" = x1 ] ; then if [ x"$XAUTHORITY" = x ]; then XAUTHORITY=$HOME/.Xauthority export XAUTHORITY fi
removelist=
# set up default Xauth info for this machine
# check for GNU hostname if hostname --version > /dev/null 2>&1; then if [ -z "`hostname --version 2>&1 | grep GNU`" ]; then hostname=`hostname -f` fi fi
if [ -z "$hostname" ]; then hostname=`hostname` fi
authdisplay=${display:-:0}
mcookie=`/usr/bin/mcookie`
iftest x"$mcookie" = x; then echo"Couldn't create cookie" exit 1 fi dummy=0
# create a file with auth information for the server. ':0' is a dummy. xserverauthfile=`mktemp --tmpdir serverauth.XXXXXXXXXX` trap"rm -f '$xserverauthfile'" HUP INT QUIT ILL TRAP KILL BUS TERM xauth -q -f "$xserverauthfile" << EOF add :$dummy . $mcookie EOF
# now add the same credentials to the client authority file # if '$displayname' already exists do not overwrite it as another # server may need it. Add them to the '$xserverauthfile' instead. for displayname in$authdisplay $hostname$authdisplay; do authcookie=`xauth list "$displayname" \ | sed -n "s/.*$displayname[[:space:]*].*[[:space:]*]//p"` 2>/dev/null; if [ "z${authcookie}" = "z" ] ; then xauth -q << EOF add $displayname . $mcookie EOF removelist="$displayname$removelist" else dummy=$(($dummy+1)); xauth -q -f "$xserverauthfile" << EOF add :$dummy . $authcookie EOF fi done fi
if [ x"$enable_xauth" = x1 ] ; then if [ x"$removelist" != x ]; then xauth remove $removelist fi if [ x"$xserverauthfile" != x ]; then rm -f "$xserverauthfile" fi fi
ifcommand -v deallocvt > /dev/null 2>&1; then deallocvt fi
/etc/X11/Xsession.d/50x11-common_determine-startup Determine startup program. The X client to launch as the controlling process (the one that, upon exiting, causes the X server to exit as well) is determined next. If a program or failsafe argument was given and is allowed (see above), it is used as the controlling process. Otherwise, if the line ‘allow-user-xsession’ is present in Xsession.options, a user-specified session program or script is used. In the latter case, two historically popular names for user X session scripts are searched for: $HOME/.xsession and $HOME/.Xsession (note the difference in case). The first one found is used. If the script is not executable, it is marked to be executed with the Bourne shell interpreter, sh. Finally, if none of the above succeeds, the following programs are searched for: /usr/bin/x-session-manager, /usr/bin/x-window-manager, and /usr/bin/x-ter‐ minal-emulator. The first one found is used. If none are found, Xsession aborts with an error.
if [ "x$XDG_SESSION_TYPE" = "xwayland" ] && [ "x$XDG_SESSION_CLASS" != "xgreeter" ] && [ -n "$SHELL" ] && grep -q "$SHELL" /etc/shells && ! (echo"$SHELL" | grep -q "false") && ! (echo"$SHELL" | grep -q "nologin"); then if [ "$1" != '-l' ]; then exec bash -c "exec -l '$SHELL' -c '$0 -l $*'" else shift fi fi
#SETTING=$(G_MESSAGES_DEBUG='' gsettings get org.gnome.system.locale region) #REGION=${SETTING#\'} #REGION=${REGION%\'}
if [ -n "$REGION" ]; then unset LC_TIME LC_NUMERIC LC_MONETARY LC_MEASUREMENT LC_PAPER
if [ "$LANG" != "$REGION" ] ; then export LC_TIME=$REGION export LC_NUMERIC=$REGION export LC_MONETARY=$REGION export LC_MEASUREMENT=$REGION export LC_PAPER=$REGION fi fi
if [ -d "${XDG_RUNTIME_DIR}/systemd" ]; then exec /usr/libexec/gnome-session-binary --systemd "$@" else exec /usr/libexec/gnome-session-binary --builtin"$@" fi
X Forwarding对的带宽要求比另外两者高,因为X Client需要发送所有的绘制指令至X Server,然后由X Server绘制,而VNC技术直接传输图像,从理论上来说X Forward应该需要更少的网络资源才对,而实际上绘制指令往往比较随机,难以有效压缩,但VNC技术能有效利用现有数据压缩技术减少数据量,参考这篇博文
X Forwarding本身没有断线重连机制,即使可以使用screen对终端进行断线重连,也无法恢复经过X Forwarding的应用程序,参考维基百科
An X client cannot generally be detached from one server and reattached to another unless its code specifically provides for it (Emacs is one of the few common programs with this ability). As such, moving an entire session from one X server to another is generally not possible.
一支弓箭可以沿着 x 轴从不同点完全垂直地射出。在坐标 x 处射出一支箭,若有一个气球的直径的开始和结束坐标为 xstart,xend, 且满足 xstart ≤ x ≤ xend,则该气球会被引爆。可以射出的弓箭的数量没有限制。 弓箭一旦被射出之后,可以无限地前进。我们想找到使得所有气球全部被引爆,所需的弓箭的最小数量。