Page 2 of 2

Re: 2WM

Posted: Thu Jun 12, 2014 8:29 am
by rhowaldt
those scrots look gooooooooood!

Re: 2WM

Posted: Sat Nov 05, 2016 10:48 pm
by catfood
1st attempt, but overall achieved what I wanted.
2wmCustom02.png
Possible by technical support from pidsley/ChefIronBelly/machinebacon
Inspired by ChefIronBelly/dkeg
http://www.spycolor.com/web-safe-colors
Vive les années 90
Digging up outdated threads because I'm digging up outdated window managers ;)
BBQ that $#1+!

Re: 2WM

Posted: Sat Nov 05, 2016 11:31 pm
by ChefIronBelly
Glad you got it working now tweak it till you break it :)

Re: 2WM

Posted: Sun Nov 06, 2016 3:51 am
by machinebacon
Yeah, and this one screams for neep/modd fonts (xfonts-jmk package)

Re: 2WM

Posted: Sun Nov 06, 2016 5:36 am
by noo_b_nomnoms
Looking great!

Re: 2WM

Posted: Sun Nov 06, 2016 1:27 pm
by dkeg
Moving this over from the other 2wm-solved thread. Makes more sense to live here.

Still would need to logout and back in, but simple way to match borders to current color scheme.

1. Save as 2wmbcs (2wm border color switch) in $HOME/bin. Generally that is in your $PATH so able to be run simply by typing the name of the script in your terminal to run
2. type this into your terminal "chmod a+x bin/2wmbcs". This will make it executable.
3. If you change your color scheme, run this script to update the border colors within config.h to match with you new color scheme. Update the script to match the color you want. Right now, its set as color0 (black) and color7 (white). Options are below

background
color0 -black
color1-red
color2-green
color3-yellow
color4-blue
color5-magenta
color6-cayan
color7-white
color8-bold black
color9-bold red
color10-bold green
color11-bold yellow
color12-bold blue
color13-bold magenta
color14-bold cayan
color15-bold white

xrdb (Xresources database) is where the colors (amongst other things, i.e. font, etc.) is stored. Just like querying a database, you can query and extract values from xrdb. We'll query xrdb to get current colors and apply them as needed, in this case, updating 2wm's config.h.

Sure, you can manually do it. But what fun is that?

Hope that helps.

Code: Select all

#! /bin/bash
## 2wmbcs
## match border colors from current color scheme for 2wm
## dkeg 2016

## paths - update as needed
dir=$HOME/git/2wm
file=$dir/config.h

## grab current border colors
CurNORM=$(awk '/\NORMCOLOR/ {gsub(/"/,"");print $3}' $file)
CurSEL=$(awk '/\SELCOLOR/ {gsub(/"/,"");print $3}' $file)

## take new colors from xrdb
NewNORM=$(xrdb -query|awk '/\*color0/ {print $2}')
NewSEL=$(xrdb -query|awk '/\*color7/ {print $2}')

## update border colors
sed -i "s/$CurNORM/"$NewNORM"/;
        s/$CurSEL/"$NewSEL"/" $file

## compile
cd $dir && make && sudo make install && cd
Name it and save in your $PATH
Make executable - chmod a+x
run it

Re: 2WM

Posted: Sun Nov 06, 2016 10:50 pm
by catfood
^That went way over my head, lol!

Not sure what $PATH is. Does this script have to have a specific name or specific location to run properly? Or does it just function of the internal paths you specified within the script(dir=where 2wm install file lives, file=look in <-dir for config.h)?

I don't know much about code at all, but am I to assume this basically autowrites over config.h then auto makes and make (re)installs 2wm? Hence the reboot for changes? Is chmod making it so the script can execute without root passwd?

I'm learning (I think), but i got a long ways to go...

Re: 2WM

Posted: Sun Nov 06, 2016 11:25 pm
by pidsley
ixquick, startpage (or google) "what is $PATH linux" -- first hit: http://www.linfo.org/path_env_var.html

ixquick, etc "running a bash script" -- first hit: http://tldp.org/LDP/Bash-Beginners-Guid ... 02_01.html

type this in a terminal:

Code: Select all

man chmod
ixquick, etc "using chmod linux" -- I will let you do this search for yourself

further reading:

http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO.html
http://mywiki.wooledge.org/BashGuide
https://wiki.archlinux.org/index.php/Bash

Re: 2WM

Posted: Sun Nov 06, 2016 11:31 pm
by dkeg
updated my post. Hope it helps.

Re: 2WM

Posted: Mon Nov 07, 2016 7:31 am
by machinebacon
and our good old wiki:
http://linuxbbq.org/wiki/index.php/Environment_variable
http://linuxbbq.org/wiki/index.php/Permissions
Seriously, http://linuxbbq.org/wiki/index.php/Main_Page should be one of the first places to go, we have spent hundreds of hours adding content.

Re: 2WM

Posted: Wed Nov 09, 2016 12:12 am
by catfood
Thanks Pidsley. You don't have to look things up for me. I was just seeing if I kinda understood the jist of what his script did. I bookmarked all those pages. I plan on reading up on those subjects at some point. Just so many relevant to my situiation topics at once lately :D

Thanks dkeg, idiot-proofed. I can make it even if I don't fully understand its function yet.

Thanks bacon. I've started digging through wiki this week. Not sure specific things to research so just kinda reading from the top. Some makes sense, some still does not, or seem relevant yet...

Re: 2WM

Posted: Wed Nov 09, 2016 1:38 am
by pidsley
catfood wrote:Thanks Pidsley. You don't have to look things up for me.
I was trying to show you how to fish instead of giving you fish. (-:

I look things up all the time. Even when I was first learning Linux I found the best way to learn was to look things up myself. I often learned new things I wasn't even looking for...

Re: 2WM

Posted: Wed Nov 09, 2016 11:34 am
by wuxmedia
^ & ^^ guess how I am learning linux :)
"hey co-worker - how does $SOMETHING work"
"google it"
"ahh"