git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [INFO] Does Git GUI support Dark Mode on Windows 10 ?

From
SBSashank Bandi <bandi.rao999@gmail.com>
Date
Dec 21, 2021, 16:14 UTC
Message-ID
<CABkJDHF6gS+j6LmT0hr2Z23izb0uBj7cs+XU_14O8wB8yTEpZw@mail.gmail.com>
In-Reply-To
<CAGr--=JiCv3XTrxP=foy+FrxbiYeMf=11eG_6kGBFmBr+P-=Jw@mail.gmail.com>
Show 6 quoted lines
> > Here is the preview I said: https://pasteboard.co/rwUBvWbX6m66.png .
> > The checkbox needs some tinkering.
> > Looking forward to any suggestions.
>
> I would really appreciate it if you could help me make my git-gui look
> like this. What do I need to do, exactly?

It's really good to know that there are people interested in this. But I am sorry to say that my work on it is temporarily stopped as I cannot figure out a way to make the top caption bar of a window black on Windows. I am trying workarounds in C++ by disabling DWM, but they don't seem to work. There is a hidden unpublished API in Windows 10 and 11. But I would like to instead make it work for all OSes starting from Windows 7 at least.

But, I have the code that will make the screenshot possible.
Simply put:
1. Press Win + R
2. Enter "git-gui.exe --trace" and press Enter
3. Paste the following code(indented for clarity) in the console
window(a white window with red and black text) that appears.
    ttk::style theme use default
    ttk::style configure TFrame -background #333
    ttk::style configure TLabelframe -background #333
    ttk::style configure TLabelframe.Label -background #333 -foreground #fff
    ttk::style configure TPanedwindow  -background #333
    ttk::style configure EntryFrame -background #333
    ttk::style configure TScrollbar -background #666 -troughcolor #444
-arrowcolor #fff -arrowsize 15
    ttk::style map TScrollbar -background \
        [list active #333 disabled #000]
    ttk::style configure TLabel -background #333 -foreground #fff
    ttk::style configure TButton -background #333 -foreground #fff
-borderwidth 2 -bordercolor #fff
    ttk::style map TButton -background \
        [list active #555 disabled #111 readonly #000]
    ttk::style configure TCheckbutton -background #333 -foreground
#fff -indicatorbackground #666 -indicatorcolor #fff
    ttk::style map TCheckbutton -background \
        [list active #555 disabled #111 readonly #000]
    ttk::style configure TEntry -fieldbackground #333 -background #333
-foreground #fff -insertcolor #fff
    ttk::style configure TRadiobutton -background #333 -foreground #fff
    ttk::style map TRadiobutton -background \
        [list active #555 disabled #111 readonly #000]
    option add *TCombobox*Listbox.background #333 interactive
    option add *TCombobox*Listbox.foreground #fff interactive
    option add *TCombobox*Listbox.selectBackground blue interactive
    option add *TCombobox*Listbox.selectForeground #fff interactive
    option add *Listbox.Background #333 interactive
    option add *Listbox.Foreground #fff interactive
    option add *Text.Background #333 interactive
    option add *Text.Foreground #fff interactive
    ttk::style configure TSpinbox -fieldbackground #333 -background
#333 -foreground #fff -insertcolor #fff -arrowcolor #fff
    .vpane.lower.commarea.buffer.frame.t configure -background #0d1117
-foreground #fff -insertbackground #fff
    .vpane.lower.diff.body.t configure -background #0d1117 -foreground #fff
    .vpane.files.workdir.list configure -background #0d1117 -foreground #fff
    .vpane.files.index.list configure -background #0d1117 -foreground #fff
    .about_dialog.git_logo configure -background #333
4. Enjoy Git GUI.

If you get "git-gui.exe: command not found", it implies that the exe for Git GUI isn't installed in your path. Then you should manually find the path to the exe(mostly will be in "C:\Program Files\Git\cmd") and execute it in Win + R prompt as "C:\Program Files\Git\cmd\git-gui.exe --trace" and then press Enter. Then enter the code.

The code I provided also changes some of the Tcl/Tk core defaults for maximum dark mode effect. So, it isn't possible to revert to light mode on the run. Closing and reopening all the Git GUI windows will revert it back. I did not test a location for the persistence of dark mode, I will dig deeper into the TCL soon. You should execute the code at the start of the Git GUI for it to work perfectly.

Preview for "Create Branch": [0] "Checkout Branch": [1] "Options": [2]

[0]: https://pasteboard.co/PVXqzigC1Hvs.png [1]: https://pasteboard.co/MRjlQ23ldVKO.png [2]: https://pasteboard.co/HalaJ8Rw1BDU.png

Previous: Birger Skogeng PedersenNext: Birger Skogeng Pedersen
Message 2 of 4 in “Re: [INFO] Does Git GUI support Dark Mode on Windows 10 ?”
  1. Birger Skogeng PedersenDec 13, 2021
  2. Sashank BandiDec 21, 2021
  3. Birger Skogeng PedersenJan 17, 2022
  4. Birger Skogeng PedersenJan 17, 2022

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.