reddit / emacs

XDG-Open uses different browsers between daemon and non-daemon

AblatedSprocket · 2022-08-31 20:38
I changed my default browser to qute using xdg-settings, which works great when running Emacs standalone. When creating a client from my daemon, though, it still uses Firefox and I'm not sure why. Practically speaking, I'm calling these processes from org-open and shr-open, but this behavior shows up when calling \`(call-process "xdg-open" 0 nil 0 "[https://duckduckgo.com](https://duckduckgo.com)")\`. Anybody know what gives?
in-some-other-way · 2022-08-31 21:03
Is your daemon started by an init service?
KleenexQ · 2022-08-31 21:30
This. Use ps or something to see what user the emacs daemon is running as, then you can su into that account and change their xdg-settings Alternatively, change the launch method for the emacs daemon to run as your normal use account
Hammar_Morty · 2022-09-01 04:56
I'd compare your shell environment variables of the two launch methods. If an XDG related variable is present in one and not the other there's your answer and you can use this package to load it from your shell environment. https://github.com/purcell/exec-path-from-shell
Thaodan · 2022-09-11 15:50
Does your de use systemd to setup? In that case it might make sense to require the particular service that sets up the env be started before emacs.
AblatedSprocket · 2022-09-15 22:53
It does, thank you for the suggestion! I hadn't thought of that.