Gnome 工作区使用起来非常方便,但我发现它们很难管理。例如:
我虽然存在但找不到的功能是:
也许我只是对众所周知的事实一无所知。或者,也许 Gnome 提供了一个 API 来进行这种行为的编程。或者也许这是不可能的。
请告知。
附录:在选择这个问题的答案几天后,我发现了一个相对简单的 API 来实现既定目标。该信息作为新答案在下面提供。
$ echo $-
himBHs
$ set -h
$ set -i
bash: set: -i: invalid option
set: usage: set [-abefhkmnptuvxBCHP] [-o option-name] [--] [arg ...]
$ set -m
$ set -B
$ set -H
$ set -s
bash: set: -s: invalid option
set: usage: set [-abefhkmnptuvxBCHP] [-o option-name] [--] [arg ...]
Run Code Online (Sandbox Code Playgroud)
因此我无法使用此方法来恢复 bash 状态
oldstate="$(set +o); set -$-" # POSIXly store all set options.
.
.
set -vx; eval "$oldstate" # restore all options stored.
Run Code Online (Sandbox Code Playgroud)
$ …
Run Code Online (Sandbox Code Playgroud) 按照这些说明,我成功打开了一个新的空窗口,并验证了一个新的 Wayland 套接字已出现:
$ ls -alt /run/user/1000
...
-rw------- 1 craig craig 120 Oct 31 13:54 .mutter-Xwaylandauth.RN8CT0
srwxrwxr-x 1 craig craig 0 Oct 31 13:54 wayland-0
-rw-rw---- 1 craig craig 0 Oct 31 13:54 wayland-0.lock
...
$ mutter --nested --wayland &
(mutter:24172): mutter-WARNING **: 13:55:28.911: WL: unable to lock lockfile /run/user/1000/wayland-0.lock, maybe another compositor is running
$ ls -alt /run/user/1000
...
-rw------- 1 craig craig 120 Oct 31 13:55 .mutter-Xwaylandauth.M06TS0
srwxrwxr-x 1 craig craig 0 Oct 31 13:55 …
Run Code Online (Sandbox Code Playgroud)