PageSourceSearch

https://www.hestudio.net/assets/termux-x11-tutorial.html-Dm9ei-Fq.js

js hestudio.net collected 2026-09-24 10:37:10 UTC 11,729 bytes, 11 lines download raw bytes

1import{_ as a,c as t,f as n,o as s}from"./app-D7CCjthX.js";const i={};function r(p,e){return s(),t("div",null,[...e[0]||(e[0]=[n(`<p>小粉丝已经求稿两个星期了,不写是不行了。</p><p>termux-x11 是 Termux 的一个图形化项目,官方是这么介绍的。</p><div class="language-text line-numbers-mode" data-highlighter="prismjs" data-ext="text"><pre><code class="language-text"><span class="line">A Termux add-on app providing Android frontend for Xwayland.</span>
2<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div></div></div><hr><h3 id="安装工具" tabindex="-1"><a class="header-anchor" href="#安装工具"><span>安装工具</span></a></h3><p>我们需要在 Termux 和安卓系统上安装工具以成功的运行程序。</p><h4 id="x11-repo-必选" tabindex="-1"><a class="header-anchor" href="#x11-repo-必选"><span>x11-repo(必选)</span></a></h4><p>Termux 官方组件</p><div class="language-bash line-numbers-mode" data-highlighter="prismjs" data-ext="sh"><pre><code class="language-bash"><span class="line">pkg <span class="token function">install</span> x11-repo</span>
3<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div></div></div><h4 id="xfce-可选" tabindex="-1"><a class="header-anchor" href="#xfce-可选"><span>xfce (可选)</span></a></h4><p>Xfce 是类 UNIX 操作系统上的轻量级桌面环境。虽然它致力于快速与低资源消耗,但仍然具有视觉吸引力且易于使用。</p><p>我们安装它的原因主要是因为它对 Termux 的适配性更好,在官方 Github 上也是使用 xfce 作为案例。在本文中将以 xfce 作为案例安装,但你也可以选择其他桌面环境。</p><div class="language-bash line-numbers-mode" data-highlighter="prismjs" data-ext="sh"><pre><code class="language-bash"><span class="line">pkg <span class="token function">install</span> xfce</span>
4<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div></div></div><h4 id="termux-x11-主程序" tabindex="-1"><a class="header-anchor" href="#termux-x11-主程序"><span>termux-x11 (主程序)</span></a></h4><p>你需要同时安装 Termux 和安卓的安装包。</p><p>上面我们说了,它是&quot;A Termux add-on app providing Android frontend for Xwayland&quot;.所以我们首先安装<code>xwayland</code></p><div class="language-bash line-numbers-mode" data-highlighter="prismjs" data-ext="sh"><pre><code class="language-bash"><span class="line">pkg <span class="token function">install</span> xwayland</span>
5<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div></div></div><figure><img src="https://img.hestudio.net/img/2023/04/04/642c47bb0f158.jpg" alt="" tabindex="0" loading="lazy"><figcaption></figcaption></figure><p>访问 <a href="https://github.com/termux/termux-x11/actions/workflows/debug_build.yml" target="_blank" rel="noopener noreferrer">https://github.com/termux/termux-x11/actions/workflows/debug_build.yml</a></p><figure><img src="https://img.hestudio.net/img/2023/04/04/642c448248d66.jpg" alt="Github Action 页面" tabindex="0" loading="lazy"><figcaption>Github Action 页面</figcaption></figure><p>选择最新的一个进入,在底部找到&quot;Artifacts&quot;,下载并解压该文件。</p><figure><img src="https://img.hestudio.net/img/2023/04/04/642c451390c51.jpg" alt="" tabindex="0" loading="lazy"><figcaption></figcaption></figure><figure><img src="https://img.hestudio.net/img/2023/04/04/642c467084ad2.jpg" alt="" tabindex="0" loading="lazy"><figcaption></figcaption></figure><p>我们需要<code>apk</code>和<code>deb</code>文件,先安装<code>apk</code>文件。</p><p>记住文件目录,在 Termux 安装<code>deb</code>文件</p><div class="language-bash line-numbers-mode" data-highlighter="prismjs" data-ext="sh"><pre><code class="language-bash"><span class="line"><span class="token builtin class-name">cd</span> <span class="token punctuation">[</span>你的文件目录<span class="token punctuation">]</span></span>
6<span class="line">
6dpkg <span class="token parameter variable">-i</span> termux-x11-1.02.07-0-all.deb</span>
7<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div><div class="line-number"></div></div></div><figure><img src="https://img.hestudio.net/img/2023/04/04/642c476edb2b1.jpg" alt="" tabindex="0" loading="lazy"><figcaption></figcaption></figure><h3 id="配置程序" tabindex="-1"><a class="header-anchor" href="#配置程序"><span>配置程序</span></a></h3><p>官方为 xfce 提供了命令以启动 xfce,分别是:</p><div class="language-bash line-numbers-mode" data-highlighter="prismjs" data-ext="sh"><pre><code class="language-bash"><span class="line"><span class="token assign-left variable"><span class="token environment constant">XDG_RUNTIME_DIR</span></span><span class="token operator">=</span><span class="token variable">\${TMPDIR}</span> termux-x11 :1 <span class="token operator">&amp;</span></span>
8<span class="line"><span class="token function">env</span> <span class="token assign-left variable"><span class="token environment constant">DISPLAY</span></span><span class="token operator">=</span>:1 dbus-launch --exit-with-session xfce4-session</span>
9<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div><div class="line-number"></div></div></div><p>我们为了启动方便,可以直接将它保存到一个 shell 文件里以供快速启动。</p><p>我这里以<code>x11</code>作为快捷名称,你也可以使用其他的名称。在使用其他的名称时,相应的指令也要更改</p><div class="language-bash line-numbers-mode" data-highlighter="prismjs" data-ext="sh"><pre><code class="language-bash"><span class="line"><span class="token function">vim</span> /data/data/com.termux/files/usr/bin/x11</span>
10<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div></div></div><p>在填写完之后我们要赋予其权限,</p><div class="language-bash line-numbers-mode" data-highlighter="prismjs" data-ext="sh"><pre><code class="language-bash"><span class="line"><span class="token function">chmod</span> +x /data/data/com.termux/files/usr/bin/x11</span>
11<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div></div></div><p>在里面填上上面的启动指令,以后将可以通过对应的指令启动。</p><hr><p>此时功能已经可以使用。</p><figure><img src="https://img.hestudio.net/img/2023/04/05/642c4bb00adba.jpg" alt="" tabindex="0" loading="lazy"><figcaption></figcaption></figure><figure><img src="https://img.hestudio.net/img/2023/04/05/642c4bb4085cc.jpg" alt="" tabindex="0" loading="lazy"><figcaption></figcaption></figure><p>但是这样使用体验感很糟,我们需要一些小设置。</p><p>在长按 termux-x11 的图标后会显示出来几个选项,我们选择&quot;Preferences&quot;</p><figure><img src="https://img.hestudio.net/img/2023/04/05/642c4c601609e.jpg" alt="" tabindex="0" loading="lazy"><figcaption></figcaption></figure><p>将框中的选项按照图示中的设置,并重新打开 termux-x11</p><figure><img src="https://img.hestudio.net/img/2023/04/05/642c4d138279a.png" alt="" tabindex="0" loading="lazy"><figcaption></figcaption></figure><p>可以正常使用了!</p><figure><img src="https://img.hestudio.net/img/2023/04/05/642c4e09d5602.jpg" alt="" tabindex="0" loading="lazy"><figcaption></figcaption></figure>`,47)])])}const l=a(i,[["render",r]]),c=JSON.parse('{"path":"/posts/termux-x11-tutorial.html","title":"termux-x11教程","lang":"zh-CN","frontmatter":{"title":"termux-x11教程","tag":["Linux","VNC","Termux"],"category":["Android"],"description":"小粉丝已经求稿两个星期了,不写是不行了。 termux-x11 是 Termux 的一个图形化项目,官方是这么介绍的。 安装工具 我们需要在 Termux 和安卓系统上安装工具以成功的运行程序。 x11-repo(必选) Termux 官方组件 xfce (可选) Xfce 是类 UNIX 操作系统上的轻量级桌面环境。虽然它致力于快速与低资源消耗,但仍...","head":[["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"termux-x11教程\\",\\"image\\":[\\"https://img.hestudio.net/img/2023/04/04/642c47bb0f158.jpg\\",\\"https://img.hestudio.net/img/2023/04/04/642c448248d66.jpg\\",\\"https://img.hestudio.net/img/2023/04/04/642c451390c51.jpg\\",\\"https://img.hestudio.net/img/2023/04/04/642c467084ad2.jpg\\",\\"https://img.hestudio.net/img/2023/04/04/642c476edb2b1.jpg\\",\\"https://img.hestudio.net/img/2023/04/05/642c4bb00adba.jpg\\",\\"https://img.hestudio.net/img/2023/04/05/642c4bb4085cc.jpg\\",\\"https://img.hestudio.net/img/2023/04/05/642c4c601609e.jpg\\",\\"https://img.hestudio.net/img/2023/04/05/642c4d138279a.png\\",\\"https://img.hestudio.net/img/2023/04/05/642c4e09d5602.jpg\\"],\\"dateModified\\":\\"2025-03-13T06:15:20.000Z\\",\\"author\\":[{\\"@type\\":\\"Person\\",\\"name\\":\\"undefined\\",\\"url\\":\\"https://www.hestudio.net/about/\\",\\"email\\":\\"[email protected]\\"}]}"],["meta",{"property":"og:url","content":"https://www.hestudio.net/posts/termux-x11-tutorial.html"}],["meta",{"property":"og:site_name","content":"heStudio"}],["meta",{"property":"og:title","content":"termux-x11教程"}],["meta",{"property":"og:description","content":"小粉丝已经求稿两个星期了,不写是不行了。 termux-x11 是 Termux 的一个图形化项目,官方是这么介绍的。 安装工具 我们需要在 Termux 和安卓系统上安装工具以成功的运行程序。 x11-repo(必选) Termux 官方组件 xfce (可选) Xfce 是类 UNIX 操作系统上的轻量级桌面环境。虽然它致力于快速与低资源消耗,但仍..."}],["meta",{"property":"og:type","content":"article"}],["meta",{"property":"og:image","content":"https://img.hestudio.net/img/2023/04/04/642c47bb0f158.jpg"}],["meta",{"property":"og:locale","content":"zh-CN"}
11],["meta",{"property":"og:updated_time","content":"2025-03-13T06:15:20.000Z"}],["meta",{"property":"article:tag","content":"Termux"}],["meta",{"property":"article:tag","content":"VNC"}],["meta",{"property":"article:tag","content":"Linux"}],["meta",{"property":"article:modified_time","content":"2025-03-13T06:15:20.000Z"}]]},"git":{"createdTime":1680625278000,"updatedTime":1741846520000},"readingTime":{"minutes":1.99,"words":597},"filePathRelative":"posts/termux-x11-tutorial.md","excerpt":"<p>小粉丝已经求稿两个星期了,不写是不行了。</p>\\n<p>termux-x11 是 Termux 的一个图形化项目,官方是这么介绍的。</p>\\n<div class=\\"language-text line-numbers-mode\\" data-highlighter=\\"prismjs\\" data-ext=\\"text\\"><pre><code class=\\"language-text\\"><span class=\\"line\\">A Termux add-on app providing Android frontend for Xwayland.</span>\\n<span class=\\"line\\"></span></code></pre>\\n<div class=\\"line-numbers\\" aria-hidden=\\"true\\" style=\\"counter-reset:line-number 0\\"><div class=\\"line-number\\"></div></div></div>","autoDesc":true}');export{l as comp,c as data};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.