summaryrefslogtreecommitdiffstats
path: root/i3-dump-layout-all
diff options
context:
space:
mode:
Diffstat (limited to 'i3-dump-layout-all')
-rwxr-xr-xi3-dump-layout-all26
1 files changed, 26 insertions, 0 deletions
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
+