mirror of
https://github.com/kmein/niveum
synced 2026-03-28 23:31:07 +01:00
Compare commits
3 Commits
eb79f88c59
...
6cf3072609
| Author | SHA1 | Date | |
|---|---|---|---|
| 6cf3072609 | |||
| 4fe122f06c | |||
| 4fa6a62966 |
@@ -138,7 +138,7 @@ in {
|
||||
cdt = "source ${cdt}";
|
||||
vit = "$EDITOR $(mktemp)";
|
||||
tmux = "${pkgs.tmux}/bin/tmux -2";
|
||||
sxiv = swallow "${pkgs.sxiv}/bin/sxiv";
|
||||
sxiv = swallow "${pkgs.nsxiv}/bin/nsxiv";
|
||||
zathura = swallow "${pkgs.zathura}/bin/zathura";
|
||||
us = "${pkgs.systemd}/bin/systemctl --user";
|
||||
wcd = "source ${wcd}";
|
||||
@@ -264,7 +264,7 @@ in {
|
||||
./ssh.nix
|
||||
./sshd.nix
|
||||
./sudo.nix
|
||||
./sxiv.nix
|
||||
./nsxiv.nix
|
||||
./themes.nix
|
||||
./tmux.nix
|
||||
./traadfri.nix
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
"application/pdf" = "org.pwmt.zathura.desktop";
|
||||
"application/vnd.oasis.opendocument.text" = "writer.desktop";
|
||||
"application/vnd.openxmlformats-officedocument.wordprocessingml.document" = "writer.desktop";
|
||||
"image/jpeg" = "sxiv.desktop";
|
||||
"image/png" = "sxiv.desktop";
|
||||
"image/jpeg" = "nsxiv.desktop";
|
||||
"image/png" = "nsxiv.desktop";
|
||||
"image/vnd.djvu+multipage" = "org.pwmt.zathura.desktop";
|
||||
"text/html" = "brave-browser.desktop";
|
||||
"text/markdown" = "nvim.desktop";
|
||||
|
||||
@@ -25,7 +25,7 @@ in {
|
||||
pkgs.writeText "mailcap" ''
|
||||
text/plain; $EDITOR %s ;
|
||||
text/html; ${pkgs.lynx}/bin/lynx -assume_charset=%{charset} -display_charset=utf-8 -dump %s; nametemplate=%s.html; copiousoutput;
|
||||
image/*; ${pkgs.sxiv}/bin/sxiv %s ;
|
||||
image/*; ${pkgs.nsxiv}/bin/nsxiv %s ;
|
||||
video/*; ${pkgs.utillinux}/bin/setsid ${pkgs.mpv}/bin/mpv --quiet %s &; copiousoutput
|
||||
audio/*; ${pkgs.mpv}/bin/mpv %s ;
|
||||
application/pdf; ${pkgs.zathura}/bin/zathura %s ;
|
||||
|
||||
@@ -15,10 +15,10 @@
|
||||
cf ''${XDG_CONFIG_HOME:-$HOME/.config}
|
||||
'';
|
||||
in {
|
||||
environment.systemPackages = [pkgs.sxiv];
|
||||
environment.systemPackages = [pkgs.nsxiv];
|
||||
|
||||
# TODO fix
|
||||
home-manager.users.me.xdg.configFile."sxiv/exec/key-handler".source = pkgs.writers.writeDash "key-handler" ''
|
||||
home-manager.users.me.xdg.configFile."nsxiv/exec/key-handler".source = pkgs.writers.writeDash "key-handler" ''
|
||||
PATH=$PATH:${
|
||||
lib.makeBinPath [
|
||||
pkgs.gnused
|
||||
@@ -13,6 +13,8 @@ in {
|
||||
command = "${pkgs.coreutils}/bin/shuf -n1 ${hesychius}";
|
||||
};
|
||||
|
||||
systemd.timers.telegram-bot-hesychius.timerConfig.RandomizedDelaySec = "10h";
|
||||
|
||||
niveum.passport.services = [
|
||||
{
|
||||
title = "Hesychius of Alexandria Bot";
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
}: {
|
||||
niveum.telegramBots.smyth = {
|
||||
enable = true;
|
||||
time = "08/6:00";
|
||||
time = "06/6:00";
|
||||
token = lib.strings.fileContents <system-secrets/telegram/kmein.token>;
|
||||
chatIds = ["@HerbertWeirSmyth"];
|
||||
command = toString (pkgs.writers.writeDash "random-smyth" ''
|
||||
@@ -25,6 +25,8 @@
|
||||
'');
|
||||
};
|
||||
|
||||
systemd.timers.telegram-bot-smyth.timerConfig.RandomizedDelaySec = "3h";
|
||||
|
||||
niveum.passport.services = [
|
||||
{
|
||||
title = "Herbert Weir Smyth Bot";
|
||||
|
||||
@@ -113,17 +113,17 @@ in {
|
||||
block = "custom";
|
||||
interval = 60 * 5;
|
||||
command = let
|
||||
query-account = name: account:
|
||||
pkgs.writers.writeDash "query-imap-${name}" ''
|
||||
${pkgs.curl}/bin/curl -sSL -u ${lib.escapeShellArg "${account.user}:${account.password}"} imaps://${account.imap} -X 'STATUS INBOX (UNSEEN)' \
|
||||
| ${pkgs.gnugrep}/bin/grep -Eo '[0-9]+' \
|
||||
| sed 's/^/{"${name}":/;s/$/}/'
|
||||
'';
|
||||
query-account = name: account: "${pkgs.writers.writeDash "query-imap-${name}" ''
|
||||
${pkgs.coreutils}/bin/timeout 1 ${pkgs.curl}/bin/curl -sSL -u ${lib.escapeShellArg "${account.user}:${account.password}"} imaps://${account.imap} -X 'STATUS INBOX (UNSEEN)' \
|
||||
| ${pkgs.gnugrep}/bin/grep -Eo '[0-9]+' \
|
||||
| sed 's/^/{"${name}":/;s/$/}/'
|
||||
''} &";
|
||||
in
|
||||
pkgs.writers.writeDash "unread-mail" ''
|
||||
{
|
||||
${lib.concatStringsSep "\n" (lib.mapAttrsToList query-account accounts)}
|
||||
} | jq -s '
|
||||
wait
|
||||
} | jq -s 'if length == 0 then {text: "", icon: "mail", state: "Idle"} else
|
||||
add
|
||||
| (values | add) as $sum
|
||||
| {
|
||||
@@ -138,7 +138,7 @@ in {
|
||||
"Idle"
|
||||
end
|
||||
)
|
||||
}'
|
||||
} end'
|
||||
'';
|
||||
json = true;
|
||||
hide_when_empty = true;
|
||||
@@ -147,7 +147,7 @@ in {
|
||||
block = "custom";
|
||||
interval = 60;
|
||||
command = pkgs.writers.writeDash "weechat" ''
|
||||
ssh makanek cat /var/lib/weechat/hotlist.txt | sed 's/,/\n/g' | wc -l | jq '{
|
||||
ssh -o ConnectTimeout=1 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"
|
||||
|
||||
@@ -96,7 +96,7 @@ in
|
||||
rm "$file"
|
||||
}
|
||||
${pkgs.qrencode}/bin/qrencode "$(${pkgs.xclip}/bin/xclip -selection clipboard -out)" -o "$file"
|
||||
${pkgs.sxiv}/bin/sxiv "$file"
|
||||
${pkgs.nsxiv}/bin/nsxiv "$file"
|
||||
'';
|
||||
|
||||
ttspaste = pkgs.writers.writeDashBin "ttspaste" ''
|
||||
@@ -123,7 +123,7 @@ in
|
||||
};
|
||||
|
||||
meteo = wrapScript {
|
||||
packages = [pkgs.jq pkgs.curl pkgs.xdotool pkgs.sxiv pkgs.gnused];
|
||||
packages = [pkgs.jq pkgs.curl pkgs.xdotool pkgs.nsxiv pkgs.gnused];
|
||||
script = ./meteo.sh;
|
||||
name = "meteo";
|
||||
};
|
||||
|
||||
@@ -69,8 +69,8 @@ curl -sSL \
|
||||
"http://wetterstationen.meteomedia.de/messnetz/vorhersagegrafik/$station.png" \
|
||||
-o "$cache"
|
||||
|
||||
if window_id=$(xdotool search --name "^sxiv - $cache$"); then
|
||||
if window_id=$(xdotool search --name "^nsxiv - $cache$"); then
|
||||
xdotool key --window "$window_id" r
|
||||
else
|
||||
sxiv "$cache" &
|
||||
nsxiv "$cache" &
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user