From d5ffb01d87852eb74f6b17ae06ac0c476010065b Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Mon, 14 Oct 2024 21:34:04 +0200 Subject: Add new scripts Signed-off-by: Florian Pritz --- i3-dump-layout-all | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100755 i3-dump-layout-all (limited to 'i3-dump-layout-all') diff --git a/i3-dump-layout-all b/i3-dump-layout-all new file mode 100755 index 0000000..743328f --- /dev/null +++ b/i3-dump-layout-all @@ -0,0 +1,26 @@ +#!/bin/bash + +set -e + +for i in {1..20}; do + i3-resurrect save -w $i --swallow=class,instance,title +done + +backupdir=~/.i3/i3-resurrect-backups +keep_backups=30 + +mkdir -p "$backupdir" +cp -r ~/.i3/i3-resurrect $backupdir/0 + +if [[ -d "$backupdir/$keep_backups" ]]; then + rm -rf "$backupdir/$keep_backups" +fi + +i=$((keep_backups - 1)) +while ((i >= 0)); do + if [[ -d "$backupdir/$i/" ]]; then + mv -n "$backupdir/$i/" "$backupdir/$((i + 1))"/ + fi + i=$((i - 1)) +done + -- cgit v1.2.3-24-g4f1b