Welcome to HBH! If you have tried to register and didn't get a verification email, please using the following link to resend the verification email.

X Window system question


ghost's Avatar
0 0

does anyone know how to assign colours other than black and white to a window in xlib? im using X11R6 :)

thanks


ghost's Avatar
0 0

many Kudos to you for running X11! It's a great interface to work with.

Now, to change the colors, it's pretty simple, once you get the hang of it. You have to use a reference guide (simple) if you don't have the colors/palette memorized.

Here it goes. Modify the following file:

~/.Xdefaults FYI: ~ means home dirctory, so in your case it'll be: /home/mrnoob/.Xdefaults notice the . (dot) implying that it's hidden, by default. So you'll have to unhide it, first, and then edit it using any editor (Kate, KText, etc…)

Use the next as a reference guide (for naming the color, instead of using numerical representations).

My .Xdefaults file looks like this:

 Mwm*keyboardFocusPolicy:        pointer
    Mwm*frameBorderWidth:           3
    Mwm*BoundaryWidth:               2
    Mwm*showFeedback:                resize
    Mwm*focusAutoRaise:               True
    Mwm*autoRaiseDelay:               400


    Mosaic*trackVisitedAnchors:     True
    Mosaic*useGlobalHistory:        False
    Mosaic*catchPriorAndNext:       True


    XTerm*font:                     7x14
    XTerm*scrollbar:                True
    XTerm*background:               Black
    XTerm*foreground:               Green

    ! Configuring xlock

    XLock.mode:             	random
    XLock.background:       	SteelBlue
    XLock.foreground:       	Black
    XLock.username:         	mr_noob 
    XLock.password:         	mr_noobs_password 

    XLock.validate:         	*clickety-click*

    XBuffy.boxfile:         	.xbuffyrc
    XBuffy.geometry:       		-74-0
    XBuffy.horizontal:      	True

    xdaliclock.seconds:     	False
    xdaliclock.geometry:    	70x64-0+0
    xdaliclock.font:        	

    XLoad.highlight:        	Green
    XLoad.foreground:       	Green
    XLoad.background:       	Black
    XLoad.geometry:        		70x70-0+64

ghost's Avatar
0 0

Notice how the configuration is somewhat application centric?

That means you can customize certain binaries' windows/fonts. For example, for emacs do something like:

EmacsForeground: black EmacsCursorColor: red Emacs*pointerColor: yellow

If you can't find the ./Xresources file in your $HOME [DIR] then look in: /usr/local/X11R5/lib/X11/Xresources

Good Luck!


ghost's Avatar
0 0

thanks ^^ but i meant the C++ xlib interface to it :) never mind google found me what i was looking for :)


ghost's Avatar
0 0

and yes i do know what ~ and .filename mean lol i have been playing wargames and running linux for some time now :)


ghost's Avatar
0 0

pfff … coulda said that earlier, punk! lol, jk. Well, CONGRATS!


ghost's Avatar
0 0

why couldnt windows graphical programming be this easy O.o


ghost's Avatar
0 0

aw, Come on, the WIN32 API isn't that hard. hahah


ghost's Avatar
0 0

:o youre joking right? lol its ridiculous