Skip to content
This repository has been archived by the owner on Nov 29, 2021. It is now read-only.

notion-enhanced updates ~/.config/mimeapps.list unnecessarily. #42

Open
trustin opened this issue Apr 13, 2021 · 5 comments
Open

notion-enhanced updates ~/.config/mimeapps.list unnecessarily. #42

trustin opened this issue Apr 13, 2021 · 5 comments

Comments

@trustin
Copy link

trustin commented Apr 13, 2021

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
@valin4tor
Copy link
Owner

valin4tor commented Apr 13, 2021

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: electron/electron#20382 and signalapp/Signal-Desktop#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.sh and scripts/_variables-2.sh
  • replace every notion-enhanced with notionenhanced in those files
  • run the following:
    scripts/build.sh
    scripts/enhance.sh
    scripts/package-deb.sh -n notionenhanced
    

valin4tor pushed a commit that referenced this issue Apr 13, 2021
@valin4tor
Copy link
Owner

valin4tor commented Apr 13, 2021

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)

@trustin
Copy link
Author

trustin commented Apr 13, 2021

Thank you so much!

@trustin
Copy link
Author

trustin commented Apr 13, 2021

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 "$@"

@valin4tor
Copy link
Owner

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants