brunofin / cohesion

Notion client for Linux
https://flathub.org/apps/details/io.github.brunofin.Cohesion
MIT License
34 stars 1 forks source link

Color scheme: switching between dark/light themes not working in Flatpak without reopening Cohesion (fix inside) #17

Closed Likivik closed 3 months ago

Likivik commented 4 months ago
TLDR: Upgrading Electron version will allow Cohesion to automatically adapt to system theme (dark/light) without having to reopen it.

How to reproduce: 1) Be logged in, set "Settings"->"My Settings"->"Appearance" to "Use system setting" 2) In system settings (KDE, Gnome, etc) switch from dark theme to light or vice versa.

Expected result: Cohesion switches with the system theme Reality: Cohesion remains unchanged. (If you close application completely and reopen it will indeed follow system settings)

How to fix: Upgrading the Electron version to 25.0.0 or higher

If I understand correctly, according to commits, current version of Electron in Cohesion is 21. Not sure how hard it is to upgrade Electron.

Relevant Links:

Example Kde commands to switch themes from terminal: Dark

lookandfeeltool -platform offscreen --apply org.kde.breezedark.desktop
dbus-send --session --dest=org.kde.GtkConfig --type=method_call /GtkConfig org.kde.GtkConfig.setGtkTheme "string:Breeze-dark-gtk"

Light

lookandfeeltool -platform offscreen --apply org.kde.breeze.desktop
dbus-send --session --dest=org.kde.GtkConfig --type=method_call /GtkConfig org.kde.GtkConfig.setGtkTheme "string:Breeze"

https://github.com/brunofin/cohesion/assets/11075952/8c7adeb1-08bb-4898-8df9-c2d20be8f8e9

brunofin commented 4 months ago

Hi, thanks for reporting the issue and providing such an in depth explanation of the problem with how to fix it, amazing!

Cohesions code started as a fork of another electron app (WhatsApp Desktop for Linux) and indeed the electron version is very outdated.

I will try to have a look as soon as possible.

Regards, Bruno Finger

On Thu, 16 May 2024, 6:56 pm Likivik, @.***> wrote:

TLDR: Upgrading Electron version will allow Cohesion to automatically adapt to system theme (dark/light) without having to reopen it.

How to reproduce:

  1. Be logged in, set "Settings"->"My Settings"->"Appearance" to "Use system setting"
  2. In system settings (KDE, Gnome, etc) switch from dark theme to light or vice versa.

Expected result: Cohesion switches with the system theme Reality: Cohesion remains unchanged. (If you close application completely and reopen it will indeed follow system settings)

How to fix: Upgrading the Electron version to 25.0.0 or higher

If I understand correctly, according to commits, current version of Electron in Cohesion is 21. Not sure how hard it is to upgrade Electron.

Relevant Links:

Example Kde commands to switch themes from terminal: Dark

lookandfeeltool -platform offscreen --apply org.kde.breezedark.desktop dbus-send --session --dest=org.kde.GtkConfig --type=method_call /GtkConfig org.kde.GtkConfig.setGtkTheme "string:Breeze-dark-gtk"

Light

lookandfeeltool -platform offscreen --apply org.kde.breeze.desktop dbus-send --session --dest=org.kde.GtkConfig --type=method_call /GtkConfig org.kde.GtkConfig.setGtkTheme "string:Breeze"

— Reply to this email directly, view it on GitHub https://github.com/brunofin/cohesion/issues/17, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB5T7NK6VQD4LBS4U5BTLO3ZCTQMTAVCNFSM6AAAAABH2TJ7DGVHI2DSMVQWIX3LMV43ASLTON2WKOZSGMYDAOJQGE3DQMY . You are receiving this because you are subscribed to this thread.Message ID: @.***>