wmutils / sxhkd

User avatar
ChefIronBelly
Approved BBQer
Posts: 1044
Joined: Mon Jan 13, 2014 6:01 am
Location: Michigan

Re: wmutils / sxhkd

Unread post by ChefIronBelly » Mon Aug 17, 2015 9:46 pm

Ok got it and you about nailed it. I went back to just focus and hadnt added the pulse bit. That is how he does the active window. The other focus.sh I never used but seen the border size and color settings at the top and had them confused. All sorted out now thanks for the pointer.

Edit damn I feel dumb :)
(1/1) Installing: LinuxBBQ...................................[69%]==============[/]

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

Re: wmutils / sxhkd

Unread post by dkeg » Tue Aug 18, 2015 2:19 am

Yeah, it can get a bit disparate. This is how I have it working.
Identified the similar scripts
  • focus_wrapper and yawee
    focus.sh and vroum
    closest and focus (closest is a bit different, and for whatever reason, I can't get it to work)
    rainbow and pulse
    groups and groaw
Then pick and choose. This is what I'm using:
  • Yawee - focus new windows, to place new windows in center and focus the next window if window in focus is killed (depends on vroum). Also changed by taking out the chwb pieces to keep my borders and colors consistent
    Pulse - sourcing my colr script to use current xcolors. I also added to it to take the current BW from focus.sh (which is sourced by focus_wrapper).
    Focus.sh - again, I'm sourcing colr for active and inactive border colors
    Corners - added padding; giving it X and Y, and division by BW to keep it consistent in case I change BW
    Groaw - for groups
    Maxv - maximize vertically (this is new)
    Fullsreen, tile and switch_grid
Put all scripts being used and sourced in a seperate wmtls directory

Work hard; Complain less

User avatar
ChefIronBelly
Approved BBQer
Posts: 1044
Joined: Mon Jan 13, 2014 6:01 am
Location: Michigan

Re: wmutils / sxhkd

Unread post by ChefIronBelly » Tue Aug 18, 2015 1:09 pm

Good summary I updated my post above .sxhkdrc and statusbar.
I ended up removing pulse and setting window border size and colors in vroum.

I did the same moved the used scripts to

Code: Select all

l ~/wmutils
-rwxr-xr-x 1 chef users 376 Aug 12 14:00 corner.sh
-rwxr-xr-x 1 chef users 824 Aug 12 14:00 focus
-rwxr-xr-x 1 chef users 247 Jun 24 05:13 focus_watcher.sh
-rwxr-xr-x 1 chef users 1251 Jun 24 05:13 fullscreen.sh
-rwxr-xr-x 1 chef users 1694 Aug 12 14:00 groaw
-rwxr-xr-x 1 chef users 903 Jun 24 05:13 tile.sh
-rwxr-xr-x 1 chef users 1253 Aug 18 07:27 vroum
-rwxr-xr-x 1 chef users 7940 Aug 12 08:10 xwait
-rwxr-xr-x 1 chef users 448 Aug 12 14:00 yawee
(1/1) Installing: LinuxBBQ...................................[69%]==============[/]

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

Re: wmutils / sxhkd

Unread post by dkeg » Tue Aug 18, 2015 1:21 pm

Yay! Isn't this fun! Next project probably Hipster as base with wm-utils

Work hard; Complain less

User avatar
ChefIronBelly
Approved BBQer
Posts: 1044
Joined: Mon Jan 13, 2014 6:01 am
Location: Michigan

Re: wmutils / sxhkd

Unread post by ChefIronBelly » Wed Aug 19, 2015 1:28 pm

I just finished a fresh new install on a laptop. Everything is dialed in minus a issue with groups (groaw) that I need to sort out. I thought it was a privilege issue where groups are written to a sub /tmp/groaw.d/ but the error doesn't give a cant create but a directory doesn't exist . I moved the pointer to ~/tmp/groaw.d/ just to isolate privilege and get the same results. I need to take a closer look and make sure I have a complete understanding of that and what it is doing.
(1/1) Installing: LinuxBBQ...................................[69%]==============[/]

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

Re: wmutils / sxhkd

Unread post by dkeg » Wed Aug 19, 2015 1:35 pm

What is the base? BSD or Debian. And for the obvious, you do have a /tmp or ~/tmp and it's not temp? How about a member of the wheel group?

Work hard; Complain less

User avatar
ChefIronBelly
Approved BBQer
Posts: 1044
Joined: Mon Jan 13, 2014 6:01 am
Location: Michigan

Re: wmutils / sxhkd

Unread post by ChefIronBelly » Wed Aug 19, 2015 1:50 pm

BSD and yes and yes. I need to get back into this today I'm sure its operator error :)

EDIT: just for the sake of completeness.

Code: Select all

$ uname -rs
NetBSD 7.0_RC2

Code: Select all

$ l /
drwxrwxrwt 7 chef users 512 Aug 19 08:05 tmp

Code: Select all

$ l ~/
drwxr-xr-x 3 chef users 512 Aug 18 13:22 tmp

Code: Select all

$ groups
users wheel

Going to change owner back on the /tmp to chef:wheel what is was originally.
Last edited by ChefIronBelly on Wed Aug 19, 2015 4:40 pm, edited 2 times in total.
(1/1) Installing: LinuxBBQ...................................[69%]==============[/]

User avatar
ChefIronBelly
Approved BBQer
Posts: 1044
Joined: Mon Jan 13, 2014 6:01 am
Location: Michigan

Re: wmutils / sxhkd

Unread post by ChefIronBelly » Wed Aug 19, 2015 2:27 pm

OK sorted out had keys mapped for 5 groups.

mod4 + shift + {1,2,3,4,5}
~/wmutils/groaw -a {1,2,3,4,5}

but only had 3 groups setup in GROAW
GNUMBER=3

changed that to 5 and it created the directory's.

Code: Select all

ls /tmp/groaw.d/
1 2 3 4 5


I had started on group 4. I hope this helps someone else out down the line.

Edit: to match current setup.
(1/1) Installing: LinuxBBQ...................................[69%]==============[/]

User avatar
ChefIronBelly
Approved BBQer
Posts: 1044
Joined: Mon Jan 13, 2014 6:01 am
Location: Michigan

Re: wmutils / sxhkd

Unread post by ChefIronBelly » Thu Aug 20, 2015 11:50 pm

/dkeg I saw what you did there sourcing your colors... do tell :)
(1/1) Installing: LinuxBBQ...................................[69%]==============[/]

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

