-
Notifications
You must be signed in to change notification settings - Fork 2
/
back-in-time-helper.desktop
51 lines (47 loc) · 2.87 KB
/
back-in-time-helper.desktop
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#
# KDE Service Menu - Back In Time Helper
#
# servicemenus-back-in-time-helper.desktop Version 0.9.1
# Copyright (C) 2022 Christian Hartmann <[email protected]>
#
# SPDX-FileCopyrightText: 2022 Christian Hartmann <[email protected]>
#
# SPDX-License-Identifier: LicenseRef-KDE-Accepted-GPL
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 3 of
# the license or (at your option) at any later version that is
# accepted by the membership of KDE e.V. (or its successor
# approved by the membership of KDE e.V.), which shall act as a
# proxy as defined in Section 14 of version 3 of the license.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
[Desktop Entry]
Type=Service
X-KDE-ServiceTypes=KonqPopupMenu/Plugin
X-KDE-Priority=TopLevel
X-KDE-Submenu=Back In Time ...
MimeType=all/all;
Icon=document-save-all
TryExec=backintime
Actions=B_RestoreFromLastSnap;C_RestoreFromSnapshotSelectable;S_SyncThis;X_RefreshFromSnapshotsListAndActions;
[Desktop Action B_RestoreFromLastSnap]
Name=Restore from last Snapshot
Name[nl]=Recentste reservekopie herstellen
Icon=document-save-all
Exec=bash -c 'target="%f" ; last_snapshot_path="$(backintime --quiet last-snapshot-path)" ; test -e "${last_snapshot_path}/backup/$target" && backintime restore "%f" "" 0 || kdialog --error "Oooops .. seems there is no backup for this in last snapshot"'
[Desktop Action C_RestoreFromSnapshotSelectable]
Name=Restore from Snapshot (selectable)
Name[nl]=Reservekopie herstellen (keuzelijst)
Icon=document-save-all
Exec=bash -c 'target="%f" ; snapshots_path="$(backintime --quiet snapshots-path)" ; ssid=$(kdialog --radiolist "Select Snapshot" $(for ssid in $(backintime --quiet snapshots-list | tail -5 | sort -r); do test -e "${snapshots_path}/$ssid/backup/$target" && echo "$ssid" "${ssid:0:4}-${ssid:4:2}-${ssid:6:2}_${ssid:9:2}:${ssid:11:2}:${ssid:13:2}" "off"; done)); test -n "$ssid" && backintime restore "$target" "" "$ssid" || kdialog --error "Oooops .. seems there is no backup for this in this snapshot or this is a bug to report"'
[Desktop Action S_SyncThis]
Name=Backup within last Snapshot
Name[nl]=Toevoegen aan nieuwste reservekopie
Icon=document-save-as-template
Exec=bash -c 'source="%f" ; test -f "$source" && target="$source" || target="${source%/*}" ; rsync --recursive --times --devices --specials --links --hard-links "$source" "$(backintime --quiet last-snapshot-path)/backup/$target" && notify-send --app-name="Back In Time Helper" --icon=document-save --expire-time=10000 "Backed up:" "$source" || kdialog --error "Oooops .. seems snapshot path or medium is not available"'