mirror of
https://github.com/kmein/niveum
synced 2026-03-16 10:11:08 +01:00
feat(i3status-rust): show number of hot weechat buffers
This commit is contained in:
@@ -36,6 +36,7 @@ in {
|
||||
icons.name = "awesome6";
|
||||
icons.overrides.rss = "";
|
||||
icons.overrides.vpn = "";
|
||||
icons.overrides.irc = "";
|
||||
block = [
|
||||
{
|
||||
block = "weather";
|
||||
@@ -142,6 +143,19 @@ in {
|
||||
json = true;
|
||||
hide_when_empty = true;
|
||||
}
|
||||
{
|
||||
block = "custom";
|
||||
interval = 60;
|
||||
command = pkgs.writers.writeDash "weechat" ''
|
||||
ssh makanek cat /var/lib/weechat/hotlist.txt | sed 's/,/\n/g' | wc -l | jq '{
|
||||
text: (if . > 0 then . | tostring else "" end),
|
||||
state: (if . > 0 then "Info" else "Idle" end),
|
||||
icon: "irc"
|
||||
}'
|
||||
'';
|
||||
json = true;
|
||||
hide_when_empty = true;
|
||||
}
|
||||
{
|
||||
block = "custom";
|
||||
interval = 5;
|
||||
|
||||
33
packages/weechatScripts/hotlist2extern.nix
Normal file
33
packages/weechatScripts/hotlist2extern.nix
Normal file
@@ -0,0 +1,33 @@
|
||||
{
|
||||
stdenv,
|
||||
lib,
|
||||
fetchurl,
|
||||
weechat,
|
||||
}:
|
||||
stdenv.mkDerivation {
|
||||
pname = "hotlist2extern";
|
||||
version = "1.0";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://raw.githubusercontent.com/weechat/scripts/dd627975cf2e464f206f8006cb3963c8ee82044c/perl/hotlist2extern.pl";
|
||||
sha256 = "1flpikm1kq6m9rh3hmafni9f2yi1b90w539k3hj55a5c9gddp2lr";
|
||||
};
|
||||
|
||||
dontUnpack = true;
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/share
|
||||
cp $src $out/share/hotlist2extern.pl
|
||||
'';
|
||||
|
||||
passthru = {
|
||||
scripts = ["hotlist2extern.pl"];
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
inherit (weechat.meta) platforms;
|
||||
description = "Give hotlist to an external file/program";
|
||||
license = licenses.gpl3;
|
||||
maintainers = with maintainers; [kmein];
|
||||
};
|
||||
}
|
||||
@@ -5,6 +5,7 @@
|
||||
}: let
|
||||
inherit (import <niveum/lib>) kieran;
|
||||
relayPassword = lib.fileContents <system-secrets/weechat/relay>;
|
||||
weechatHome = "/var/lib/weechat";
|
||||
in {
|
||||
systemd.services.weechat = let
|
||||
tmux = pkgs.writers.writeDash "tmux" ''
|
||||
@@ -31,6 +32,7 @@ in {
|
||||
pkgs.weechatScripts.weechat-autosort
|
||||
pkgs.weechatScripts.colorize_nicks
|
||||
pkgs.weechatScripts.weechat-matrix
|
||||
(pkgs.callPackage <niveum/packages/weechatScripts/hotlist2extern.nix> {})
|
||||
];
|
||||
settings = let
|
||||
nick = "kmein";
|
||||
@@ -106,6 +108,13 @@ in {
|
||||
};
|
||||
};
|
||||
logger.level.irc.news = 0;
|
||||
plugins.var.perl.hotlist2extern = {
|
||||
external_command_hotlist = "echo %X > ${weechatHome}/hotlist.txt";
|
||||
external_command_hotlist_empty = "echo -n %X > ${weechatHome}/hotlist.txt";
|
||||
lowest_priority = "2";
|
||||
use_title = "off";
|
||||
delimiter = ",";
|
||||
};
|
||||
matrix.server.nibbana = {
|
||||
address = "nibbana.jp";
|
||||
username = nick;
|
||||
@@ -163,7 +172,7 @@ in {
|
||||
wantedBy = ["multi-user.target"];
|
||||
restartIfChanged = true;
|
||||
path = [pkgs.alacritty.terminfo];
|
||||
environment.WEECHAT_HOME = "/var/lib/weechat";
|
||||
environment.WEECHAT_HOME = weechatHome;
|
||||
preStart = "${pkgs.coreutils}/bin/rm $WEECHAT_HOME/*.conf";
|
||||
script = "${tmux} -2 new-session -d -s IM ${weechat}/bin/weechat";
|
||||
preStop = "${tmux} kill-session -t IM";
|
||||
|
||||
Reference in New Issue
Block a user