notion-linux
notion-linux copied to clipboard
`notion-enhanced` updates `~/.config/mimeapps.list` unnecessarily.
describe the bug
I'm currently using notion-enhanced installed from your apt repository in Ubuntu 20.04 LTS. Whenever I launch notion-enhanced by clicking the launcher from GNOME desktop, it updates or adds the following line in my ~/.config/mimeapps.list file:
text/html=notion-enhanced.desktop
I explicitly associate my web browser with text/html (e.g. text/html=x-www-browser.desktop), but it keeps getting reverted by notion-enhanced whenever it launches.
expected behaviour
notion-enhanced should never touch my mimeapps.list file.
platform
Ubuntu 20.04.2 LTS
enabled enhancements
- notion-enhancer code
- auto-maximise windows
- tweaks
- integrated scrollbars
- thicker bold text
- scroll database toolbars
- indentation lines
- style: soft
- bulleted list
- numbered list
- to-do list
- toggle list
Thanks for the report, this seems to occur for the notion-desktop package as well so isn't related to Notion Enhancer.
Based on my research, this issue seems to be caused by a bug in xdg-settings which runs when Electron registers the notion: protocol, which allows you to login with Google or Apple via a web browser and return to the app.
I've found these two issues which are relevant: https://github.com/electron/electron/issues/20382 and https://github.com/signalapp/Signal-Desktop/issues/3602
Signal has worked around the xdg-settings bug by removing the dash in their app name, so similarly I would need to change notion-desktop to notiondesktop ... however this would probably break people's settings due to the folder name changing.
Right now I'm not really prioritising development of this app so I'm not sure I can fix this for now, but I think you can do the following to make a custom build which is fixed:
- open
scripts/enhance.shandscripts/_variables-2.sh - replace every
notion-enhancedwithnotionenhancedin those files - run the following:
scripts/build.sh scripts/enhance.sh scripts/package-deb.sh -n notionenhanced
Try this: https://api.cirrus-ci.com/v1/artifact/task/6146237603774464/deb/out/debs/notionenhanced_2.0.11-8_amd64.deb (and uninstall notion-enhanced)
Thank you so much!
By the way, I ended up fixing all Electron-based apps by putting this script (~/.local/bin/xdg-settings) in my PATH:
#!/bin/bash
if [[ "$1 $2" == "set default-url-scheme-handler" ]]; then
DEFAULT_BROWSER="$(xdg-mime query default text/html)"
/usr/bin/xdg-settings "$@"
if [[ "$(xdg-mime query default text/html)" != "$DEFAULT_BROWSER" ]]; then
echo "Reverting the default web browser to $DEFAULT_BROWSER"
xdg-mime default "$DEFAULT_BROWSER" text/html
fi
exit 0
fi
exec /usr/bin/xdg-settings "$@"
I'm afraid I am no longer supporting this project, so I will not be looking into this issue. Please see the updated README for more information. I will leave the issue open, in case of a new maintainer who is able to look into it.