forked from Shinonome/dots-hyprland
Refactor: consistently use temporary files and mv (atomic operation)
This commit is contained in:
@@ -27,7 +27,7 @@ kill_existing_mpvpaper() {
|
||||
create_restore_script() {
|
||||
local video_path=$1
|
||||
|
||||
cat > "$RESTORE_SCRIPT" << EOF
|
||||
cat > "$RESTORE_SCRIPT.tmp" << EOF
|
||||
#!/bin/bash
|
||||
# Generated by switchwall.sh - Don't modify it by yourself.
|
||||
# Time: $(date)
|
||||
@@ -40,6 +40,7 @@ for monitor in \$(hyprctl monitors -j | jq -r '.[] | .name'); do
|
||||
done
|
||||
EOF
|
||||
|
||||
mv "$RESTORE_SCRIPT.tmp" $RESTORE_SCRIPT
|
||||
chmod +x "$RESTORE_SCRIPT"
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user