v1cont / yad

Yet Another Dialog
GNU General Public License v3.0
685 stars 57 forks source link

Running YAD scripts in Gnome with Wayland #216

Open VlaSard opened 1 year ago

VlaSard commented 1 year ago

The following command can be used to run the script:

GDK_BACKEND=x11 <command>

It works in Gnome, no problems. For other DEs the command may be different.

sonic2kk commented 1 year ago

Fwiw Yad works just fine ootb on Plasma Wayland, the only limitation I know of is a lack of notebook support 🙂

Since Yad is GTK-based the environment variable set here should not differ across DEs, unless something odd is going on. At least on Plasma, the environment variable is still the one you linked.

VlaSard commented 1 year ago

The main laptop is running Gnome on Wyland or X11. When on Wyland, you need to write GDK_BACKEND. On X11, everything works. I watched Plasma on a virtual machine, but it's also on X11. Same behavior on Fedora. When using Wyland and setting GDK_BACKEND=x11, notebook works. My main system is Manjaro on Gnome.

sonic2kk commented 1 year ago

By notebook, I meant a tabbed panel like the one in the System Information example :-)

VlaSard commented 1 year ago

That's right. That works, too. A screenshot from the virtual machine.

sonic2kk commented 1 year ago

On Plasma Wayland then, unless you specify GDK_BACKEND=x11, notebooks won't work. I guess they work on GNOME natively on Wayland. Interesting!

VlaSard commented 1 year ago

The only Plasma I have available is on X11. I can't switch to Wayland. But originally YAD has no support for Wayland. This is like a workaround for running under Wayland. By the way, the tray icon will not appear under Wayland.

sonic2kk commented 1 year ago

Indeed, though as a neat workaround you can get the tray icon will appear if you force the tray icon process to use X11, SteamTinkerLaunch does this :-) Though this has the unfortunate side effect of appearing blurry on scaled displays

GDK_BACKEND=x11 "$YAD" --image="$STLICON" --notification --item-separator=","\
            --menu="$TRAY_KILLSWITCH,bash -c killProtonGame \
            |$TRAY_PAUSE,bash -c PauseGame \
            |$TRAY_SHADER,bash -c TrayShaderMenu \
            |$TRAY_VR,bash -c TrayVR \
            |$TRAY_PICKWINDOW,bash -c TrayPickWin \
            |$TRAY_SRC,bash -c TraySRC \
            |$TRAY_UWT,bash -c TrayUWT \
            |$TRAY_LCS,bash -c TrayLCS \
            |$GUI_GAFI,bash -c TrayGameFiles \
            |$TRAY_UPL,bash -c TrayProtonList \
            |$FBUT_GUISET_MO,bash -c TrayMO2 \ 
            |$TRAY_OPENISSUE,bash -c TrayOpenIssue" \
            --text="$TRAY_TOOLTIP" >/dev/null 2>/dev/null &
            YADTRAYPID="$!"