wmutils / sxhkd

User avatar
z3bra
Window Manager
Posts: 53
Joined: Fri Jun 27, 2014 8:34 am
Location: France
Contact:

Re: swm

Unread post by z3bra » Tue Apr 21, 2015 1:45 am

So much love for swm & wmutils in there, thanks for this !

@dkeg: dcat wrote swm by taking inspiration from 2bwm, so you might like it as well. Now it's meant to be used with wmutils, as it will only handle the mouse, and windiw borders (it has double borders too!)

You guys might want to check the opt and contrib repos of the wmutils project. They contain alternative tools and scripts that reproduce others WM behaviors, and more!

Here is a non exhaustive list of what I managed to do with wmutils :

+ tiling (master/stack area)
+ fullscreen toggle
+ teleport to corners
+ sloppy focus
+ group/workspace management

I can also do things that NO window managr can do!

+ contextual borders
+ rainbow/pulsing borders
+ grid selector
+ ...

A quick overview of the possibilities: http://raw.z3bra.org/vid/wmutils-is-cool.webm
Possibilities are (i hope) endless! I just can't think of new things to do withbit, and that's why we need some fresh ideas from other users. Feel free to open pull/feature requests, as we will always welcome them!

Thanks for using our job, we truly appreciate it. You're awesome !
BANGARANG, MOTHERFUCKER.

User avatar
simgin
Meme Fodder
Posts: 1167
Joined: Sun Jan 06, 2013 12:07 am
Location: Bradford-on-Avon, UK

Re: swm

Unread post by simgin » Tue Apr 21, 2015 9:33 am

^ And we are very happy to have you here mate :)
Awesome work and thanks for sharing!

simon
Someone told me that I am delusional, I almost fell off my unicorn.

machinebacon
Baconator
Posts: 10253
Joined: Thu Sep 16, 2010 11:03 am
Location: Pfälzerwald
Contact:

Re: swm

Unread post by machinebacon » Tue Apr 21, 2015 9:46 am

Indeed, awesome work, I really like wmutils and wrote a little maximizer (I usually just need one window open 'per workspace') based on the 'center of the screen' example on the github page.

Code: Select all

#/bin/bash
# maximize and stfu

WID=$(pfw)
ROOT=$(lsw -r)
SW=$(wattr w $ROOT)
SH=$(wattr h $ROOT)
chwb -s 0 $WID
wtp 0 0 $SW $SH $WID
No space left for a panel because I don't use one ;)

Edit: maybe we can open a thread for wmutils?
..gnutella..

User avatar
z3bra
Window Manager
Posts: 53
Joined: Fri Jun 27, 2014 8:34 am
Location: France
Contact:

Re: swm

Unread post by z3bra » Tue Apr 21, 2015 11:53 am

Yeah that could be nice! Should it be a thread to share scrots or scripts?
BANGARANG, MOTHERFUCKER.

User avatar
wuxmedia
Grasshopper
Posts: 6445
Joined: Wed Oct 17, 2012 11:32 am
Location: Back in Blighty
Contact:

Re: swm

Unread post by wuxmedia » Tue Apr 21, 2015 12:09 pm

or both? :)
"Seek, and Ye shall find"
"Github | Chooons | Site"

User avatar
z3bra
Window Manager
Posts: 53
Joined: Fri Jun 27, 2014 8:34 am
Location: France
Contact:

Re: swm

Unread post by z3bra » Tue Apr 21, 2015 12:24 pm

@machinebacon: Also, for your WM idea (one window per workspace), you could do the following
using wew(1) from the opt repo, and sxhkd(1) from baskerville:

This one will define what happens when a new window is created (so putting it
fullscreen, on top of others and add its ID to a file), and deletion (remove
the ID from the file). You can add this script to your .xinitrc for more
convenience

Code: Select all

#!/bin/sh
#
# window handler. this will run in the background and update a text file to
# contain an exhaustive list of currently existing windows

WIDFILE=~/.windows
ROOT=$(lsw -r)

wew | while IFS=: read ev wid; do
    # window deletion
    case 18) test -f $WIDFILE && sed -i "/^$wid/d" $WIDFILE ;;

    # window creation
    # this should NOT change window with override_redirect set to 1 (dock,
    # panels, status bar, ..)
    case 19) wattr -o $wid || {
                 wtp $(wattr xywh $ROOT) $wid
                 wtf $wid
                 chwso -r $wid
                 pfw >> $WIFDILE
             }
             ;;
done
Then this script would help you switch between windows. It will put the window
with index $1 (in the text file) on top of others

Code: Select all

#!/bin/sh
#
# let's call it $HOME/bin/wsw (for window switch)
#
# focus windows based on their position in a text file. The said file should
# contain one WID per line

WIDFILE=~/.windows

# some basic error handling
test -z "$1"                 && echo "error: no position specified" >&2  && exit 1
test -f $WIDFILE             || echo "error: cannot find WID file"  >&2  && exit 1
test $(wc -l < $WIDFILE) = 0 && echo "error: no WID found it file"  >&2  && exit 1

# grab the window at line specified
wid=$(sed "$1"p < $WIDFILE)

# put window on top of the stack
chwso -r $wid
And finally, bind your favorite keys to this script via sxhkd:

Code: Select all

# sxhkdrc for machinebacon special needs!
# because yeah, wmutils makes YOU special ;)

mod4 + {1,2,3,4,5,6,7,8,9,0,q,w,e,r,t,y}
  ~/bin/wsw {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16} 2>/dev/null
You might also want to check the "focus.sh" script in contrib to be able to alt-tab between them as well.

Damn I love when people come up with new ideas for wmutils! Thanks machinebacon!
BANGARANG, MOTHERFUCKER.

machinebacon
Baconator
Posts: 10253
Joined: Thu Sep 16, 2010 11:03 am
Location: Pfälzerwald
Contact:

Re: swm

Unread post by machinebacon » Tue Apr 21, 2015 12:55 pm

Thank you, z3bra, this looks damned good. Great idea with putting the newly created window on top of the stack. Gotta try it right away!

Of course I already use sxhkd for the bindings :)
..gnutella..

machinebacon
Baconator
Posts: 10253
Joined: Thu Sep 16, 2010 11:03 am
Location: Pfälzerwald
Contact:

wmutils / sxhkd

Unread post by machinebacon » Tue Apr 21, 2015 1:04 pm

/moved the previous posts from 'swm scrot' to here. Please share your scripts for wmutils and configs for sxhkd :)
..gnutella..

User avatar
simgin
Meme Fodder
Posts: 1167
Joined: Sun Jan 06, 2013 12:07 am
Location: Bradford-on-Avon, UK

Re: wmutils / sxhkd

Unread post by simgin » Tue Apr 21, 2015 2:07 pm

Hell yes this is a good idea :)

This forum is a damn good place to learn stuff!
Someone told me that I am delusional, I almost fell off my unicorn.

User avatar
wuxmedia
Grasshopper
Posts: 6445
Joined: Wed Oct 17, 2012 11:32 am
Location: Back in Blighty
Contact:

Re: wmutils / sxhkd

Unread post by wuxmedia » Tue Apr 21, 2015 2:24 pm

I'm lost already... Must be a good sign :)
"Seek, and Ye shall find"
"Github | Chooons | Site"

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 » Thu Aug 13, 2015 4:58 pm

Okay, it has been long time coming. I have been motivated, then lost it, happy to live in my configured world. But finally, it was Chef that gave the push that worked. And it was good timing too as the family is away, home all by my lonesome. I transferred my recently designed xbindkeysrc to sxhkd, which actually was more difficult that I had expected. I started with SWM, but also have working only using wm-utils. That is what I'm currently using.

