You are not logged in.
Naive script that will attempt to 'convert' Xresources style of color definition to the one expected in Lxterminal.conf.
Usage:
urxlx ~/.Xresources
# or
urxlx monokai.txt | xclip
For example, this:
! special
*.foreground: #f8f8f2
*.background: #272822
*.cursorColor: #f8f8f2
! black
*.color0: #272822
*.color8: #75715e
! red
*.color1: #f92672
*.color9: #f92672
...
shall become:
fgcolor=rgb(248,248,242)
bgcolor=rgb(39,40,34)
palette_color_0=rgb(39,40,34)
palette_color_8=rgb(117,113,94)
palette_color_1=rgb(249,38,114)
palette_color_9=rgb(249,38,114)
...
then paste the results to strategic location in ~/.config/lxterminal/lxterminal.conf and win.
Last edited by brontosaurusrex (2019-11-12 21:25:28)
Offline
That’s gonna be a handy tool.
Offline
Very good little utility script to have maybe as part of bunsen-utilities maybe?
Real Men Use Linux
Offline
Something terminal.sexy could implement. I dont believe they have an lxterminal format there.
Offline
Very good little utility script to have maybe as part of bunsen-utilities maybe?
@Bronto, if you feel like adding a -h --help option? I can paste in the GPL copyright bit OK.
...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )
Offline
@johnraff; How is now?
Offline
^Cool. I'll drop it in now.
...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )
Offline
Kickass @Brex
can't wait to try it out
Offline
If you always convert from 6-digit hex to r,g,b this is trivial.
But .Xresources can deal with a large variety of formats & syntax; recognizing the proper entries is the first step, recognizing all possible formats is another step, having some quality control... it's very, very tricky.
I know you called it naïve for a reason, but I have to point this out.
edit: I now realise that your intention is not to convert currently valid Xresources, but convert one of those terminal.sexy etc. files.
Last edited by ohnonot (2019-11-15 07:44:00)
Offline
@ohnonot, I'll take that ^ as a compliment.
convert one of those terminal.sexy etc. files.
Right, semi-automatic solution of some sort. edit: Can you post a problematic .Xresources example?
Last edited by brontosaurusrex (2019-11-16 00:49:48)
Offline
edit: Can you post a problematic .Xresources example?
the problem starts right there: the file could be anywhere, you need to deal with what's actually in the X database (xrdb).
I guess the best way is with appres:
appres URXvt
just an example.
Then there's different colour formats that X recognizes, I think one of them is "*color1: 1/4/9"
I think you can see that it's going to be tricky.
BUT those terminal color websites stick to one or two NOT outdated formats anyhow, so for the intended use case your script is just fine!
Offline