Re: wmutils / sxhkd

Unread post by dkeg » Fri Aug 21, 2015 2:58 am

Sure ... we love to be consistent!
I still use my old colr script even though it sucks, but it works. That's what you see using the array. But there is also this one I came across and also use. They both work. I'll pass this one along to avoid embarassment. Keep in mind the output is just the rrggbb, no '#'.

Code: Select all

color(){                                                    
    echo -n "$( xrdb -query | grep "\*$1:" | grep -oE "#[a-zA-Z0-9]{6}" | cut -c 2- )"
}                                                                                                                   
   BG="$(color background)"                              
   FG="$(color foreground)"                              
   BLK="$(color color0)"                                                             
   RED="$(color color1)"                                 
   GRN="$(color color2)"                                 
   YLW="$(color color3)"                                 
   BLU="$(color color4)"                                 
   MAG="$(color color5)"                                 
   CYN="$(color color6)"                                 
   WHT="$(color color7)"          
   BBLK="#$(color color8)" 
just save it and source it. Sorry, I'm in a pretty crappy mood

Work hard; Complain less

User avatar
ChefIronBelly
Approved BBQer
Posts: 1044
Joined: Mon Jan 13, 2014 6:01 am
Location: Michigan

Re: wmutils / sxhkd

Unread post by ChefIronBelly » Fri Aug 21, 2015 12:18 pm

thanks for the idea, no script needed.

I went with the base16 way where every color is defined at 'xrdb -load'. So all colors are already there with the '#' and whenever changed.

Code: Select all

BW=${BW:-4}                    # border width
ACTIVE=${ACTIVE:-0x{base06}}     # active border color
INACTIVE=${INACTIVE:-0x{base03}} # inactive border color
(1/1) Installing: LinuxBBQ...................................[69%]==============[/]

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

Re: wmutils / sxhkd

Unread post by dkeg » Fri Aug 21, 2015 12:24 pm

Oh, neat!
So no sourcing needed? Also, I looked to not need the '#' in the wm tools scripts

