Giter VIP home page Giter VIP logo

dark-toggle's People

Contributors

rifazn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

dark-toggle's Issues

Doesn't work on themes that have more than two variants

  1. It only changes the theme, not the shell theme. So, the panel, right-click on desktop menu, password box..etc stay at whatever previous theme it was on.

  2. It gets confused and doesn't work when a theme has several variants. For example, it worked flawlessly on Yaru and Pop themes, because they only have (Yaru and Yaru-dark.. and Pop and Pop dark), but when I try it on the zorin theme (which has zorin blue, zorin blue dark, zorin red, zorin red dark etc of other colors), Qogir (which has Qogir, Qogir win, Qogir dark, Qogir win dark, Qogir rounded, Qogir rounded dark....You get what I am saying), it doesn't do anything.

  3. I'd love for this to apply to icons, too.

  4. Automatic switching (sunset to sunrise, for example) would be superb.

Demonstrate dark-toggle running on multiple distros

Videos to be used for demoing Dark Toggle

SwayWM

swaywm.mp4

Use this instead:

dark-toggle-swaywm.mp4

Or this:

dark-toggle-swaywm.mp4

default GNOME Shell

Toggling between Adwaita variants

1.Adwaita.mp4

Plata variants

2.Plata.mp4

ZorinGreen variants

3.ZorinGreen.mp4

Ubu

Demoing on Yaru, Adwaita and Materia themes:

http://0x0.st/osSc.mp4

Themes having a 'compact' version should be added to the source code as the names of their light/dark variants can be easily guessed by the script.

Quite a few themes additionally have light/dark variants of a 'compact' version of the base theme. The naming scheme for these themes seem common enough that they can be easily guessed.

For example: for the "Materia" theme. Normal/base version has variants: Materia, Materia-light, Materia-dark. The "compact" version has names: Materia-compact, Materia-light-compact, Materia-dark-compact. Thankfully, this same convention is used by the themes: "Orchis", "Canta" and "ChromeOS".

Currently, the code is only checking whether a theme name has "dark" at the end of it. If not, then the current theme is assumed to be a light variant (correctly so) and "dark" is just appended to the theme's name. This works no problem for the "base" version of these themes, but this guess is wrong for compact themes as the correct name is "-dark-compact", but our guess is "-compact-dark".

Adding an extra case for compact themes should be enough and the prefered way (as opposed to adding all compact themes in the config).

Themes whose names don't have the usual -dark/-light suffix don't work with the script

The script currently looks for either [lL]ight or [dD]ark suffix in the current gtk theme and tries to replace one suffix with the other, thus guessing the other variant's name. But for themes like "Qogir", "Plata", "Adwaita", etc. that don't follow the naming scheme of having these common suffixes, trying to guess their variants results in an invalid theme name.

This problem was also brought forward by @KarkanAlzwayed in #1.

The obvious solution is to hard-code these theme names and their variants in my code, but I would like to avoid hard-coded theme names (which is data) into my source code (which is logic). Also, having hard-coded values can make maintaining the code more difficult and affect the quality too.

I've decided that in order to support the themes with more varied (read exotic) names, I'll maintain and distribute a default config file with most common light vs. dark theme mappings. For example, in case of "Plata" theme (whose light variant is just Plata and dark variant is Plata-Noir) and Adapta (an extra example), the config file might have a line that looks like

theme_mappings="Plata: Plata-Noir, Adapta: Adapta-Nokto"

The config file might also support mapping icon themes with a gtk application theme, so that when the application theme changes, the icon theme changes as well.

To discuss whether having a config file would certainly be a good idea, and if so, what it should look like and how best to parse it, I've opened up a thread in the Arch Linux Forums. The discussion (ongoing) can be found here: https://bbs.archlinux.org/viewtopic.php?pid=1995916

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.