<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.3//EN" "http://www.wapforum.org/DTD/wml13.dtd">
<wml>
  <card id="article" title="Fixing Arch Linux file picker/XDG portal after update">
    <p mode="wrap"><a href="#menu">Menu</a></p>
    <p>After an Arch Linux update on my <a href="../comp/t430.wml">T430</a>, the file picker in Firefox stopped working. The messages shown by Firefox in the terminal were vague, so I wasn't sure what exactly went wrong and it took me a while to figure this out.</p>
    <p>I looked up some articles and forum posts and it looked like xdg-desktop-portal might be the issue. The command:</p> 
    <pre>
systemctl --user status xdg-desktop-portal</pre>
    <p>showed me that xdg-desktop-portal was indeed failing to start for some reason.</p>
    <p>I also checked xdg-desktop-portal-gtk:</p>
    <pre>
systemctl --user status xdg-desktop-portal-gtk</pre>
    <p>which complained about being unable to find a display. My first thought was to add some configs to set the DISPLAY environment variable, but that didn't help.</p>
    <p>Finally, I found this thread on the Arch Linux forums: https://bbs.archlinux.org/viewtopic.php?id=308200, where the post by thrtx helped me finally fix the file picker.</p>
    <p>That post contains a script to add to .xinitrc which runs all the scripts in /etc/X11/xinit/xinitrc.d when starting X. The particular script needed by xdg-desktop-portal in that directory is named "50-systemd-user.sh".</p>
    <p>The thread was about X, but I use Wayland. I added a command to run 50-systemd-user.sh to my window manager startup script (~/.config/river/init for river) and it fixed the file picker!</p>
    <p>I hope this will help anyone who had a similar issue after updating their Arch Linux system.</p>
    <p><a href="#article">Top</a></p>
    <p><a href="#menu">Menu</a></p>
  </card>
  <card id="menu" title="crimson_phoneme's website">
    <p mode="wrap"><img src="../gfx/about.wbmp" alt="" /><a href="../index.wml#about">About</a></p>
    <p><img src="../gfx/blog.wbmp" alt="" /><a href="../index.wml#blog">Blog</a></p>
	<p><img src="../gfx/comp.wbmp" alt="" /><a href="../comp.wml">My computers</a></p>
	<p><img src="../gfx/links.wbmp" alt="" /><a href="../links.wml">Links</a></p>
  </card>
</wml>

