dkeg
-
- Baconator
- Posts: 10253
- Joined: Thu Sep 16, 2010 11:03 am
- Location: Pfälzerwald
- Contact:
Re: dkeg
^ thanks for the link to windowchef. This sounds very BBQ-ish, so it must be good :)
..gnutella..
Re: dkeg
^ Yeah, its alright. I use it sometimes.
- wm: 2bwm
colors: brownstone
font: dash
wall: hsetroot -solid "$(xrdb -query | awk '/\*background/ {print $2}')" -tile /data/walls/patternweb.png -contrast 0.95
tmux, 2bwmColor, vimb
Work hard; Complain less
-
- Baconator
- Posts: 10253
- Joined: Thu Sep 16, 2010 11:03 am
- Location: Pfälzerwald
- Contact:
Re: dkeg
^^ very nice dkeg.
Thanks for posting part of your script in the scrot. I am always looking for excuses to learn more awk, so whenever I see something like "cat | awk | cut | awk" I wonder if it can be done with one awk. After some experimenting, I think it can; try this:
Note that this sets the array directly, without the intermediate step, and it does not include the # at the beginning of each color. If you need that you can put it back when you use sed to set the colors.
Note also that I am not saying this is better than what you are doing -- I am a big fan of using what works. It's just different, and helped me learn a little more awk, so I thought it might be a useful share.
If it doesn't work, please let me know how it breaks and I will tweak it (or you can, and share how you fixed it please.) (-:
Thanks for posting part of your script in the scrot. I am always looking for excuses to learn more awk, so whenever I see something like "cat | awk | cut | awk" I wonder if it can be done with one awk. After some experimenting, I think it can; try this:
Code: Select all
arr=( $(awk -F# '/\*colors/ gsub("\",\""," ") gsub("\"};","") {for (i=2; i<9; ++i) print $i}' $file) )
Note also that I am not saying this is better than what you are doing -- I am a big fan of using what works. It's just different, and helped me learn a little more awk, so I thought it might be a useful share.
If it doesn't work, please let me know how it breaks and I will tweak it (or you can, and share how you fixed it please.) (-:
Re: dkeg
Thanks pidsely. As is, it did not work. It replaced several delimiters and text throught the entire file. When I get extra time I may look at your solotion and adjust to ensure only replacing the border color definition line. The line looks like this:
The snippet
Returns
And now easily replaceable
2bwmColor
Absolutely appreciate the input. There is much I don't know. Typically solving a problem (generally mine only) piecing together things I do know.
show me the file
find this information
give me only these pieces
Code: Select all
static const char *colors[] = {"#403836","#302724","#734948","#7d8486","#6f5a56","#302724","#2b2320"};
Code: Select all
cat ~/git/2bwm/config.h|awk '/\*colors/ {print $6}'|cut -d '}' -f1|awk '{gsub(/"/," ");print $2,$4,$6,$8,$10,$12,$14}'
Code: Select all
#403836 #302724 #734948 #7d8486 #6f5a56 #302724 #2b2320
2bwmColor
Absolutely appreciate the input. There is much I don't know. Typically solving a problem (generally mine only) piecing together things I do know.
show me the file
find this information
give me only these pieces
Work hard; Complain less
Re: dkeg
I am sure there is a way to do what you want with only awk. But I do these things only to learn. If what you are doing works, use that.
Typically I do it one step at a time, checking the output and adding gsubs as necessary or tweaking the F delimiter. What I posted sets the array to just the color values without the #, so that might be part of the problem. I did not test the seds, only the array contents.
At the very least you don't need to cat to awk, this should work just as well:
If I have time later I might play with this a bit, or I might not.
Typically I do it one step at a time, checking the output and adding gsubs as necessary or tweaking the F delimiter. What I posted sets the array to just the color values without the #, so that might be part of the problem. I did not test the seds, only the array contents.
At the very least you don't need to cat to awk, this should work just as well:
Code: Select all
awk '/\*colors/ {print $6}' ~/git/2bwm/config.h | cut -d '}' -f1 | awk '{gsub(/"/," ");print $2,$4,$6,$8,$10,$12,$14}'
Re: dkeg
The line from config.h:
The awk:
The output:
Does this do what you want?
Code: Select all
static const char *colors[] = {"#35586c","#333333","#7a8c5c","#ff6666","#cc9933","#0d131a","#000000"};
Code: Select all
arr=( $(awk -F\" '/\*colors/ {for (i=2; i<16; i=i+2) print $i}' $file) )
echo arr[0]=${arr[0]}
echo arr[1]=${arr[1]}
echo arr[6]=${arr[6]}
Code: Select all
arr[0]=#35586c
arr[1]=#7a8c5c
arr[6]=#000000
Re: dkeg
What's the color scheme you are using in this scrot?
http://linuxbbq.org/bbs/viewtopic.php?f ... ing#p37147
Thanks.
http://linuxbbq.org/bbs/viewtopic.php?f ... ing#p37147
Thanks.
- ChefIronBelly
- Approved BBQer
- Posts: 1044
- Joined: Mon Jan 13, 2014 6:01 am
- Location: Michigan
Re: dkeg
Looks good how are you liking windowchef?
It's been on my list but just haven't got around to trying it.
It's been on my list but just haven't got around to trying it.
(1/1) Installing: LinuxBBQ...................................[69%]==============[/]
- ivanovnegro
- Minister of Truth
- Posts: 5450
- Joined: Wed Oct 17, 2012 11:12 pm
Re: dkeg
^ Exactly. Oh man, I cannot even begin to mod my desktops slightly to be worth posting here. :D
Re: dkeg
thank you wux, ivan
chef, windowchef is nice. some oddities, but easy to work with. Some of the keybindings that came with the default sxhkdrc were a bit wierd, but easily configurable.
Its easy to set up, and get going. I think working with wmutils made it an easy transition. Its like a hybrid of wmutils and bspwm.
To note, the name makes me think its your wm.
chef, windowchef is nice. some oddities, but easy to work with. Some of the keybindings that came with the default sxhkdrc were a bit wierd, but easily configurable.
Its easy to set up, and get going. I think working with wmutils made it an easy transition. Its like a hybrid of wmutils and bspwm.
To note, the name makes me think its your wm.
Work hard; Complain less
Re: dkeg
That's what I've got.
Into Xresources
For dmenu matching
Any suggestion for boldblack? I'm really crap at matching good well balanced color sets. The ones I'm currently trying suck.
Code: Select all
! blumune
! dkeg
#define bg #0d0f13
#define fg #4a4a4b
#define blk #12151a
!#define bblk #
#define red #294852
#define grn #e2e3e4
#define ylw #6c7d85
#define blu #294852
#define mag #345b67
#define cyn #547b91
#define wht #a8a9aa
Code: Select all
*background:#0d0f13
*foreground:#4a4a4b
*color0: #12151a
*color1: #294852
*color2: #e2e3e4
*color3: #6c7d85
*color4: #294852
*color5: #345b67
*color6: #547b91
*color7: #a8a9aa
Code: Select all
-nb #0d0f13
-nf #4a4a4b
-sb #0d0f13
-sf #547b91
- ChefIronBelly
- Approved BBQer
- Posts: 1044
- Joined: Mon Jan 13, 2014 6:01 am
- Location: Michigan
Re: dkeg
Sounds good thanks for the report. I'm sure as soon as the snow fly s I will get some things going.dkeg wrote: chef, windowchef is nice. some oddities, but easy to work with. Some of the keybindings that came with the default sxhkdrc were a bit wierd, but easily configurable.
Its easy to set up, and get going. I think working with wmutils made it an easy transition. Its like a hybrid of wmutils and bspwm.
To note, the name makes me think its your wm.
(1/1) Installing: LinuxBBQ...................................[69%]==============[/]