Skip to content

Instantly share code, notes, and snippets.

@nathanharper
Last active October 29, 2018 08:39
Show Gist options
  • Select an option

  • Save nathanharper/3298818 to your computer and use it in GitHub Desktop.

Select an option

Save nathanharper/3298818 to your computer and use it in GitHub Desktop.

Revisions

  1. nathanharper revised this gist Aug 17, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion tmux_irssi_niclist.sh
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    #!/bin/bash
    #!/usr/bin/env bash
    # This should work whether you are already in a TMUX session or not...
    # Irssi directory is assumed to be in the user's home dir
    if [ -z "$TMUX" ]
  2. nathanharper revised this gist Feb 9, 2013. 1 changed file with 21 additions and 17 deletions.
    38 changes: 21 additions & 17 deletions tmux_irssi_niclist.sh
    Original file line number Diff line number Diff line change
    @@ -1,18 +1,22 @@
    #!/bin/bash
    if [ -z "$IRSSI_PATH" ]
    then
    echo "Environment variable IRSSI_PATH not set."
    exit
    fi

    tmux new-session -d -s ircuser
    tmux split-window -t ircuser -h -l 20

    tmux send-keys -t ircuser "tmux send-keys -t0 \"irssi\" C-m; \
    tmux send-keys -t0 \"/set nicklist_height \$(stty size | cut -f1 -d' ' -)\" C-m; \
    tmux send-keys -t0 \"/set nicklist_width \$(stty size | cut -f2 -d' ' -)\" C-m; \
    tmux send-keys -t0 \"/nicklist fifo\" C-m; \
    tmux send-keys -t1 \"cat $IRSSI_PATH/nicklistfifo\" C-m; \
    tmux select-pane -t0" C-m

    tmux attach-session -t ircuser
    # This should work whether you are already in a TMUX session or not...
    # Irssi directory is assumed to be in the user's home dir
    if [ -z "$TMUX" ]
    then
    tmux new-session -d -s ircuser
    tmux split-window -tircuser -h -l20
    tmux send-keys -tircuser "tmux send-keys -t0 \"irssi\" C-m; \
    tmux send-keys -t0 \"/set nicklist_height \$(stty size | cut -f1 -d' ' -)\" C-m; \
    tmux send-keys -t0 \"/set nicklist_width \$(stty size | cut -f2 -d' ' -)\" C-m; \
    tmux send-keys -t1 \"cat ~/.irssi/nicklistfifo\" C-m; \
    tmux send-keys -t0 \"/nicklist fifo\" C-m; \
    tmux select-pane -t0" C-m
    tmux attach-session -t ircuser
    else
    tmux split-window -h -l20
    tmux send-keys -t1 "tmux send-keys -t0 \"irssi\" C-m; \
    tmux send-keys -t0 \"/set nicklist_height \$(stty size | cut -f1 -d' ' -)\" C-m; \
    tmux send-keys -t0 \"/set nicklist_width \$(stty size | cut -f2 -d' ' -)\" C-m; \
    tmux send-keys -t0 \"/nicklist fifo\" C-m; \
    cat ~/.irssi/nicklistfifo" C-m
    fi
  3. nathanharper renamed this gist Nov 14, 2012. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  4. nathanharper revised this gist Aug 9, 2012. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Automatic Tmux-Irssi-Nicklist
    Original file line number Diff line number Diff line change
    @@ -12,7 +12,7 @@ tmux send-keys -t ircuser "tmux send-keys -t0 \"irssi\" C-m; \
    tmux send-keys -t0 \"/set nicklist_height \$(stty size | cut -f1 -d' ' -)\" C-m; \
    tmux send-keys -t0 \"/set nicklist_width \$(stty size | cut -f2 -d' ' -)\" C-m; \
    tmux send-keys -t0 \"/nicklist fifo\" C-m; \
    tmux send-keys -t1 \"cat $IRSSI_PATH/.irssi/nicklistfifo\" C-m; \
    tmux send-keys -t1 \"cat $IRSSI_PATH/nicklistfifo\" C-m; \
    tmux select-pane -t0" C-m

    tmux attach-session -t ircuser
  5. nathanharper revised this gist Aug 9, 2012. 1 changed file with 6 additions and 19 deletions.
    25 changes: 6 additions & 19 deletions Automatic Tmux-Irssi-Nicklist
    Original file line number Diff line number Diff line change
    @@ -5,27 +5,14 @@ then
    exit
    fi

    if [ ! -f "$IRSSI_PATH/.irssi/startup-base" ]
    then
    echo "To use this script, you must make a copy of your startup file called startup-base, and add future startup items to the base file."
    echo "Please created a startup-base file."
    exit
    fi

    if [ ! -p "$IRSSI_PATH/.irssi/nicklistfifo" ]
    then
    mkfifo $IRSSI_PATH/.irssi/nicklistfifo
    fi

    tmux new-session -d -s ircuser
    tmux split-window -t ircuser -h -l 20

    tmux send-keys -t ircuser "cat $IRSSI_PATH/.irssi/startup-base > $IRSSI_PATH/.irssi/startup; \
    echo \"/set nicklist_height \$(stty size | cut -f1 -d' ' -)\" >> $IRSSI_PATH/.irssi/startup; \
    echo \"/set nicklist_width \$(stty size | cut -f2 -d' ' -)\" >> $IRSSI_PATH/.irssi/startup; \
    tmux select-pane -t0; \
    tmux send-keys -t0 \"irssi\" C-m; \
    tmux send-keys -t1 \"cat $IRSSI_PATH/.irssi/nicklistfifo\" C-m; \
    tmux send-keys -t0 \"/nicklist fifo\" C-m" C-m
    tmux send-keys -t ircuser "tmux send-keys -t0 \"irssi\" C-m; \
    tmux send-keys -t0 \"/set nicklist_height \$(stty size | cut -f1 -d' ' -)\" C-m; \
    tmux send-keys -t0 \"/set nicklist_width \$(stty size | cut -f2 -d' ' -)\" C-m; \
    tmux send-keys -t0 \"/nicklist fifo\" C-m; \
    tmux send-keys -t1 \"cat $IRSSI_PATH/.irssi/nicklistfifo\" C-m; \
    tmux select-pane -t0" C-m

    tmux attach-session -t ircuser
  6. nathanharper revised this gist Aug 8, 2012. 1 changed file with 11 additions and 12 deletions.
    23 changes: 11 additions & 12 deletions Automatic Tmux-Irssi-Nicklist
    Original file line number Diff line number Diff line change
    @@ -12,21 +12,20 @@ then
    exit
    fi

    tmux new-session -d -s ircuser
    tmux split-window -t ircuser -h -l 20

    tmux send-keys -t ircuser "HEIGHT=\$(stty size | cut -f1 -d' ' -)" C-m
    tmux send-keys -t ircuser "WIDTH=\$(stty size | cut -f2 -d' ' -)" C-m
    tmux send-keys -t ircuser "cat $IRSSI_PATH/.irssi/startup-base > $IRSSI_PATH/.irssi/startup" C-m
    tmux send-keys -t ircuser "echo \"/set nicklist_height \$HEIGHT\" >> $IRSSI_PATH/.irssi/startup" C-m
    tmux send-keys -t ircuser "echo \"/set nicklist_width \$WIDTH\" >> $IRSSI_PATH/.irssi/startup" C-m

    if [ ! -p "$IRSSI_PATH/.irssi/nicklistfifo" ]
    then
    mkfifo $IRSSI_PATH/.irssi/nicklistfifo
    fi

    tmux send-keys -t ircuser "tmux select-pane -t0; tmux send-keys -t0 \"irssi\" C-m; tmux send-keys -t1 \"cat $IRSSI_PATH/.irssi/nicklistfifo\" C-m; " C-m
    tmux attach-session -t ircuser
    tmux new-session -d -s ircuser
    tmux split-window -t ircuser -h -l 20

    tmux send-keys -t ircuser "cat $IRSSI_PATH/.irssi/startup-base > $IRSSI_PATH/.irssi/startup; \
    echo \"/set nicklist_height \$(stty size | cut -f1 -d' ' -)\" >> $IRSSI_PATH/.irssi/startup; \
    echo \"/set nicklist_width \$(stty size | cut -f2 -d' ' -)\" >> $IRSSI_PATH/.irssi/startup; \
    tmux select-pane -t0; \
    tmux send-keys -t0 \"irssi\" C-m; \
    tmux send-keys -t1 \"cat $IRSSI_PATH/.irssi/nicklistfifo\" C-m; \
    tmux send-keys -t0 \"/nicklist fifo\" C-m" C-m

    # TODO: once Irssi boots, you still have to type "/nicklist fifo". Must be completely automated!
    tmux attach-session -t ircuser
  7. nathanharper revised this gist Aug 8, 2012. 1 changed file with 2 additions and 4 deletions.
    6 changes: 2 additions & 4 deletions Automatic Tmux-Irssi-Nicklist
    Original file line number Diff line number Diff line change
    @@ -26,9 +26,7 @@ then
    mkfifo $IRSSI_PATH/.irssi/nicklistfifo
    fi

    tmux send-keys -t ircuser "tmux select-pane -t0" C-m
    tmux send-keys -t ircuser "tmux send-keys -t1 \"cat $IRSSI_PATH/.irssi/nicklistfifo\" C-m" C-m
    tmux send-keys -t ircuser "irssi" C-m
    tmux send-keys -t ircuser "tmux select-pane -t0; tmux send-keys -t0 \"irssi\" C-m; tmux send-keys -t1 \"cat $IRSSI_PATH/.irssi/nicklistfifo\" C-m; " C-m
    tmux attach-session -t ircuser

    # TODO: once Irssi boots, you still have to type "/nicklist fifo". Must be completely automated!
    # TODO: once Irssi boots, you still have to type "/nicklist fifo". Must be completely automated!
  8. nathanharper revised this gist Aug 8, 2012. 1 changed file with 1 addition and 6 deletions.
    7 changes: 1 addition & 6 deletions Automatic Tmux-Irssi-Nicklist
    Original file line number Diff line number Diff line change
    @@ -26,13 +26,8 @@ then
    mkfifo $IRSSI_PATH/.irssi/nicklistfifo
    fi

    tmux send-keys -t ircuser "tmux select-pane -t0; cat $IRSSI_PATH/.irssi/nicklistfifo" C-m

    # I'm not sure why the following line is necessary, but the 'irrsi'
    # Command is executed in the incorrect pane without it.
    # If anybody can explain...
    tmux send-keys -t ircuser "tmux select-pane -t0" C-m

    tmux send-keys -t ircuser "tmux send-keys -t1 \"cat $IRSSI_PATH/.irssi/nicklistfifo\" C-m" C-m
    tmux send-keys -t ircuser "irssi" C-m
    tmux attach-session -t ircuser

  9. nathanharper created this gist Aug 8, 2012.
    39 changes: 39 additions & 0 deletions Automatic Tmux-Irssi-Nicklist
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,39 @@
    #!/bin/bash
    if [ -z "$IRSSI_PATH" ]
    then
    echo "Environment variable IRSSI_PATH not set."
    exit
    fi

    if [ ! -f "$IRSSI_PATH/.irssi/startup-base" ]
    then
    echo "To use this script, you must make a copy of your startup file called startup-base, and add future startup items to the base file."
    echo "Please created a startup-base file."
    exit
    fi

    tmux new-session -d -s ircuser
    tmux split-window -t ircuser -h -l 20

    tmux send-keys -t ircuser "HEIGHT=\$(stty size | cut -f1 -d' ' -)" C-m
    tmux send-keys -t ircuser "WIDTH=\$(stty size | cut -f2 -d' ' -)" C-m
    tmux send-keys -t ircuser "cat $IRSSI_PATH/.irssi/startup-base > $IRSSI_PATH/.irssi/startup" C-m
    tmux send-keys -t ircuser "echo \"/set nicklist_height \$HEIGHT\" >> $IRSSI_PATH/.irssi/startup" C-m
    tmux send-keys -t ircuser "echo \"/set nicklist_width \$WIDTH\" >> $IRSSI_PATH/.irssi/startup" C-m

    if [ ! -p "$IRSSI_PATH/.irssi/nicklistfifo" ]
    then
    mkfifo $IRSSI_PATH/.irssi/nicklistfifo
    fi

    tmux send-keys -t ircuser "tmux select-pane -t0; cat $IRSSI_PATH/.irssi/nicklistfifo" C-m

    # I'm not sure why the following line is necessary, but the 'irrsi'
    # Command is executed in the incorrect pane without it.
    # If anybody can explain...
    tmux send-keys -t ircuser "tmux select-pane -t0" C-m

    tmux send-keys -t ircuser "irssi" C-m
    tmux attach-session -t ircuser

    # TODO: once Irssi boots, you still have to type "/nicklist fifo". Must be completely automated!