Irssi setup added.

This commit is contained in:
Storm Dragon
2025-07-18 23:54:12 -04:00
parent 86c50e7ecb
commit a0717ddecc
2 changed files with 501 additions and 0 deletions

208
home/stormux/.irssi/config Normal file
View File

@@ -0,0 +1,208 @@
servers = (
{
address = "irc.stormux.org";
chatnet = "Stormux";
port = "6667";
use_tls = "no";
tls_verify = "no";
autoconnect = "yes";
},
{
address = "irc.stormux.org";
chatnet = "Stormux";
port = "6667";
use_tls = "no";
tls_verify = "no";
autoconnect = "yes";
starttls = "yes";
}
);
chatnets = { Stormux = { type = "IRC"; }; };
channels = (
{ name = "#stormux"; chatnet = "Stormux"; autojoin = "yes"; }
);
aliases = {
ATAG = "WINDOW SERVER";
ADDALLCHANS = "SCRIPT EXEC foreach my \\$channel (Irssi::channels()) { Irssi::command(\"CHANNEL ADD -auto \\$channel->{visible_name} \\$channel->{server}->{tag} \\$channel->{key}\")\\;}";
B = "BAN";
BACK = "AWAY";
BANS = "BAN";
BYE = "QUIT";
C = "CLEAR";
CALC = "EXEC - if command -v bc >/dev/null 2>&1\\; then printf '%s=' '$*'\\; echo '$*' | bc -l\\; else echo bc was not found\\; fi";
CHAT = "DCC CHAT";
DATE = "TIME";
DEHIGHLIGHT = "DEHILIGHT";
DESCRIBE = "ACTION";
DHL = "DEHILIGHT";
EXEMPTLIST = "MODE $C +e";
EXIT = "QUIT";
GOTO = "SCROLLBACK GOTO";
HIGHLIGHT = "HILIGHT";
HL = "HILIGHT";
HOST = "USERHOST";
INVITELIST = "MODE $C +I";
J = "JOIN";
K = "KICK";
KB = "KICKBAN";
KN = "KNOCKOUT";
LAST = "LASTLOG";
LEAVE = "PART";
M = "MSG";
MUB = "UNBAN *";
N = "NAMES";
NMSG = "^MSG";
P = "PART";
Q = "QUERY";
RESET = "SET -default";
RUN = "SCRIPT LOAD";
SAY = "MSG *";
SB = "SCROLLBACK";
SBAR = "STATUSBAR";
SIGNOFF = "QUIT";
SV = "MSG * Irssi $J ($V) - https://irssi.org";
T = "TOPIC";
UB = "UNBAN";
UMODE = "MODE $N";
UNSET = "SET -clear";
W = "WHO";
WC = "WINDOW CLOSE";
WG = "WINDOW GOTO";
WJOIN = "JOIN -window";
WI = "WHOIS";
WII = "WHOIS $0 $0";
WL = "WINDOW LIST";
WN = "WINDOW NEW HIDDEN";
WQUERY = "QUERY -window";
WW = "WHOWAS";
};
statusbar = {
items = {
barstart = "{sbstart}";
barend = "{sbend}";
topicbarstart = "{topicsbstart}";
topicbarend = "{topicsbend}";
time = "{sb $Z}";
user = "{sb {sbnickmode $cumode}$N{sbmode $usermode}{sbaway $A}}";
window = "{sb $winref:$tag/$itemname{sbmode $M}}";
window_empty = "{sb $winref{sbservertag $tag}}";
prompt = "{prompt $[.15]itemname}";
prompt_empty = "{prompt $winname}";
topic = " $topic";
topic_empty = " Irssi v$J - https://irssi.org";
lag = "{sb Lag: $0-}";
act = "{sb Act: $0-}";
more = "-- more --";
};
default = {
window = {
disabled = "yes";
type = "window";
placement = "bottom";
position = "1";
visible = "active";
items = {
barstart = { priority = "100"; };
time = { };
user = { };
window = { };
window_empty = { };
lag = { priority = "-1"; };
act = { priority = "10"; };
more = { priority = "-1"; alignment = "right"; };
barend = { priority = "100"; alignment = "right"; };
};
};
window_inact = {
type = "window";
placement = "bottom";
position = "1";
visible = "inactive";
items = {
barstart = { priority = "100"; };
window = { };
window_empty = { };
more = { priority = "-1"; alignment = "right"; };
barend = { priority = "100"; alignment = "right"; };
};
};
prompt = {
type = "root";
placement = "bottom";
position = "100";
visible = "always";
items = {
prompt = { priority = "-1"; };
prompt_empty = { priority = "-1"; };
input = { priority = "10"; };
};
};
topic = {
type = "root";
placement = "top";
position = "1";
visible = "always";
items = {
topicbarstart = { priority = "100"; };
topic = { };
topic_empty = { };
topicbarend = { priority = "100"; alignment = "right"; };
};
};
};
};
settings = {
core = {
real_name = "Unknown";
user_name = "stormux";
nick = "stormux";
};
"fe-text" = { actlist_sort = "refnum"; };
"fe-common/core" = { timestamps = "no"; };
};
windows = {
1 = { immortal = "yes"; name = "(status)"; level = "ALL"; };
2 = {
items = (
{
type = "CHANNEL";
chat_type = "IRC";
name = "#stormux";
tag = "Stormux";
}
);
};
};
mainwindows = {
2 = {
first_line = "1";
lines = "46";
first_column = "0";
columns = "170";
};
};

