Open salahoued opened 1 month ago
maybe something like this in rofi-setup.sh
if [ -h "$HOME/.config/rofi" ]; then
for i in "$HOME/.config/rofi"/*; do
cp -r "$HOME/.config/rofi/$i" "$HOME/.config/rofi/$i.bak"
done
elif [ ! -h "$HOME/.config/rofi" -a -d "$HOME/.config/rofi" ]; then
cp -r "$HOME/.config/rofi" "$HOME/.config/rofi.bak"
fi
or add a checkIsSymlink()
in common-script.sh
that will be used in any dotfiles set up
Can you try adding the -L flag to the cp command? That option should first dereference all symlinks.
Yes, that works, there is now an actual directory not symlink ~/.config/rofi.bak
with the all the files in it,
This is just a personal opinion, but it would be better to have it this way: for example move ~/.config/rasi/config.rasi
to ~/.config/rofi/config.rasi.bak
and any other files in it be renamed in the same way if it exists in the old and new config. so that it can be managed by dotfiles managers
thanks
Describe the bug
I use
stow
to manage mydotfiles
, so my personel configs under.config
are mostlysymbolic links
, So when setting up (for example)rofi
,linutil
tries to backup the.config/rofi
with.config/rofi.bak
, but it will end up as asymlink
pointing to the same directory as.config/rofi
, resulting in losing any old/previous configurations.To Reproduce
Steps to reproduce the behavior:
symlink
in~/.config
pointing to different directory:~/.config/rofi
->~/Documents/config/rofi
linutil
to set up
rofi~/.config/rofi
and~/.config/rofi.bak
are pointing to the same~/Documents/config/rofi
and the oldconfig.rasi
is lostExpected behavior
maybe check if
~/.config/rofi
is a symlink or a directory before backing it up.~/.config/rofi
directory where the new config will reside~/.config/rofi
and backing up each and every file and directory before copying the new configpersonally, I prefer the second option this way the user, can still keep his old config and enjoy the new one, while still managing it with
dotfiles
management solution.Screenshots