You are not logged in.
is there any way to retrieve the current background color in the active terminal (xterm/konsole/whatever)? preferably in c.
tnx.
Offline
z4ziggy
You could grab xtermcontrol
then
xtermcontrol --get-bg
Sorry not much clue with C but i think theres a function http://www.freepascal.org/docs-html/rtl … tattr.html
that may point in right direction.
good luck
Kern
Offline
tnx for the reply.
seems xterminfo just gets stuck under my xorg, had to kill it. also, it seems it retrieves xterm info only, and im looking for more common way to retrieve bg color from any possible terminal.
the link (tccgetattr) is for a freePascal function, which grabs terminal info - but no background either...
still looking...
Offline
in C it wouldn't be that hard, however it gets difficult when you talk about different WMs...
Basically, you iterate over each top level window (the frame)... but you'd need a way to determin which child of the fram is the application (the title bar, buttons, and possibly status bar are all children as well).
Then you just call a "property get" on the app window...
the main difficulty is going to be different window managers...
Offline
well, tnx for that phrakture.
i think im gonna do a quick "bail out" and force my own background color on the terminal instead of drowning in an unknown and unrelated code... (/me raises the lazy flag)
Offline