Skip to content

Commit

Permalink
Merge pull request #21 from datsfilipe/feat-replace-trash-cli
Browse files Browse the repository at this point in the history
feat: replace trash cli with custom script
  • Loading branch information
datsfilipe authored Jan 9, 2025
2 parents 77fd587 + c12fb5d commit 58fa89e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 10 deletions.
8 changes: 4 additions & 4 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 6 additions & 5 deletions home/base/core/shells/shellAliases.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
"lla"="eza --color always --icons -1galb -s name --git --sort date --group-directories-first";
"tree"="eza --tree -D -L 3";

"del"="trash-put";
"dels"="trash-list";
"delu"="trash-restore";
"delc"="trash-empty";
"delr"="trash-rm";
"del"="trash";
"dels"="trash --list";
"delu"="trash --fzf";
"delr"="trash --restore";
"delc"="trash --cleanup";
"delca"="trash --cleanup-all";

"g"="git";
"ga"="git add";
Expand Down
2 changes: 1 addition & 1 deletion home/linux/base/scripts/conf
Submodule conf updated 1 files
+94 −0 trash
3 changes: 3 additions & 0 deletions modules/nixos/desktop/gc.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ let
in {
systemd.services.path-garbage-collector = {
description = "Clean up old files from specified paths";
path = [ pkgs.findutils pkgs.coreutils ];
serviceConfig = {
Type = "oneshot";
ExecStart = pkgs.writeShellScript "cleanup-paths" ''
Expand All @@ -14,6 +15,8 @@ in {
find "$path" -type f -mtime +"''${age%d}" -delete 2>/dev/null
fi
done < ${configFile}
find / -type d \( -name ".trash" -o -name ".Trash" -o -name ".Trash-1000" \) -exec $(which rm) -rf {} + 2>/dev/null || true
'';
};
};
Expand Down

0 comments on commit 58fa89e

Please sign in to comment.