tii script for instant chat - scripts - various script and utils
(HTM) git clone git://z3bra.org/scripts
(DIR) Log
(DIR) Files
(DIR) Refs
---
(DIR) commit 4488b54bc8a0227929233b51b6bf612550e81c30
(DIR) parent af411cf91858bfb452dc2b517791fdc818386876
(HTM) Author: Willy Goiffon <w.goiffon@gmail.com>
Date: Wed, 26 Jun 2013 13:39:34 +0200
ii script for instant chat
Diffstat:
M bar/status.sh | 5 ++---
D instagram | 14 --------------
A irc | 28 ++++++++++++++++++++++++++++
3 files changed, 30 insertions(+), 17 deletions(-)
---
(DIR) diff --git a/bar/status.sh b/bar/status.sh
t@@ -90,10 +90,10 @@ function network () {
net_interface=$(ip link| grep 'state UP'| sed 's/[0-9]: \([^:]*\):.*$/\1/')
if [ "$net_interface" = "$net_wire" ]; then
- val=$(ifconfig $net_interface| grep 'inet '| awk '{print $2}')
+ val=$(ip addr show $net_interface| grep 'inet '| head -n1| awk '{print $2}')
ico=${i_netw}
elif [ "$net_interface" = "$net_wifi" ]; then
- val=$(ifconfig $net_interface| grep 'inet '| awk '{print $2}')
+ val=$(ip addr show $net_interface| grep 'inet '| head -n1| awk '{print $2}')
ico=${i_netw}
else
val=""
t@@ -121,7 +121,6 @@ function fillbar () {
buffer="$buffer$(volume) ${sp}"
buffer="$buffer$(mpd_now_playing) "
buffer="$buffer\r\u${bg}"
- buffer="$buffer$(battery) ${sp}"
buffer="$buffer$(network) ${sp}"
buffer="$buffer$(memory) ${sp}"
buffer="$buffer$(processes) ${sp}"
(DIR) diff --git a/instagram b/instagram
t@@ -1,14 +0,0 @@
-#!/bin/sh
-
-SSHOT_DIR=~/usr/pics/scrnsht/
-
-import -window root $SSHOT_DIR/$1
-import -window root -thumbnail 25% $SSHOT_DIR/thumb-$1
-
-
-# Use for multi-head
-#
-# xdpyinfo -ext XINERAMA | sed '/^ head #/!d;s///' |
-# while IFS=' :x@,' read i w h x y; do
-# import -window root -crop ${w}x$h+$x+$y $SSHOT_DIR/head_$i-$1
-# done
(DIR) diff --git a/irc b/irc
t@@ -0,0 +1,28 @@
+#!/usr/bin/bash
+
+## ii directory
+ROOT=~/var/irc
+
+# irc parameters
+NICK='amoureuse'
+SERV='irc.freenode.net'
+PORT='6667'
+CHAN='z3bra'
+
+# commands launched on startup
+JOIN="/j z3bra connected"
+
+# spawn ii
+ii -i $ROOT -n $NICK -s $SERV -p $PORT &
+
+while [ ! -p $ROOT/$SERV/in ];do echo awaiting connection to $SERV...; sleep 2; done
+
+# launch commands at start
+echo "$JOIN" > $ROOT/$SERV/in
+
+while [ ! -p $ROOT/$SERV/$CHAN/in ];do echo Starting chatting with $CHAN; sleep 1; done
+
+cd $ROOT/$SERV/$CHAN
+tmux new-session -d -s irc 'tail -f out' \; split-window -l 1 'ptii' \; attach
+
+rm -rf $ROOT/$SERV