您尚未登录。

公告

[通告] 本论坛迁移啦~请前往位于 https://forum.archlinuxcn.org/ 的新论坛。所有帖子和参与的用户都已经迁移。

您正在访问的是原 bbs.archlinuxcn.org 的静态存档。本页面的新地址位于 https://forum.archlinuxcn.org/t/topic/14183

#1 2025-07-07 13:15:15

zjf_0731@163.com
会员
注册时间: 2024-10-30
帖子: 19

hyprland共享屏幕失败,查看日志报错

journalctl --user -xeu xdg-desktop-portal-hyprland.service

Jul 07 11:19:19 archlinux xdg-desktop-portal-hyprland[34302]: [LOG] Initializing xdph...
Jul 07 11:19:19 archlinux xdg-desktop-portal-hyprland[34302]: [CRITICAL] Couldn't create the dbus connection ([org.freedesktop.DBus.Error.FileExists] Failed to request bus name (File exists))
Jul 07 11:19:19 archlinux systemd[1016]: xdg-desktop-portal-hyprland.service: Main process exited, code=exited, status=1/FAILURE

离线

#2 2025-08-07 05:21:21

sky03
会员
注册时间: 2020-08-17
帖子: 12

Re: hyprland共享屏幕失败,查看日志报错

hyprland配置文件加上一句执行脚本 exec-once reset-desktop-portal.sh

再创建文件 .config/hyprland/reset-desktop-portal.sh,文件内容:

#!/bin/sh
sleep 1
killall -e xdg-desktop-portal-hyprland
killall xdg-desktop-portal
/usr/lib/xdg-desktop-portal-hyprland &
sleep 2
/usr/lib/xdg-desktop-portal &

再给这个文件夹加上执行权限:
chmod ug+x .config/hyprland/reset-desktop-portal.sh

应该就好了

最近编辑记录 sky03 (2025-08-07 05:21:44)

离线

页脚