Ubuntu 24.04 运行 Flameshot 报错:Unable to capture screen
是因为 Wayland 兼容性导致的,解决方法:
mkdir ~/.config/autostart/
vi ~/.config/autostart/flameshot-custom.desktop
内容为
[Desktop Entry]
Type=Application
Name=Flameshot wayland fixed
Exec=sh -c "QT_QPA_PLATFORM=wayland flameshot"
X-GNOME-Autostart-enabled=true
https://github.com/flameshot-org/flameshot/issues/3769
script --command "QT_QPA_PLATFORM=wayland flameshot gui" /dev/null
# or
bash -c -- "QT_QPA_PLATFORM=wayland flameshot gui"
# or
sh -c -- "QT_QPA_PLATFORM=wayland flameshot gui"
https://flameshot.org/docs/guide/wayland-help/