So here is my newly configured sxhkdrc

Code: Select all

updated, see below
Your turn Chef

Work hard; Complain less

User avatar
GekkoP
Emacs Sancho Panza
Posts: 5877
Joined: Tue Sep 03, 2013 7:05 am

Re: wmutils / sxhkd

Unread post by GekkoP » Thu Aug 13, 2015 5:52 pm

^ I love the fact that even during these hot summer days, when most are on vacation, the grill is alive with crazy stuff. :)

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 14, 2015 2:32 pm

dkeg wrote:
Your turn Chef
Didn't even know this thread existed doh!

Here is what I have so far and all credit should go to the creators, I just put my favorite sauce on everything.

.sxhkdrc // mostly z3bra's with a side of dkeg.

Code: Select all

## sxhkd keybinds
## chefIB 2015

mod4 + Return
 urxvt

mod4 + p
 ~/bin/dmenu_go.sh

mod4 + d
 ~/bin/statusbar.sh
	 
mod4 + {h,j,k,l}
 wmv {-10 0,0 +10, 0 -10, +10 0} $(pfw)

mod4 + shift + {h,j,k,l}
 wmv {-40 0,0 +40, 0 -40, +40 0} $(pfw)

mod4 + alt + {h,j,k,l}
 wrs {-10 0,0 +10, 0 -10, +10 0} $(pfw)

mod4 + alt + shift + {h,j,k,l}
 wrs {-40 0,0 +40, 0 -40, +40 0} $(pfw)

mod4 + {h,k,j,l}
 ~/wmutils/closest.sh {h,j,k,l}
	 
mod4 + ctrl + q
 pkill xinit

alt + X
 killw $(pfw)

mod4 + x
 ~/wmutils/fullscreen.sh $(pfw)

mod4 + r
 chwso -i $(pfw)

alt + {Tab, shift + Tab}
 ~/wmutils/focus.sh {next,prev} 2>/dev/null && \
 wmp -a $(wattr xy $(pfw)) && \
 wmp -r $(wattr wh $(pfw))

mod4 + shift + {1,2,3,4}
 ~/wmutils/groups.sh -s $(pfw) {1,2,3,4}

mod4 + {1,2,3,4}
 ~/wmutils/groups.sh -t {1,2,3,4}

mod4 + {t,v}
 ~/wmutils/tile.sh {-h,-v}

mod4 + s
 ~/wmutils/switch_grid.sh

mod4 + {y,g,u}
 ~/wmutils/middles.sh {y,g,u}


statusbar.sh // z3bra's popup bit with added spices.

Code: Select all


#!/bin/sh

font="monaco:size=10"
ico_font="fontawesome-webfont:size=10"
bg="#ff525252"
fg="#ffe3e3e3"
hl="#ffe3e3e3"

default_geometry() {
    # get screen size
    x=$(wattr w `lsw -r`)
    y=$(wattr h `lsw -r`)

    width=1440
    height=20

    offy=0
    offx=$(( x - x/2 - $width/2 ))

    echo "${width}x${height}+${offx}+${offy}"
}

cur() {
   cur=$(cmus-info)
   test -n "$cur" && echo $cur || echo "you ain't got nuthin' playin' "   
   }

ip() {
    ip=$(if_ip.sh)
    echo $ip
}

clock() {
    time=$(date +" %a, %b %d %I:%M")
    echo $time
}

vol() {
    vol=$(volume.sh)
    echo $vol
}

GEOM=${GEOM:-$(default_geometry)}
SLEEP=${SLEEP:-10}

(echo $(cur) %{r} " " $(ip)    $(vol)    $(clock); sleep $SLEEP) | lemonbar -d -g $GEOM -f $font -f $ico_font -B $bg -F $fg

Edit updated again
Last edited by ChefIronBelly on Tue Aug 25, 2015 1:24 pm, edited 6 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 » Sat Aug 15, 2015 1:31 pm

