Gitk "require Tk"

Enabling run gitk from CLI on ubuntu I am getting this error

vihaan@Trojan :~$ gitk
application-specific initialization failed: unknown color name "S_base3"
Error in startup script: unknown color name "S_base3"
    (database entry for "-background" in widget ".")
    invoked from within
"load /usr/lib/x86_64-linux-gnu/libtk8.6.so Tk"
    ("package ifneeded Tk 8.6.1" script)
    invoked from within
"package require Tk"
    (file "/usr/bin/gitk" line 10)

      

How to fix it?

+3


source to share


1 answer


It's quite complicated, old school X11.

Your Xrdb contains the spec of what the background color for the main gitk window will be S_base3

, but doesn't know how to parse that color name, neither Tk itself nor Xserver itself, which means you get an error while creating the top level widget when the gitk app tries create its own main window (it tries to parse the Xrmdb entry and do the programmatic equivalent of exclamation "Wat !?").

Xrdb โ€‹โ€‹is a way of specifying default values โ€‹โ€‹for various attributes of GUI applications. One of these attributes is the background color. In your case, you probably wrote something like this:

Gitk.background: S_base3

      

Or maybe:

*.background: S_base3

      



Xrdb โ€‹โ€‹is indeed supported in the X window's root ( RESOURCE_MANAGER

) property and is global to all applications. The default content is usually initialized from a file in your home directory (usually ~/.Xresources

), but they can also be installed in the desktop environment. Designing what is causing the problem can be tricky since many programs can write to this property.

The program xrdb

can be used to edit the resource database. For example, you can use:

xrdb -query >xprops.txt

      

to list the current content xprops.txt

. Edit the file to get some reasonable values, then use:

xrdb -load <xprops.txt

      

to set new values.

+5


source







All Articles