From e573b3020c032400eed60b649a2cbf55266e6bb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Thu, 30 Jun 2016 16:03:25 +0200 Subject: Add current configurations from old repository --- config/i3blocks/scripts/backup | 47 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100755 config/i3blocks/scripts/backup (limited to 'config/i3blocks/scripts/backup') diff --git a/config/i3blocks/scripts/backup b/config/i3blocks/scripts/backup new file mode 100755 index 0000000..24b3954 --- /dev/null +++ b/config/i3blocks/scripts/backup @@ -0,0 +1,47 @@ +#!/bin/bash + +if [[ -n "$BLOCK_BUTTON" ]]; then + nohup urxvt -title "System backup" -hold -e sudo system-backup 2>&1 >/dev/null & +fi + +state=5 +if [[ -e ~/.backup_date ]]; then + today=$(date +"%Y%m%d") + prev=$(date -d `cat ~/.backup_date` +"%Y%m%d") + dif=$(expr $today - $prev) + if [[ $dif -ge 30 ]]; then + state=4 + elif [[ $dif -ge 20 ]]; then + state=3 + elif [[ $dif -ge 5 ]]; then + state=2 + elif [[ $dif -ge 2 ]]; then + state=1 + else + state=0 + fi +fi + +if [[ $state -eq 0 ]]; then + exit 0 +fi + +echo "Do backup" +echo "Backup" +case $state in + 1) + echo + ;; + 2) + echo "#ffff00" + ;; + 3) + echo "#ff8a00" + ;; + 4) + echo "#ff5000" + ;; + 5) + echo "#ff0000" + ;; +esac -- cgit v1.2.3