<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Wayland on Haseeb Majid</title>
    <link>https://haseebmajid.dev/tags/wayland/</link>
    <description>Recent content in Wayland on Haseeb Majid</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en</language>
    <lastBuildDate>Tue, 21 Nov 2023 00:00:00 +0000</lastBuildDate><atom:link href="https://haseebmajid.dev/tags/wayland/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>TIL: How to Start Gnome Wayland Session From TTY</title>
      <link>https://haseebmajid.dev/posts/2023-11-21-til-how-to-start-gnome-wayland-session-from-tty/</link>
      <pubDate>Tue, 21 Nov 2023 00:00:00 +0000</pubDate>
      
      <guid>https://haseebmajid.dev/posts/2023-11-21-til-how-to-start-gnome-wayland-session-from-tty/</guid>
      <description>&lt;p&gt;&lt;strong&gt;TIL: How to Start Gnome Wayland Session From TTY&lt;/strong&gt;&lt;/p&gt;
&lt;details
  class=&#34;notice info&#34;
  open=&#34;true&#34;
&gt;
    &lt;summary class=&#34;notice-title&#34;&gt;Better Version&lt;/summary&gt;
  
  &lt;p&gt;veganomy posted a better version: &lt;a href=&#34;https://github.com/hmajid2301/blog/issues/2&#34;&gt;https://github.com/hmajid2301/blog/issues/2&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Copy &lt;code&gt;org.gnome.Shell.desktop&lt;/code&gt; file locally:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;$ cp /usr/share/applications/org.gnome.Shell.desktop ~/.local/share/applications/org.gnome.Shell-Wayland.desktop
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Edit it so that it so that it runs &lt;code&gt;gnome-shell&lt;/code&gt; as a wayland compositor:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;$ less ~/.local/share/applications/org.gnome.Shell-Wayland.desktop
...
Exec=/usr/bin/gnome-shell --wayland
...
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Copy &lt;code&gt;gnome.session&lt;/code&gt; file locally:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;$ cp /usr/share/gnome-session/sessions/gnome.session ~/.config/gnome-session/sessions/gnome-wayland.session
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Edit it to use &lt;code&gt;org.gnome.Shell-Wayland&lt;/code&gt;:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;$ less ~/.config/gnome-session/sessions/gnome-wayland.session
...
RequiredComponents=org.gnome.Shell-Wayland;gnome-settings-daemon;
...
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Now create an executable &lt;code&gt;~/.local/bin/gnome&lt;/code&gt; :&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;
#!/bin/sh

[ -r /bin/gnome-session ] &amp;amp;&amp;amp; {
	export \
		EGL_PLATFORM=wayland \
		GDK_BACKEND=wayland \
		XDG_SESSION_DESKTOP=gnome
	/bin/gnome-session --session=gnome-wayland
}
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Make sure this directory is in your &lt;code&gt;~/.bash_profile&lt;/code&gt; $PATH : &lt;code&gt;export PATH=~/.local/bin:$PATH&lt;/code&gt;&lt;/p&gt;</description>
      <content:encoded><![CDATA[<p><strong>TIL: How to Start Gnome Wayland Session From TTY</strong></p>
<details
  class="notice info"
  open="true"
>
    <summary class="notice-title">Better Version</summary>
  
  <p>veganomy posted a better version: <a href="https://github.com/hmajid2301/blog/issues/2">https://github.com/hmajid2301/blog/issues/2</a></p>
<p>Copy <code>org.gnome.Shell.desktop</code> file locally:</p>
<pre tabindex="0"><code>$ cp /usr/share/applications/org.gnome.Shell.desktop ~/.local/share/applications/org.gnome.Shell-Wayland.desktop
</code></pre><p>Edit it so that it so that it runs <code>gnome-shell</code> as a wayland compositor:</p>
<pre tabindex="0"><code>$ less ~/.local/share/applications/org.gnome.Shell-Wayland.desktop
...
Exec=/usr/bin/gnome-shell --wayland
...
</code></pre><p>Copy <code>gnome.session</code> file locally:</p>
<pre tabindex="0"><code>$ cp /usr/share/gnome-session/sessions/gnome.session ~/.config/gnome-session/sessions/gnome-wayland.session
</code></pre><p>Edit it to use <code>org.gnome.Shell-Wayland</code>:</p>
<pre tabindex="0"><code>$ less ~/.config/gnome-session/sessions/gnome-wayland.session
...
RequiredComponents=org.gnome.Shell-Wayland;gnome-settings-daemon;
...
</code></pre><p>Now create an executable <code>~/.local/bin/gnome</code> :</p>
<pre tabindex="0"><code>
#!/bin/sh

[ -r /bin/gnome-session ] &amp;&amp; {
	export \
		EGL_PLATFORM=wayland \
		GDK_BACKEND=wayland \
		XDG_SESSION_DESKTOP=gnome
	/bin/gnome-session --session=gnome-wayland
}
</code></pre><p>Make sure this directory is in your <code>~/.bash_profile</code> $PATH : <code>export PATH=~/.local/bin:$PATH</code></p>
<p>Now you can run a wayland session through TTY :</p>
<pre tabindex="0"><code>$ gnome
</code></pre>
</details>

<p>Recently, I moved to Hyprland on Ubuntu. I wanted to start gnome in another TTY (teletype). It was more effort to find than I expected:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl"><span class="c1"># Go to teletype</span>
</span></span><span class="line"><span class="cl">CTRL+ALT+1
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">dbus-run-session -- gnome-shell --display-server --wayland
</span></span></code></pre></div><p>That&rsquo;s it, short and sweet, this post! You now started gnome in a Wayland session.</p>
]]></content:encoded>
    </item>
    
  </channel>
</rss>
