Add dingdingding
This commit is contained in:
parent
b552ca6414
commit
c1ecd8f7f0
2 changed files with 35 additions and 0 deletions
|
@ -181,6 +181,9 @@
|
||||||
pkgs.writeShellScriptBin "print-ssh-pw"
|
pkgs.writeShellScriptBin "print-ssh-pw"
|
||||||
"pass show eu/m-0/${config.m-0.hostName}.m-0.eu/ssh-key"
|
"pass show eu/m-0/${config.m-0.hostName}.m-0.eu/ssh-key"
|
||||||
)
|
)
|
||||||
|
(
|
||||||
|
pkgs.writeShellScriptBin "dingdingding" (builtins.readFile ./signal.sh)
|
||||||
|
)
|
||||||
];
|
];
|
||||||
sessionVariables = {
|
sessionVariables = {
|
||||||
PATH = "$HOME/.nix-profile/bin:$PATH";
|
PATH = "$HOME/.nix-profile/bin:$PATH";
|
||||||
|
|
32
home-manager/roles/signal.sh
Executable file
32
home-manager/roles/signal.sh
Executable file
|
@ -0,0 +1,32 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
x=$1
|
||||||
|
|
||||||
|
while true; do
|
||||||
|
|
||||||
|
if [[ "$x" == "0" ]]; then
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "$x" != "" ]]; then
|
||||||
|
echo "$x rings left"
|
||||||
|
x=$(( x - 1 ))
|
||||||
|
fi
|
||||||
|
|
||||||
|
current_seconds=$(date +%S)
|
||||||
|
current_minute=$(date +%M)
|
||||||
|
|
||||||
|
if (($current_minute < 30)); then
|
||||||
|
echo "Next ring at half hour."
|
||||||
|
sleep_seconds=$(( (29 - $current_minute)*60+ (60 - $current_seconds)))
|
||||||
|
else
|
||||||
|
echo "Next ring at full hour."
|
||||||
|
sleep_seconds=$(( (59 - $current_minute)*60+ (60 - $current_seconds)))
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Sleeping for $sleep_seconds seconds."
|
||||||
|
sleep $sleep_seconds
|
||||||
|
|
||||||
|
echo "Ringing Bell"
|
||||||
|
mpv ./bell.opus
|
||||||
|
done
|
Loading…
Reference in a new issue