I'm having trouble with wew.

*nevermind, I'm an idiot. Got that.

With 4 different cloned git repos and a few scripts being redundant, to better stay organized, I've created a directory called wmtls and added it to my $PATH. That way I can copy the scripts I'm using there.

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 15, 2015 11:31 pm

Updated my .sxhkdrc

Code: Select all

## sxhkd keybinds
## dkeg 2015

## kill the session
mod4 + ctrl + q 
  pkill xinit 

## kill active window
alt + X
	killw $(pfw)

## general 
alt + p
	osd

mod4 + Return
  urxvt

mod4 + p 
  demon	

alt + b
  iceweasel 

## manipulating
# move windows	
mod4 + {h, j, k, l}
	wmv {-10 0, 0 10, 0 -10, 10 0} $(pfw)

# fast move windows
mod4 + ctrl + {h, j, k, l}
	wmv {-80 0, 0 80, 0 -80, 80 0} $(pfw)

# tile
mod4 + t
  tile.sh $(pfw)

# switchgrid
mod4 + shift + t
  switchgrid $(pfw)

# resize windows
mod4 + shift + {h, j, k, l} 
	wrs {-10 0, 0 10, 0 -10, 10 0} $(pfw)

# fast resize windows
mod4 + ctrl + shift + {h, j, k, l} 
	wrs {-80 0, 0 80, 0 -80, 80 0} $(pfw)

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

## grouping
# add
mod4 + shift + {1,2,3,4}
  groaw -d all; \
  groaw -a {1,2,3,4}

# toggle
mod4 + {1,2,3,4}
  groaw -t {1,2,3,4}

# remove
mod4 + slash 
  groaw -d all

## window placement 
mod4 + {y,u,b,n,g}
  corner {tl,tr,bl,br,md} $(pfw)

alt + f
  fullscreen.sh $(pfw)

## volume 
alt + shift + {equal,minus,F8} 
  ~/bin/volume {+,-,!}; \
    popvol %\{c\} $(~/bin/volume level)

## music
mod4 + shift + equal
  ~/bin/music +; \
  popmus %\{c\} '' $(~/bin/music artist)

mod4 + shift + minus
  ~/bin/music -; \
  popmus %\{c\} '' $(~/bin/music artist)

mod4 + shift + Home
  ~/bin/music play; \
  popmus %\{c\} '' $(~/bin/music title)

mod4 + shift + ctrl + Home
  ~/bin/music pause; \
  popmus %\{c\} '' $(~/bin/music title)
also created a wmtls repo on my github (/dkeg) for the various scripts I'm using from wmutils/contrib, wmutils/opt, and z3bra/scripts. Serious shout out to the authors. Seriously. Kudos!

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 » Sun Aug 16, 2015 12:06 pm

You have been busy, I finally formatted the OpenBSD laptop and now wondering if I should package this all up and make it portable or just start cloning and compiling. I am also starting to have the same issue with the scripts taking over my ~/bin.

Edit: cha cha changes.
(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 » Mon Aug 17, 2015 6:51 pm

/dkeg

Any issues with the border colors active and inactive? mine wont change when I update them in focus.sh probably a .Xresource issue or maybe there also set in another script and getting stepped on.

Laptop has been updated with a fresh install and wmutils. woohoo
(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 17, 2015 7:12 pm

No. But I will guess that your issue stems from that based on your .sxhkdrc, you're using focus from z3bra's scripts, not focus.sh from contrib.

: )

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 17, 2015 9:18 pm

Lots of changes over the weekend I'm sure its related. I am using the focus.sh from contrib I think that .sxhkdrc was just my starting point. Anyway I will dig in and get it sorted out.
(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 17, 2015 9:29 pm

Sure. I'm mobile now. Later when I'm on my computer I'll see if I can help some more

Work hard; Complain less

Post Reply