Commits

lan Nomar committed ff8275d

say: now works with new layout

  • Participants
  • Parent commits 4a19ea3

Comments (0)

Files changed (1)

 pick='127.0.0.1/#' ; inF=$iiDir^'/127.0.0.1/in'
 
 # tmux set-option status-right $p2(1)  (cant run this after ask... WTF!?)
-fn load { pipes=`{ du $iiDir | cut -d/ -f7- | awk 'NF!=0' } } ; load
-fn Setinfo {	iidir=$^iiDir/^$^pick/ ; inF=$iidir^'in' ; outF=$iidir^'out'
-	p2=`` (/ $nl) { echo $pick }
-		serv=`` (.) { echo $p2(1) } ; chan=$p2(2) } ; Setinfo
+# 
+fn load {
+	pipes=`{ find $iiDir | cut -d/ -f7- | awk 'NF!=0' } }
+fn Setinfo {
+	iidir=$iiDir/$pick/
+		inF=$iidir^'in' ; outF=$iidir^'out'
+	ifs=(/ $nl) { *=`{ echo $pick } }
+		serv=$1 ; chan=$2 }
 fn Chooser { pick=`{ OFS pipes $nl | dmenu -b }	; ~ $#pick 1 && Setinfo }
 fn Say { echo $Say > $inF }
 
-while(){ echo ; setcolor yellow ; echo ' > ' $serv(2)^$chan ; setcolor Cyan ; Say=`{ askc }
+load
+	Setinfo
+
+while(){ echo ; setcolor yellow ; echo ' > ' $serv $chan ; setcolor Cyan ; Say=`{ askc }
  if ( ~ $Say(1) '/'*){ # Commands
    switch($Say(1)) { # Conf
 	case '/#'		; Chooser
 	case '/e'		; vshift Say 1 ; $Say
 	case '/url'		; url=`{ match '://' `{ grep '://' $outF } | dmenu } ; ~ $#url 0 || OpenURL $url
 
-	case '/Q'		; exit 0	
-	case '/QQ'		; killall ii ; exit 0
+	case '/q'		; exit 0	
+	case '/Q'		; kill `{ cat $ServDir/pid } ; rm $ServDir/pid
+	case '/QQ'		; killall ii ; rm $iiDir/^*^/^(pid run) ;  exit 0
 	case (/^[?h] '/help')	; echo '/#, /k, /?>(Output ##), /?n (Lists names), ' 
 	case *			; Say
   } } else {