Tdesktop: [Feature Request] Auto theme switch

Created on 6 Aug 2019  Â·  4Comments  Â·  Source: telegramdesktop/tdesktop

Is your feature request related to a problem?

It is inconvenient to manually turn on a light theme in the morning and dark in the evening.

Describe the solution you'd like

I want to be able to set time intervals manually or automatically by location (sunset — dawn)

enhancement

Most helpful comment

It could be better just to respect system dark/light theme switching, rather than having built-in UI for theme switching schedule.

Modern OS like macOS and Linux allow you to switch system theme by schedule.

This is how I see implementation:

  1. Telegram subscribe to OS theme changes.
  2. If the theme was changed, Telegram changes it too.
  3. Switcher allows changing app themes separately until OS will change the theme again.
  4. Telegram saves the last OS theme before closing. During the startup, it compares previous and current OS themes to detect theme changes.

The current best practice to detect a dark theme in Linux is to check -dark ending in the theme name.

All 4 comments

It could be better just to respect system dark/light theme switching, rather than having built-in UI for theme switching schedule.

Modern OS like macOS and Linux allow you to switch system theme by schedule.

This is how I see implementation:

  1. Telegram subscribe to OS theme changes.
  2. If the theme was changed, Telegram changes it too.
  3. Switcher allows changing app themes separately until OS will change the theme again.
  4. Telegram saves the last OS theme before closing. During the startup, it compares previous and current OS themes to detect theme changes.

The current best practice to detect a dark theme in Linux is to check -dark ending in the theme name.

If this is hard to implement, a keyboard shortcut for night theme toggling could be a good workaround in the meantime.

and Linux

There's no universal settings storage on Linux, each DE have it's own settings. KDE uses kdeglobals file, LXQt uses configs in ~/.config/lxqt, reading settings of GTK-based DE requires linking to GTK, which is a harmful dependency for a Qt application (you'll get conflicts with embedded platformtheme plugins, like qgtk3 and qgtk2).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

luisalvarado picture luisalvarado  Â·  3Comments

abhyrz picture abhyrz  Â·  3Comments

DRSDavidSoft picture DRSDavidSoft  Â·  3Comments

Liudvikas picture Liudvikas  Â·  3Comments

matteotumiati picture matteotumiati  Â·  3Comments