dotfiles

Obligatory dotfiles repo
git clone git://git.danielmoch.com/dotfiles.git
Log | Files | Refs

commit 3cbd9c54629abe9cf9198b304c83fd18b8363f2d
parent 9e5299d47a4290feb8aee9cd7757e9973dab8e7a
Author: Daniel Moch <daniel@danielmoch.com>
Date:   Sat,  2 Jun 2018 20:21:45 -0400

Irssi config adjustments

Diffstat:
M.irssi/login | 3+--
M.irssi/scripts/autorun/keyring.pl | 27++++++++++++---------------
M.local/bin/tmux-session | 5++---
3 files changed, 15 insertions(+), 20 deletions(-)

diff --git a/.irssi/login b/.irssi/login @@ -1,2 +1 @@ -connect freenode 7000 <password:account@djmoch@service@net.freenode.chat> djmoch -connect mozilla 6697 <password:account@djmoch@service@org.mozilla.irc> djmoch +connect sweetwater.djmoch.org 7000 <password> djmoch diff --git a/.irssi/scripts/autorun/keyring.pl b/.irssi/scripts/autorun/keyring.pl @@ -1,4 +1,4 @@ -# This script lightly modified from the original, found at: +# lightly modified version of the original, found here: # https://github.com/ervandew/keyring/blob/master/irssi/scripts/keyring.pl use strict; @@ -15,15 +15,20 @@ Irssi::command_bind keyring => sub { my $command = $_; my @parts = split(/\s/, $command); my $username; - my $chatnet; - my $nick; my $username_alt; if ($parts[0] eq 'connect'){ if (scalar(@parts) >= 5){ - $chatnet = "$parts[1]"; - $nick = "$parts[4]"; $username = "$parts[4]\@$parts[1]"; } + }elsif ($parts[0] eq 'xmppconnect'){ + foreach (@parts) { + if ($_ =~ '@'){ + $username = $_; + last; + } + } + }elsif ($parts[0] eq 'set'){ + $username = "$parts[1]"; }else{ next; } @@ -31,13 +36,6 @@ Irssi::command_bind keyring => sub { # handle alternate username if ($command =~ m/.*<password:([^>]*)>.*/){ $username_alt = $1; - $username_alt =~ s/@/ /g; - } - - # handle reset command - if ($account eq 'reset'){ - Irssi::command("network modify -sasl_mechanism '' -sasl_username '' -sasl_password '' $chatnet"); - next } # just print available account names @@ -63,7 +61,7 @@ Irssi::command_bind keyring => sub { if ($username_alt){ $username = $username_alt; } - my $pid = open3($stdin, $stdout, $stderr, "secret-tool lookup $username"); + my $pid = open3($stdin, $stdout, $stderr, "my netrc $parts[1] password"); waitpid($pid, 0); my $status = $? >> 8; @@ -76,8 +74,7 @@ Irssi::command_bind keyring => sub { }else{ print "keyring: connecting $username"; $command =~ s/<password(:[^>]*)?>/$password/; - Irssi::command("network modify -sasl_mechanism PLAIN -sasl_username $nick -sasl_password $password $chatnet"); - Irssi::command("connect $chatnet"); + Irssi::command($command); } }else{ my $error = join('', <$stderr>); diff --git a/.local/bin/tmux-session b/.local/bin/tmux-session @@ -39,8 +39,6 @@ then width=$(($columns - 80)) tmux new-session -d -x $columns -y `tput lines` -s $name vim tmux rename-window -t $name:1 code - tmux setw main-pane-width $width - tmux splitw tmux selectl main-vertical if echo $1 | grep chat > /dev/null 2>&1 then @@ -50,7 +48,7 @@ then tmux splitw -h cat ~/.irssi/nicklistfifo tmux selectl main-vertical tmux select-pane -t $name:2.1 - tmux send-keys -t $name:2.1 "/nicklist fifo" "C-m" "/keyring" "C-m" "/keyring reset" + tmux send-keys -t $name:2.1 "/keyring" "C-m" "/nicklist fifo" "C-m" tmux new-window -t $name -n "social" tootstream tmux send-keys -t $name:3.1 "stream home" "C-m" tmux splitw -h rainbowstream @@ -95,6 +93,7 @@ then tmux setw main-pane-width $width tmux splitw -h cat ~/.irssi/nicklistfifo tmux selectl main-vertical + tmux send-keys -t $name:1.1 "/keyring" "C-m" "/nicklist fifo" "C-m" fi if [ -n "$name" ]