Skip to content

Commit

Permalink
Merge pull request #26 from budlabs/dev
Browse files Browse the repository at this point in the history
small fixes
  • Loading branch information
budRich authored Sep 6, 2018
2 parents 1bed53e + 11d10ff commit 3ef483b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
6 changes: 3 additions & 3 deletions i3flip/i3flip
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ __contact='[email protected]'
__created="2018-01-03"
__updated="2018-09-01"


main(){

eval set -- "$(getopt --name "$__name" \
Expand Down Expand Up @@ -62,6 +63,7 @@ main(){
i3-msg -q "[con_id=$__orgtrg]" focus, focus child
}


gettarget(){
local trg

Expand All @@ -79,6 +81,7 @@ gettarget(){
echo "${aord[$((trg-1))]}"
}


getcurrent(){
i3-msg -t get_tree \
| awk -v RS=',' -F':' -v crit='"focused"' -v srch="true" '
Expand Down Expand Up @@ -120,7 +123,6 @@ getcurrent(){
}



printinfo(){
local about bouthead boutfoot

Expand Down Expand Up @@ -188,8 +190,6 @@ SEE ALSO
i3(1)
"



case "$1" in
# print version info to stdout
version )
Expand Down
16 changes: 9 additions & 7 deletions i3fyra/i3fyra
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ containershow(){
# show target ($1/trg) container (A|B|C|D)
# if it already is visible, do nothing.
# if it doesn't exist, create it
local trg sts tfam sib tdest sdir tmrk tspl tdim
local trg sts tfam sib tdest famshow tmrk tspl tdim

# trg = target container
# sts = status (none|visible|hidden)
Expand All @@ -153,13 +153,11 @@ containershow(){
hidden )

# sib = sibling, tfam = family
case $trg in
A ) sib=C tfam=AC ;;
B ) sib=D tfam=BD ;;
C ) sib=A tfam=AC ;;
D ) sib=B tfam=BD ;;
esac
[[ $trg =~ [AC] ]] \
&& tfam=AC \
|| tfam=BD

sib=${tfam/$trg/}
# if sibling is visible, tdest (destination)
# otherwise XAB, main container
[[ ${sib} =~ [${i3list[LVI]}] ]] \
Expand All @@ -173,6 +171,7 @@ containershow(){
# if tdest is XAB, trg is first in family
if [[ $tdest = i34XAB ]]; then
familycreate "$trg"
famshow=1
else
# WSA = active workspace
i3-msg -q "[con_mark=i34${trg}]" \
Expand Down Expand Up @@ -214,6 +213,9 @@ containershow(){
i3list[LVI]+=$trg
i3list[LHI]=${i3list[LHI]/$trg/}

# bring the whole family
[[ $famshow = 1 ]] && [[ $sib =~ [${i3list[LHI]}] ]] \
&& containershow "$sib"
;;
esac
}
Expand Down
2 changes: 1 addition & 1 deletion i3get/i3get
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ getwindow(){
}
$1 ~ crit && $2 ~ srch {hit=1;fid=cid}
$2 ~ crit && $3 ~ srch {hit=1;fid=cid}
sret ~ t && $1=="\"title\"" {r["t"]=$2}
sret ~ t && $1=="\"title\"" {sub($1":","");r["t"]=$0}
sret ~ c && $2 ~ "\"class\"" {r["c"]=$3}
sret ~ i && $1=="\"instance\"" {r["i"]=$2}
sret ~ d && $1=="\"window\"" {r["d"]=$2}
Expand Down

0 comments on commit 3ef483b

Please sign in to comment.