Code: Select all

#ACTIVE=${ACTIVE:-0xffffff}     # active border color

Work hard; Complain less

User avatar
ChefIronBelly
Approved BBQer
Posts: 1044
Joined: Mon Jan 13, 2014 6:01 am
Location: Michigan

Re: wmutils / sxhkd

Unread post by ChefIronBelly » Fri Aug 21, 2015 12:32 pm

Its defined and sourced thru .Xresource @ xrdb -load.

Yeah you are right about that '#' the games we play with formatting. I need to see if mine is really working correctly now, I suspect not.
(1/1) Installing: LinuxBBQ...................................[69%]==============[/]

User avatar
ChefIronBelly
Approved BBQer
Posts: 1044
Joined: Mon Jan 13, 2014 6:01 am
Location: Michigan

Re: wmutils / sxhkd

Unread post by ChefIronBelly » Fri Aug 21, 2015 1:14 pm

Ok so define does not make a global variable until export VARNAME="value" (checked with 'env')

So now its not as a elegant solution, I don't have a problem exporting the colors and awk ing the # I guess. Now back to your script :)

hmm lets see where this rabbit hole ends up.
(1/1) Installing: LinuxBBQ...................................[69%]==============[/]

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

Re: wmutils / sxhkd

Unread post by dkeg » Fri Aug 21, 2015 1:24 pm

What time zone are you. You should hop on irc tonight

Work hard; Complain less

User avatar
ChefIronBelly
Approved BBQer
Posts: 1044
Joined: Mon Jan 13, 2014 6:01 am
Location: Michigan

Re: wmutils / sxhkd

Unread post by ChefIronBelly » Fri Aug 21, 2015 1:33 pm

EST I have been chat sober for 15 years I may have to have a little drink. :)
(1/1) Installing: LinuxBBQ...................................[69%]==============[/]

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

Re: wmutils / sxhkd

Unread post by dkeg » Fri Aug 21, 2015 1:43 pm

Ha, no worries and no pressure. I'm also EST. I'll be drinking some IPA of course.

Work hard; Complain less

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

Re: wmutils / sxhkd

Unread post by dkeg » Sat Aug 22, 2015 1:16 am

I recently realized that when you comment out code in sxhkd, you want to not have it within a specific keybind syntax. For example
No

Code: Select all

  alt + {h,j,k,l}
#focus {h,j,k,l}
closest {h,j,k,l}
Yes

Code: Select all

  alt + {h,j,k,l}
closest {h,j,k,l}
#focus {h,j,k,l}

Work hard; Complain less

User avatar
ChefIronBelly
Approved BBQer
Posts: 1044
Joined: Mon Jan 13, 2014 6:01 am
Location: Michigan

Re: wmutils / sxhkd

Unread post by ChefIronBelly » Mon Aug 24, 2015 5:00 pm

middles.sh

Gives you left, center and right middle placement.

Code: Select all

#!/bin/sh

CUR=${2:-$(pfw)}
ROOT=$(lsw -r)
SW=$(wattr w $ROOT)
SH=$(wattr h $ROOT)

BW=$(wattr b $CUR)
W=$(wattr w $CUR)
H=$(wattr h $CUR)

offlm=20
offrm=20

X=0
Y=0

case $1 in
    y) X=$((SW/4 - W/2 - BW + ${offlm}))
       Y=$((SH/2 - H/2 - BW));;
    g) X=$((SW/2 - W/2 - BW))
       Y=$((SH/2 - H/2 - BW)) ;;
    u) X=$((SW/2 + W/2 - BW - ${offrm}))
       Y=$((SH/2 - H/2 - BW));;    
esac

echo $X $Y

wtp $X $Y $W $H $CUR
Edit: added a fudge factor adjust for your fudge loving needs.
Last edited by ChefIronBelly on Tue Aug 25, 2015 1:19 pm, edited 5 times in total.
(1/1) Installing: LinuxBBQ...................................[69%]==============[/]

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

Re: wmutils / sxhkd

Unread post by dkeg » Mon Aug 24, 2015 5:09 pm

oh, that's a neat idea! Wonder if you could implement though yawee, randomizing the placement, so new windows don't all overlap

Work hard; Complain less

Post Reply