2WM

Forum rules
Post your scrot in the appropriate section. If the section does not exist yet - open a new thread ;)
User avatar
rhowaldt
Dog
Posts: 4567
Joined: Wed Oct 17, 2012 9:01 am
Contact:

Re: 2WM

Unread post by rhowaldt » Thu Jun 12, 2014 8:29 am

those scrots look gooooooooood!
All statements are true in some sense, false in some sense, meaningless in some sense, true and false in some sense, true and meaningless in some sense, false and meaningless in some sense, and true and false and meaningless in some sense.

User avatar
catfood
Cam Whore
Posts: 95
Joined: Tue Oct 04, 2016 1:25 am

Re: 2WM

Unread post by catfood » Sat Nov 05, 2016 10:48 pm

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+!
1wm, 2wm, red-berries, bleuets o'

User avatar
ChefIronBelly
Xmonad nomad
Posts: 882
Joined: Mon Jan 13, 2014 6:01 am
Location: zero_one

Re: 2WM

Unread post by ChefIronBelly » Sat Nov 05, 2016 11:31 pm

Glad you got it working now tweak it till you break it :)
(1/1) Installing: LinuxBBQ...................................[69%]==============[/]

machinebacon
Baconator
Posts: 10148
Joined: Thu Sep 16, 2010 11:03 am
Location: Chinkistan
Contact:

Re: 2WM

Unread post by machinebacon » Sun Nov 06, 2016 3:51 am

Yeah, and this one screams for neep/modd fonts (xfonts-jmk package)
..gnutella..

User avatar
noo_b_nomnoms
loves a good Bukkake
Posts: 477
Joined: Sat Jan 09, 2016 5:13 pm
Location: USA

Re: 2WM

Unread post by noo_b_nomnoms » Sun Nov 06, 2016 5:36 am

Looking great!
Sir! Put down the hammer and slowly step away from the computer.

User avatar
dkeg
Configurator
Posts: 3781
Joined: Sun Nov 18, 2012 9:23 pm
Location: Mid-Atlantic Grill

Re: 2WM

Unread post by dkeg » Sun Nov 06, 2016 1:27 pm

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

Work hard; Complain less

User avatar
catfood
Cam Whore
Posts: 95
Joined: Tue Oct 04, 2016 1:25 am

Re: 2WM

Unread post by catfood » Sun Nov 06, 2016 10:50 pm

^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...
1wm, 2wm, red-berries, bleuets o'

pidsley
Hermit
Posts: 2348
Joined: Wed Oct 17, 2012 12:31 pm

Re: 2WM

Unread post by pidsley » Sun Nov 06, 2016 11:25 pm

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

User avatar
dkeg
Configurator
Posts: 3781
Joined: Sun Nov 18, 2012 9:23 pm
Location: Mid-Atlantic Grill

Re: 2WM

Unread post by dkeg » Sun Nov 06, 2016 11:31 pm

updated my post. Hope it helps.

Work hard; Complain less

machinebacon
Baconator
Posts: 10148
Joined: Thu Sep 16, 2010 11:03 am
Location: Chinkistan
Contact:

Re: 2WM

Unread post by machinebacon » Mon Nov 07, 2016 7:31 am

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.
..gnutella..

User avatar
catfood
Cam Whore
Posts: 95
Joined: Tue Oct 04, 2016 1:25 am

Re: 2WM

Unread post by catfood » Wed Nov 09, 2016 12:12 am

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...
1wm, 2wm, red-berries, bleuets o'

pidsley
Hermit
Posts: 2348
Joined: Wed Oct 17, 2012 12:31 pm

Re: 2WM

Unread post by pidsley » Wed Nov 09, 2016 1:38 am

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...

User avatar
wuxmedia
Grasshopper
Posts: 5349
Joined: Wed Oct 17, 2012 11:32 am
Location: UK
Contact:

Re: 2WM

Unread post by wuxmedia » Wed Nov 09, 2016 11:34 am

^ & ^^ guess how I am learning linux :)
"hey co-worker - how does $SOMETHING work"
"google it"
"ahh"
"Seek, and Ye shall find"
"Github | Chooons | Site"

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest