This commit is contained in:
parent
722a5814fa
commit
2870a256da
4 changed files with 24 additions and 0 deletions
21
packages/zet-new.nix
Normal file
21
packages/zet-new.nix
Normal file
|
@ -0,0 +1,21 @@
|
|||
{ pkgs }:
|
||||
|
||||
pkgs.writeShellApplication {
|
||||
name = "zet-new";
|
||||
|
||||
runtimeInputs = with pkgs; [
|
||||
coreutils
|
||||
];
|
||||
|
||||
text = ''
|
||||
folder="''${ZET_DIR:-"$XDG_DOCUMENTS_DIR/wiki/zet"}"
|
||||
|
||||
mkdir -p "$folder"
|
||||
|
||||
note="$folder/$(date +%Y-%m-%d-%T | sed 's/[-:]//g').md"
|
||||
|
||||
printf "# %s\n\n\n" "$1" > "$note"
|
||||
|
||||
"$EDITOR" "+normal G" "$note"
|
||||
'';
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue