Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: (just a reminder) Stretchly: Unity not supported for DND detection, yet. #1528

Open
5 tasks done
eduarddrenth opened this issue Dec 24, 2024 · 14 comments · May be fixed by #1531
Open
5 tasks done

[Bug]: (just a reminder) Stretchly: Unity not supported for DND detection, yet. #1528

eduarddrenth opened this issue Dec 24, 2024 · 14 comments · May be fixed by #1531

Comments

@eduarddrenth
Copy link

eduarddrenth commented Dec 24, 2024

Version

  • I'm using version 1.17

Known issues

  • I've checked Known issues

Existing issues

  • I've checked Existing issues

Advanced Preferences

  • I've checked Advanced Preferences

What operating system are you using?

Linux

Operating System Version

ubuntu 24.04.1

Reproduction steps

  1. start journalctl -f
  2. start stretchly
  3. You'll see dnd not supported in the logging and stretchly ignores dnd

Expected Behavior

  • stretchly successfully detects dnd and does not ignore it

Actual Behavior

see reporoduction steps

Relevant log output

No response

Preferences

No response

Additional information

after successfully fixing #1466 (thanks!) dnd does not work anymore on the default ubuntu-gnome desktop

Code of Conduct

  • I agree to follow this project's Code of Conduct
@eduarddrenth eduarddrenth changed the title [Bug]: Stretchly: Unity not supported for DND detection, yet. [Bug]: (just a reminder) Stretchly: Unity not supported for DND detection, yet. Dec 24, 2024
@hovancik
Copy link
Owner

So Gnome and Unity are the same or different? I am confused.

For Gnome I am checking gsettings get org.gnome.desktop.notifications show-banners. I am getting DE value from XDG_CURRENT_DESKTOP

Is this different DE than you had in #1466 (comment)? XDG_CURRENT_DESKTOP=ubuntu:GNOME

@eduarddrenth
Copy link
Author

ubuntu uses an adapted and extended version of gnome on wayland by default.

unity used to be the default but has been abandoned for quite some time now.

I do not understand why on my ubuntu 24.04 stretchly mentions unity not being supported. On what basis does stretchly concludes it is running on a unity desktop?

@eduarddrenth
Copy link
Author

My XDG_CURRENT_DESKTOP is still ubuntu:GNOME

@eduarddrenth
Copy link
Author

$ gsettings get org.gnome.desktop.notifications show-banners
true
$ gsettings get org.gnome.desktop.notifications show-banners
false

@eduarddrenth
Copy link
Author

If you change this line

if (stdout.replace(/[^0-9a-zA-Z]/g, '') === 'false') {

into

if (stdout === 'false' || stdout.replace(/[^0-9a-zA-Z]/g, '') === 'false') {

It should be working on gnome I guess

@eduarddrenth
Copy link
Author

same for mate and cinnamon, I'll test gnome

@eduarddrenth
Copy link
Author

When debugging I see that process.env.XDG_CURRENT_DESKTOP contains Unity as opposed to ubuntu:GNOME in a shell environment. Could be an ubuntu bug I guess.

Both process.env.DESKTOP_SESSION and process.env.XDG_SESSION_DESKTOP contain ubuntu.

When I add unity to the gnome case, dnd works:

      case de.includes('gnome') || de.includes('unity'):

No need to add stdout === 'false' like I suggested earlier.

@hovancik
Copy link
Owner

Thanks for checking it out! I will create some virtual machine with Gnome/Ubuntu and do some tests. Really strange the values are different... I guess I will need to find a way to get values that user sees when checking for them command line?

@hovancik
Copy link
Owner

do you autostart stretchly? can you try starting stretchly after de is loaded and check again what's in ENV/dtretchly?

@eduarddrenth
Copy link
Author

Also when starting after DE is loaded the values for XDG_CURRENT_DESKTOP are different in bash and from npm process.

Found this electron/electron#40795

@eduarddrenth
Copy link
Author

@hovancik
Copy link
Owner

Nice catch! We should then replace all to ORIGINAL_XDG_CURRENT_DESKTOP

@hovancik
Copy link
Owner

@eduarddrenth do you wanna make a PR? You basically solved it :)

@eduarddrenth
Copy link
Author

fine

eduarddrenth added a commit to eduarddrenth/stretchly that referenced this issue Dec 24, 2024
@eduarddrenth eduarddrenth linked a pull request Dec 24, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants