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

Implement XDG Autostart OnlyShowIn and NotShowIn keys. #34

Open
smsegal opened this issue Jan 19, 2021 · 4 comments
Open

Implement XDG Autostart OnlyShowIn and NotShowIn keys. #34

smsegal opened this issue Jan 19, 2021 · 4 comments

Comments

@smsegal
Copy link

smsegal commented Jan 19, 2021

According to the XDG Desktop Autostart spec, a desktop file should only be autostarted in desktop environments matching the "OnlyShowIn" values.

Similarly for NotShowIn, the application should only be started in desktop environments not matching the given values.

This would be great as I woudn't manually have to set XDG_CONFIG_DIRS=$XDG_CONFIG_HOME before calling autostart, and can rely on this command to not start e.g the gnome welcome screen in my sway session while still starting applicable applications in /etc/xdg/autostart.

@Biont
Copy link
Owner

Biont commented Jan 20, 2021

This makes a lot of sense. I hope I find the time to look at this soon. Meanwhile, PRs are of course welcome

@Biont
Copy link
Owner

Biont commented Jan 22, 2021

Hm thinking about this: What DE is the script supposed to assume? The script itself works regardless of DE/WM, so I suppose this setting must be provided externally.

So we'd probably require this as either an ENV var or a direct function parameter, ie. sway-launcher-desktop autostart sway.

Thoughts? Maybe I'm on the wrong track. Is there some commonly used environment variable that we could read?

@smsegal
Copy link
Author

smsegal commented Jan 22, 2021

Yeah, I was reading through the XDG spec and getting frustrated about this specific point. They have a list of approved keys to check against, but seem to leave it up the individual DE on how to actually do this.

XDG_CURRENT_DESKTOP seems like the right env var to check. Gnome sets this to "GNOME", and I believe the other main DE's do the same thing, although I can't find this documented as part of the XDG specs, and I haven't checked myself whether every DE listed in OnlyShowIn sets the variable in the same way.

FWIW, In my sway config, I set XDG_CURRENT_DESKTOP="sway".

@Biont
Copy link
Owner

Biont commented Jan 22, 2021

Alright thanks for the research. I guess this is what it'll work against then

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

No branches or pull requests

2 participants