View File

@@ -0,0 +1,293 @@
use strict;
use vars qw($VERSION %IRSSI);
use Irssi;
$VERSION = '0.0.3';
%IRSSI = (
authors => 'Storm and Jeremiah',
contact => 'blah@blah.blah',
name => 'irssi-sound',
description => 'Play sounds for different events in IRSSI.',
url => 'https://github.com/stormdragon2976/irssi-sound',
license => 'GNU General Public License',
changed => '$Date: 2007-02-07 12:00:00 +0100 (Thu, 7 Feb 2008) $'
);
#--------------------------------------------------------------------
# Created by Chrelad
# Feb 7, 2008
#modified by Storm Dragon
#Also modified by Jeremiah
#Added private message sound and the ability to select sound method
#Sounds now play as a background process.
#--------------------------------------------------------------------
my $flood_protect = 1;
my $sound_tag;
sub sound_overflow_timeout() {
$flood_protect = 1;
Irssi::timeout_remove($sound_tag);
}
sub join_msg {
my ($server,$msg,$nick,$address,$target) = @_;
if ($server && ! Irssi::settings_get_bool("sounds")) {
return;;
} else {
if (my $joincmd = Irssi::settings_get_str("join_sound_command")) {
if ($flood_protect) {
my $sound_flood = Irssi::settings_get_int('sound_flood');
$sound_flood = 1000 if $sound_flood < 0;
Irssi::timeout_remove($sound_tag);
$sound_tag = Irssi::timeout_add($sound_flood, 'sound_overflow_timeout', undef);
system($joincmd);
$flood_protect = 0;
}
}
}
}
sub part_msg {
my ($server,$msg,$nick,$address,$target) = @_;
if ($server && ! Irssi::settings_get_bool("sounds")) {
return;;
} else {
if (my $partcmd = Irssi::settings_get_str("part_sound_command")) {
if ($flood_protect) {
my $sound_flood = Irssi::settings_get_int('sound_flood');
$sound_flood = 1000 if $sound_flood < 0;
Irssi::timeout_remove($sound_tag);
$sound_tag = Irssi::timeout_add($sound_flood, 'sound_overflow_timeout', undef);
system($partcmd);
$flood_protect = 0;
}
}
}
}
sub quit_msg {
my ($server,$msg,$nick,$address,$target) = @_;
if ($server && ! Irssi::settings_get_bool("sounds")) {
return;;
} else {
if (my $quitcmd = Irssi::settings_get_str("quit_sound_command")) {
if ($flood_protect) {
my $sound_flood = Irssi::settings_get_int('sound_flood');
$sound_flood = 1000 if $sound_flood < 0;
Irssi::timeout_remove($sound_tag);
$sound_tag = Irssi::timeout_add($sound_flood, 'sound_overflow_timeout', undef);
system($quitcmd);
$flood_protect = 0;
}
}
}
}
sub pub_msg {
my ($server,$msg,$nick,$address,$target) = @_;
if ($server && ! Irssi::settings_get_bool("sounds")) {
return;;
} else {
if (my $pubcmd = Irssi::settings_get_str("pub_sound_command")) {
if ($flood_protect) {
my $sound_flood = Irssi::settings_get_int('sound_flood');
$sound_flood = 1000 if $sound_flood < 0;
Irssi::timeout_remove($sound_tag);
$sound_tag = Irssi::timeout_add($sound_flood, 'sound_overflow_timeout', undef);
system($pubcmd);
$flood_protect = 0;
}
}
}
}
sub own_action_msg {
my ($server,$msg,$nick,$address,$target) = @_;
if ($server && ! Irssi::settings_get_bool("sounds")) {
return;;
} else {
if (my $ownactcmd = Irssi::settings_get_str("own_act_sound_command")) {
if ($flood_protect) {
my $sound_flood = Irssi::settings_get_int('sound_flood');
$sound_flood = 1000 if $sound_flood < 0;
Irssi::timeout_remove($sound_tag);
$sound_tag = Irssi::timeout_add($sound_flood, 'sound_overflow_timeout', undef);
system($ownactcmd);
$flood_protect = 0;
}
}
}
}
sub own_private_msg {
my ($server,$msg,$nick,$address,$target) = @_;
if ($server && ! Irssi::settings_get_bool("sounds")) {
return;;
} else {
if (my $ownprivcmd = Irssi::settings_get_str("own_privmsg_sound_command")) {
if ($flood_protect) {
my $sound_flood = Irssi::settings_get_int('sound_flood');
$sound_flood = 1000 if $sound_flood < 0;
Irssi::timeout_remove($sound_tag);
$sound_tag = Irssi::timeout_add($sound_flood, 'sound_overflow_timeout', undef);
system($ownprivcmd);
$flood_protect = 0;
}
}
}
}
sub action_msg {
my ($server,$msg,$nick,$address,$target) = @_;
if ($server && ! Irssi::settings_get_bool("sounds")) {
return;;
} else {
if (my $actcmd = Irssi::settings_get_str("action_sound_command")) {
if ($flood_protect) {
my $sound_flood = Irssi::settings_get_int('sound_flood');
$sound_flood = 1000 if $sound_flood < 0;
Irssi::timeout_remove($sound_tag);
$sound_tag = Irssi::timeout_add($sound_flood, 'sound_overflow_timeout', undef);
system($actcmd);
$flood_protect = 0;
}
}
}
}
sub own_msg {
my ($server,$msg,$nick,$address,$target) = @_;
if ($server && ! Irssi::settings_get_bool("sounds")) {
return;;
} else {
if (my $ownmsgcmd = Irssi::settings_get_str("own_msg_sound_command")) {
if ($flood_protect) {
my $sound_flood = Irssi::settings_get_int('sound_flood');
$sound_flood = 1000 if $sound_flood < 0;
Irssi::timeout_remove($sound_tag);
$sound_tag = Irssi::timeout_add($sound_flood, 'sound_overflow_timeout', undef);
system($ownmsgcmd);
$flood_protect = 0;
}
}
}
}
sub own_notice_msg {
my ($server,$msg,$nick,$address,$target) = @_;
if ($server && ! Irssi::settings_get_bool("sounds")) {
return;;
} else {
if (my $ownnoticecmd = Irssi::settings_get_str("own_notice_sound_command")) {
if ($flood_protect) {
my $sound_flood = Irssi::settings_get_int('sound_flood');
$sound_flood = 1000 if $sound_flood < 0;
Irssi::timeout_remove($sound_tag);
$sound_tag = Irssi::timeout_add($sound_flood, 'sound_overflow_timeout', undef);
system($ownnoticecmd);
$flood_protect = 0;
}
}
}
}
sub notice_msg {
my ($server,$msg,$nick,$address,$target) = @_;
if ($server && ! Irssi::settings_get_bool("sounds")) {
return;;
} else {
if (my $noticecmd = Irssi::settings_get_str("notice_sound_command")) {
if ($flood_protect) {
my $sound_flood = Irssi::settings_get_int('sound_flood');
$sound_flood = 1000 if $sound_flood < 0;
Irssi::timeout_remove($sound_tag);
$sound_tag = Irssi::timeout_add($sound_flood, 'sound_overflow_timeout', undef);
system($noticecmd);
$flood_protect = 0;
}
}
}
}
sub pri_msg {
my ($server,$msg,$nick,$address,$target) = @_;
if ($server && ! Irssi::settings_get_bool("sounds")) {
return;;
} else {
if (my $privmsgcmd = Irssi::settings_get_str("privmsg_sound_command")) {
if ($flood_protect) {
my $sound_flood = Irssi::settings_get_int('sound_flood');
$sound_flood = 1000 if $sound_flood < 0;
Irssi::timeout_remove($sound_tag);
$sound_tag = Irssi::timeout_add($sound_flood, 'sound_overflow_timeout', undef);
system($privmsgcmd);
$flood_protect = 0;
}
}
}
}
sub hilight {
my ($dest, $text, $stripped) = @_;
my $server = $dest->{server};
my $window = Irssi::active_server();
if (!($server &&
$dest->{level} & (MSGLEVEL_HILIGHT) &&
$server->ischannel($dest->{target}) &&
$window->{refnum} != $dest->{window}->{refnum})) {
return;
}
if ($server && ! Irssi::settings_get_bool("sounds")) {
return;
} else {
if (my $hilightcmd = Irssi::settings_get_str("hilight_sound_command")) {
system($hilightcmd);
}
}
}
#add settings and defaults
Irssi::settings_add_bool("lookandfeel", "sounds", 1);
Irssi::settings_add_int("lookandfeel", "sound_flood", 250);
Irssi::settings_add_str("misc", "join_sound_command",
"play -qnV0 synth tri 1500 tri 1800 delay 0 .12 fade h 0 .2 remix - norm -15 &> /dev/null&");
Irssi::settings_add_str("misc", "part_sound_command",
"play -qnV0 synth tri 1800 tri 1500 delay 0 .12 fade h 0 .2 remix - norm -8 &> /dev/null&");
Irssi::settings_add_str("misc", "quit_sound_command",
"play -qnV0 synth pi fade h 0 1 1 pad 0 1 reverb overdrive riaa norm -20 &> /dev/null&");
Irssi::settings_add_str("misc", "pub_sound_command",
"play -qnV0 synth 0.09 tri E3:B3 norm -15 &> /dev/null&");
Irssi::settings_add_str("misc", "own_act_sound_command",
"play -qnV0 synth 0.25 tri G5:E1 tri B5:D1 remix - norm -15 &> /dev/null&");
Irssi::settings_add_str("misc", "own_privmsg_sound_command",
"play -qnV0 synth pl G2 pl G3 pl B2 pl B3 pl D3 pl D4 pl G3 pl G4 pl D4 pl D4 pl G4 pl G4 delay 0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 remix - phaser fade p 0 0.5 0.3 norm -15 &> /dev/null&");
Irssi::settings_add_str("misc", "action_sound_command",
"play -qnV0 synth 0.25 tri E1:G5 tri D1:B5 remix - norm -15 &> /dev/null&");
Irssi::settings_add_str("misc", "own_msg_sound_command",
"play -qnV0 synth 0.09 tri B3:E3 norm -15 &> /dev/null&");
Irssi::settings_add_str("misc", "own_notice_sound_command",
"play -nqV0 synth pi fade h 0 1 1 norm -20 pad 0 1 reverb overdrive riaa speed 32 repeat 3 norm -15 &> /dev/null&");
Irssi::settings_add_str("misc", "notice_sound_command",
"play -nqV0 synth pi fade h 0 1 1 norm -35 pad 0 1 reverb overdrive riaa speed 32 reverse repeat 3 &> /dev/null&");
Irssi::settings_add_str("misc", "privmsg_sound_command",
"play -qnV0 synth pl G4 pl G4 pl D4 pl D4 pl D4 pl D3 pl G4 pl G3 pl B3 pl B2 pl G3 pl G2 delay 0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 remix - phaser fade p 0 0.5 0.3 norm -8 &> /dev/null&");
Irssi::settings_add_str("misc", "hilight_sound_command",
"play -qnV0 synth 0.5 tri A3:D3 tri D3:A3 remix - norm -15 &> /dev/null&");
#add Signals
Irssi::signal_add_last("message public", "pub_msg");
Irssi::signal_add_last("message irc action", "action_msg");
Irssi::signal_add_last("message own_public", "own_msg");
Irssi::signal_add_last("message private", "pri_msg");
Irssi::signal_add_last("message own_private", "own_private_msg");
Irssi::signal_add_last("message irc own_action", "own_action_msg");
Irssi::signal_add_last("message irc own_notice", "own_notice_msg");
Irssi::signal_add_last("message irc notice", "notice_msg");
Irssi::signal_add_last('print text', "hilight");
Irssi::signal_add_last("event join", 'join_msg');
Irssi::signal_add_last("event quit", 'quit_msg');
Irssi::signal_add_last("event part", 'part_msg');
Irssi::signal_add_last("event kick", 'part_msg');
#- end