feat: add preview to swu selector

This commit is contained in:
Michael Mandl 2025-05-20 12:58:15 +02:00
parent dfec21163a
commit 9b1e3b6bc9
Signed by: mandlm
GPG key ID: 088ED38F036C7AF2

View file

@ -1,5 +1,4 @@
{ ... }:
{
{...}: {
programs.zsh.initContent = ''
if [ -f $HOME/.nix-profile/etc/profile.d/nix.sh ];
then
@ -54,8 +53,11 @@
local ssh_login="fusion"
local update_file=''${1}
local fzf_preview='stat --printf "%n\nSize: %s bytes\nModified: %y" {}'
if [ -z ''${update_file} ]; then
update_file=$(find build/tmp/deploy/images -name "*.swu" -type f | fzf --select-1)
update_file=$(find build/tmp/deploy/images -name "*.swu" -type f \
| fzf --select-1 --exit-0 --header "Select a update file" --preview=''${fzf_preview} --preview-window=top)
fi
if [ -z ''${update_file} ]; then