Initial Ubuntu 24.04 Niri installer
This commit is contained in:
Executable
+29
@@ -0,0 +1,29 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
config_home="${XDG_CONFIG_HOME:-$HOME/.config}"
|
||||
state_home="${XDG_STATE_HOME:-$HOME/.local/state}"
|
||||
backup_root="$state_home/niri-beyond-glass/backups"
|
||||
latest=""
|
||||
|
||||
if [[ -d "$backup_root" ]]; then
|
||||
latest="$(find "$backup_root" -mindepth 1 -maxdepth 1 -type d -printf '%p\n' | sort | tail -n 1)"
|
||||
fi
|
||||
|
||||
rm -rf \
|
||||
"$config_home/niri" \
|
||||
"$config_home/waybar" \
|
||||
"$config_home/fuzzel" \
|
||||
"$config_home/mako" \
|
||||
"$config_home/swaylock" \
|
||||
"$config_home/niri-beyond-glass"
|
||||
rm -f "$HOME/.local/bin/niri-beyond-wallpaper"
|
||||
|
||||
if [[ -n "$latest" && -d "$latest/config" ]]; then
|
||||
cp -a "$latest/config/." "$config_home/"
|
||||
printf '已恢复备份:%s\n' "$latest"
|
||||
else
|
||||
printf '配置已移除;没有找到可恢复的备份。\n'
|
||||
fi
|
||||
|
||||
printf 'Niri 和系统软件包被保留。GNOME/GDM 未修改。\n'
|
||||
Reference in New Issue
Block a user