From 536798b7db7626c25c99b8bf0f99753287070349 Mon Sep 17 00:00:00 2001 From: Igor Bohm Date: Wed, 30 Dec 2020 10:37:36 +0000 Subject: [PATCH] Remove riostart, add shortcut f, update wircrc. --- bin/rc/f | 2 ++ bin/rc/riostart | 3 -- bin/rc/wircrc | 8 ++--- bin/rc/workspace.main | 82 ------------------------------------------- bin/rc/workspace.w0 | 49 -------------------------- bin/rc/workspace.w1 | 48 ------------------------- 6 files changed, 6 insertions(+), 186 deletions(-) create mode 100755 bin/rc/f delete mode 100755 bin/rc/riostart delete mode 100755 bin/rc/workspace.main delete mode 100755 bin/rc/workspace.w0 delete mode 100755 bin/rc/workspace.w1 diff --git a/bin/rc/f b/bin/rc/f new file mode 100755 index 0000000..650ca1b --- /dev/null +++ b/bin/rc/f @@ -0,0 +1,2 @@ +#!/bin/rc +walk | grep $* diff --git a/bin/rc/riostart b/bin/rc/riostart deleted file mode 100755 index 2fe1a3d..0000000 --- a/bin/rc/riostart +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/rc - -window workspace.main diff --git a/bin/rc/wircrc b/bin/rc/wircrc index 273bbab..fba71c6 100755 --- a/bin/rc/wircrc +++ b/bin/rc/wircrc @@ -4,15 +4,15 @@ basename `{echo $0} | tr -d \x0a >/mnt/wsys/label wins=() cons=() +# 'irc.freenode.net!#plan9' \ +# 'irc.freenode.net!#9front' \ chans=(\ 'irc.freenode.net!#cat-v' \ -'irc.freenode.net!#plan9' \ -'irc.freenode.net!#9front' \ ) server=irc.freenode.net -realname='' -nick=_9lab_ +realname='0x2A' +nick=boehm_igor pass=() userpass=`{auth/userpasswd 'server='^$server^' service=irc user='^$nick >[2]/dev/null} if(~ $#userpass 2) { diff --git a/bin/rc/workspace.main b/bin/rc/workspace.main deleted file mode 100755 index 3a18d54..0000000 --- a/bin/rc/workspace.main +++ /dev/null @@ -1,82 +0,0 @@ -#!/bin/rc - -# -- FUNS -fn ScrDim{ # determine screen dimension (W H) - w=0 - h=0 - devscr=/dev/screen - if(test -r $devscr){ - scr=`{read -c 59 $devscr} - w=`{echo $scr(4) - $scr(2) | bc} - h=`{echo $scr(5) - $scr(3) | bc} - } - if not { - dim=(`{echo $vgasize | awk -Fx '{printf("%d %d", $1, $2)}'}) - w=$dim(1) - h=$dim(2) - } - echo $w $h -} -fn TopRow{ - { xlen=$1 ; shift 1 } # param 1: list x length - { x=$*(1-$xlen) ; shift $xlen } # param 2: list x - { ylen=$1 ; shift 1 } # param 3: list y length - { y=$*(1-$ylen) ; shift $ylen } # param 4: list y - - window -r ($x(1) $y(1) $x(2) $y(2)) stats -lmisce - window $x(3)^,^$y(1)^,^$x(4)^,^$y(2) winwatch -e '^(winwatch|stats|faces|vdir)' -} -fn MidRow{ - { xlen=$1 ; shift 1 } # param 1: list x length - { x=$*(1-$xlen) ; shift $xlen } # param 2: list x - { ylen=$1 ; shift 1 } # param 3: list y length - { y=$*(1-$ylen) ; shift $ylen } # param 4: list y - - w=`{echo $x(4) - $x(1) | bc} - h=`{echo $y(4) - $y(3) | bc} - echo $w $h >$home/tmp/w0.dim - w0font=$font - window -hide -r ($x(1) $y(3) $x(4) $y(4)) rio -i workspace.w0 -f $w0font - - w=`{echo $x(4) - $x(1) | bc} - h=`{echo $y(4) - $y(3) | bc} - echo $w $h >$home/tmp/w1.dim - w1font=/lib/font/bit/pelm/unicode.9.font - window -hide -r ($x(1) $y(3) $x(4) $y(4)) rio -i workspace.w1 -f $w1font - - window -hide -r ($x(1) $y(3) $x(4) $y(4)) acme -c3 -a - window -r ($x(1) $y(3) $x(2) $y(4)) rc - window -r ($x(3) $y(3) $x(4) $y(4)) rc -} -fn BotRow{ - { xlen=$1 ; shift 1 } # param 1: list x length - { x=$*(1-$xlen) ; shift $xlen } # param 2: list x - { ylen=$1 ; shift 1 } # param 3: list y length - { y=$*(1-$ylen) ; shift $ylen } # param 4: list y - window -r ($x(1) $y(5) $x(2) $y(6)) vdir - window -r ($x(3) $y(5) $x(4) $y(6)) faces -} -fn TileScreen{ - Dim=(`{ScrDim}) # screen dimension (W x H) - W=$Dim(1) - H=$Dim(2) - s=5 # space from border - w=`{echo $W | awk '{print $1/2}'} # window width ratio - h=`{echo $H | awk '{print $1/10}'} # window height ratio - # x..list of x point pairs (2 columns -> 2 pairs) - x=(`{echo $w $s | awk '{printf("%d %d %d %d", - (0*$1)+$2 , (1*$1)-$2, - (1*$1)+$2 , (2*$1)-$2)}'}) - # y..list of y point pairs (3 rows -> 3 pairs) - y=(`{echo $h $s | awk '{printf("%d %d %d %d %d %d", - (0*$1)+$2 , ( 1*$1)-$2, - (1*$1)+$2 , ( 9*$1)-$2, - (9*$1)+$2 , (10*$1)-$2)}'}) - TopRow $#x ($x) $#y ($y) - MidRow $#x ($x) $#y ($y) - BotRow $#x ($x) $#y ($y) -} -# -- MAIN ->$home/tmp/w0.dim ->$home/tmp/w1.dim -TileScreen diff --git a/bin/rc/workspace.w0 b/bin/rc/workspace.w0 deleted file mode 100755 index f4420e8..0000000 --- a/bin/rc/workspace.w0 +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/rc - -# -- FUNS -fn TopRow{ - { xlen=$1 ; shift 1 } # param 1: list x length - { x=$*(1-$xlen) ; shift $xlen } # param 2: list x - { ylen=$1 ; shift 1 } # param 3: list y length - { y=$*(1-$ylen) ; shift $ylen } # param 4: list y - window $x(1)^,^$y(1)^,^$x(4)^,^$y(2) winwatch -e '^(winwatch|stats|faces|vdir)' -} -fn MidRow{ - { xlen=$1 ; shift 1 } # param 1: list x length - { x=$*(1-$xlen) ; shift $xlen } # param 2: list x - { ylen=$1 ; shift 1 } # param 3: list y length - { y=$*(1-$ylen) ; shift $ylen } # param 4: list y - window -r ($x(1) $y(3) $x(2) $y(4)) rc - window -r ($x(3) $y(3) $x(4) $y(4)) rc -} -fn BotRow{ - { xlen=$1 ; shift 1 } # param 1: list x length - { x=$*(1-$xlen) ; shift $xlen } # param 2: list x - { ylen=$1 ; shift 1 } # param 3: list y length - { y=$*(1-$ylen) ; shift $ylen } # param 4: list y - window -r ($x(1) $y(5) $x(4) $y(6)) rc -} -fn TileScreen{ - Dim=(`{read -m $home/tmp/w0.dim}) # screen dimension (W x H) - W=$Dim(1) - H=$Dim(2) - s=4 # space from border - w=`{echo $W | awk '{print $1/2}'} # window width ratio - h=`{echo $H | awk '{print $1/10}'} # window height ratio - # x..list of x point pairs (2 columns -> 2 pairs) - x=(`{echo $w $s | awk '{printf("%d %d %d %d", - (0*$1)+$2 , (1*$1)-$2, - (1*$1)+$2 , (2*$1)-$2)}'}) - # y..list of y point pairs (3 rows -> 3 pairs) - y=(`{echo $h $s | awk '{printf("%d %d %d %d %d %d", - (0*$1)+$2 , ( 1*$1)-$2, - (1*$1)+$2 , ( 9*$1)-$2, - (9*$1)+$2 , (10*$1)-$2)}'}) - TopRow $#x ($x) $#y ($y) - MidRow $#x ($x) $#y ($y) - BotRow $#x ($x) $#y ($y) -} - -# -- MAIN -label w0:terms -TileScreen diff --git a/bin/rc/workspace.w1 b/bin/rc/workspace.w1 deleted file mode 100755 index 0a42c71..0000000 --- a/bin/rc/workspace.w1 +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/rc - -# -- FUNS -fn TopRow{ - { xlen=$1 ; shift 1 } # param 1: list x length - { x=$*(1-$xlen) ; shift $xlen } # param 2: list x - { ylen=$1 ; shift 1 } # param 3: list y length - { y=$*(1-$ylen) ; shift $ylen } # param 4: list y - window $x(1)^,^$y(1)^,^$x(4)^,^$y(2) winwatch -e '^(winwatch|stats|faces|vdir)' -} -fn MidRow{ - { xlen=$1 ; shift 1 } # param 1: list x length - { x=$*(1-$xlen) ; shift $xlen } # param 2: list x - { ylen=$1 ; shift 1 } # param 3: list y length - { y=$*(1-$ylen) ; shift $ylen } # param 4: list y - #window -r ($x(1) $y(3) $x(2) $y(4)) rc - #window -r ($x(3) $y(3) $x(4) $y(4)) rc -} -fn BotRow{ - { xlen=$1 ; shift 1 } # param 1: list x length - { x=$*(1-$xlen) ; shift $xlen } # param 2: list x - { ylen=$1 ; shift 1 } # param 3: list y length - { y=$*(1-$ylen) ; shift $ylen } # param 4: list y - window -scroll -r ($x(1) $y(5) $x(4) $y(6)) wircrc -} -fn TileScreen{ - Dim=(`{read -m $home/tmp/w1.dim}) # screen dimension (W x H) - W=$Dim(1) - H=$Dim(2) - s=4 # space from border - w=`{echo $W | awk '{print $1/2}'} # window width ratio - h=`{echo $H | awk '{print $1/10}'} # window height ratio - # x..list of x point pairs (2 columns -> 2 pairs) - x=(`{echo $w $s | awk '{printf("%d %d %d %d", - (0*$1)+$2 , (1*$1)-$2, - (1*$1)+$2 , (2*$1)-$2)}'}) - # y..list of y point pairs (3 rows -> 3 pairs) - y=(`{echo $h $s | awk '{printf("%d %d %d %d %d %d", - (0*$1)+$2 , ( 1*$1)-$2, - (1*$1)+$2 , ( 9*$1)-$2, - (9*$1)+$2 , (10*$1)-$2)}'}) - TopRow $#x ($x) $#y ($y) - MidRow $#x ($x) $#y ($y) - BotRow $#x ($x) $#y ($y) -} -# -- MAIN -label w1:irc -TileScreen