Page 21 of 24

Re: dkeg

Posted: Thu Oct 13, 2016 1:34 am
by machinebacon
^ thanks for the link to windowchef. This sounds very BBQ-ish, so it must be good :)

Re: dkeg

Posted: Wed Oct 19, 2016 11:01 pm
by 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
Thanks pidsley for the advice with awk. I've since updated most of my stuff.
brownstone.png

Re: dkeg

Posted: Thu Oct 20, 2016 4:04 am
by machinebacon
^ clever trick with hsetroot there. looks great.

Re: dkeg

Posted: Thu Oct 20, 2016 2:09 pm
by pidsley
^^ 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:

Code: Select all

arr=( $(awk -F# '/\*colors/ gsub("\",\""," ") gsub("\"};","") {for (i=2; i<9; ++i) print $i}' $file) )
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.) (-:

Re: dkeg

Posted: Thu Oct 20, 2016 9:09 pm
by wuxmedia
if they can write Some Game in AWK, then well...

Re: dkeg

Posted: Sat Oct 22, 2016 2:56 pm
by 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:

Code: Select all

static const char *colors[] = {"#403836","#302724","#734948","#7d8486","#6f5a56","#302724","#2b2320"};
The snippet

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}'
Returns

Code: Select all

#403836 #302724 #734948 #7d8486 #6f5a56 #302724 #2b2320
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

Re: dkeg

Posted: Sat Oct 22, 2016 3:16 pm
by pidsley
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:

Code: Select all

awk '/\*colors/ {print $6}' ~/git/2bwm/config.h | cut -d '}' -f1 | awk '{gsub(/"/," ");print $2,$4,$6,$8,$10,$12,$14}'
If I have time later I might play with this a bit, or I might not.

Re: dkeg

Posted: Sat Oct 22, 2016 4:35 pm
by dkeg
Haha, good stuff. Yes, would be interesting to have an alternative solution. I'll try above, then we'll go from there

Re: dkeg

Posted: Sat Oct 22, 2016 6:18 pm
by pidsley
The line from config.h:

Code: Select all

static const char *colors[] = {"#35586c","#333333","#7a8c5c","#ff6666","#cc9933","#0d131a","#000000"};
The awk:

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]}
The output:

Code: Select all

arr[0]=#35586c
arr[1]=#7a8c5c
arr[6]=#000000
Does this do what you want?

Re: dkeg

Posted: Wed Nov 09, 2016 1:23 pm
by Snap
What's the color scheme you are using in this scrot?

http://linuxbbq.org/bbs/viewtopic.php?f ... ing#p37147

Thanks.

Re: dkeg

Posted: Sat Nov 12, 2016 10:18 pm
by dkeg
^ Snap, looks like sncp blumune. There's a full scrot here somewhere. found it

Using windowchef atm. Also updated one of my bar configurations. Using the fork which includes borders, and have it linked so when battery below 10, border turns red
shaded.png

Re: dkeg

Posted: Sun Nov 13, 2016 3:13 pm
by ChefIronBelly
Looks good how are you liking windowchef?

It's been on my list but just haven't got around to trying it.

Re: dkeg

Posted: Sun Nov 13, 2016 6:57 pm
by wuxmedia
loverly dkeg, everything is just so right

Re: dkeg

Posted: Sun Nov 13, 2016 8:42 pm
by ivanovnegro
^ Exactly. Oh man, I cannot even begin to mod my desktops slightly to be worth posting here. :D

Re: dkeg

Posted: Sun Nov 13, 2016 10:32 pm
by 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.

Re: dkeg

Posted: Mon Nov 14, 2016 8:10 am
by Snap
@ dkeg. Thanks so much

Re: dkeg

Posted: Mon Nov 14, 2016 11:55 am
by Snap
That's what I've got.

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
Into Xresources

Code: Select all

*background:#0d0f13
*foreground:#4a4a4b
*color0: #12151a
*color1: #294852
*color2: #e2e3e4
*color3: #6c7d85
*color4: #294852
*color5: #345b67
*color6: #547b91
*color7: #a8a9aa
For dmenu matching

Code: Select all

-nb #0d0f13
-nf #4a4a4b
-sb #0d0f13
-sf #547b91
Any suggestion for boldblack? I'm really crap at matching good well balanced color sets. The ones I'm currently trying suck.

Re: dkeg

Posted: Mon Nov 14, 2016 3:08 pm
by dkeg
I'll share tonight. Had to pull it out of the ashes. Minor refinements.

Re: dkeg

Posted: Mon Nov 14, 2016 7:15 pm
by Nili
^The Boss with sweets :)

Re: dkeg

Posted: Fri Nov 18, 2016 1:43 am
by ChefIronBelly
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.
Sounds good thanks for the report. I'm sure as soon as the snow fly s I will get some things going.