2b3544b4a5
trash-cli 是 Python 写的老牌方案,启动开销大且 5 年未发布正式 release。gomi 是 Go 实现的现代替代品: - 完整兼容 freedesktop.org Trash 规范,与 yazi/GNOME/KDE 互通 - 提供交互式 TUI 浏览/恢复界面(gomi 无参数即进入) - 性能比 trash-cli 快约 10 倍 - 极活跃维护,AUR 提供预编译 gomi-bin 回收站数据无缝迁移:两者都使用 ~/.local/share/Trash/。 - pacman: -trash-cli - aur: +gomi-bin - .zshrc: alias rm: trash-put → gomi
74 lines
1.8 KiB
Python
74 lines
1.8 KiB
Python
from decman import File, Module
|
|
from decman.plugins.aur import packages as aur_packages
|
|
from decman.plugins.pacman import packages as pacman_packages
|
|
|
|
|
|
class BaseModule(Module):
|
|
def __init__(self, user: str):
|
|
super().__init__("base")
|
|
self.user = user
|
|
|
|
def files(self):
|
|
return {
|
|
"/etc/pacman.conf": File(
|
|
source_file="./system/etc/pacman.conf",
|
|
),
|
|
"/etc/pacman.d/mirrorlist": File(
|
|
source_file="./system/etc/pacman.d/mirrorlist",
|
|
),
|
|
"/etc/sudoers.d/10-wheel": File(
|
|
source_file="./system/etc/sudoers.d/10-wheel",
|
|
permissions=0o440,
|
|
),
|
|
f"/home/{self.user}/.config/git/config": File(
|
|
source_file="./home/.config/git/config",
|
|
owner=self.user,
|
|
),
|
|
f"/home/{self.user}/.config/starship.toml": File(
|
|
source_file="./home/.config/starship.toml",
|
|
owner=self.user,
|
|
),
|
|
}
|
|
|
|
@pacman_packages
|
|
def pacman_packages(self) -> set[str]:
|
|
return {
|
|
"7zip",
|
|
"atuin",
|
|
"base-devel",
|
|
"base",
|
|
"bat",
|
|
"btop",
|
|
"curl",
|
|
"direnv",
|
|
"duf",
|
|
"dust",
|
|
"eza",
|
|
"fastfetch",
|
|
"fd",
|
|
"git-delta",
|
|
"git",
|
|
"jq",
|
|
"micro",
|
|
"ouch",
|
|
"procs",
|
|
"ripgrep",
|
|
"sd",
|
|
"starship",
|
|
"sudo",
|
|
"tealdeer",
|
|
"vim",
|
|
"wget",
|
|
"xh",
|
|
"yazi",
|
|
"yq",
|
|
"zoxide",
|
|
}
|
|
|
|
@aur_packages
|
|
def aur_packages(self) -> set[str]:
|
|
return {
|
|
"decman",
|
|
"gomi-bin",
|
|
}
|