Skip to content

Commit 133f137

Browse files
authored
Release 3.4 (stable) (#313)
2 parents cda3eab + 97795e6 commit 133f137

21 files changed

+1231
-1203
lines changed

flatpak/io.github.vikdevelop.SaveDesktop.desktop

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ Comment[ca]=Desa la configuració actual del vostre entorn d'escriptori
2121
Comment[hi]=अपना डेस्कटॉप विन्यास सहेजें
2222
Comment[pt]=Grave a sua configuração da área de trabalho
2323
Comment[fi]=Tallenna työpöytäsi määritys
24-
Exec=run.sh
24+
Exec=savedesktop
2525
Type=Application
2626
Icon=io.github.vikdevelop.SaveDesktop

flatpak/io.github.vikdevelop.SaveDesktop.gschema.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<schemalist>
33
<schema id="io.github.vikdevelop.SaveDesktop" path="/io/github/vikdevelop/SaveDesktop/">
44
<key name="window-size" type="(ii)">
5-
<default>(750,540)</default>
5+
<default>(555, 584)</default>
66
<summary>Window size</summary>
77
</key>
88
<key name="maximized" type="b">
@@ -67,10 +67,6 @@
6767
<default>''</default>
6868
<summary>File for synchronization with other computers in the network</summary>
6969
</key>
70-
<key name="url-for-syncing" type="s">
71-
<default>''</default>
72-
<summary>URL of local directory to be get file for importing configuration</summary>
73-
</key>
7470
<key name="periodic-import" type="s">
7571
<choices>
7672
<choice value="Never2"/>
@@ -86,6 +82,10 @@
8682
<default>false</default>
8783
<summary>Manually sync</summary>
8884
</key>
85+
<key name="bidirectional-sync" type="b">
86+
<default>true</default>
87+
<summary>Enable/Disable bidirectional synchronization</summary>
88+
</key>
8989
<key name="disabled-flatpak-apps-data" type="as">
9090
<default>[]</default>
9191
<summary>Select, what Flatpak applications data will be saved</summary>

io.github.vikdevelop.SaveDesktop.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ app-id: io.github.vikdevelop.SaveDesktop
22
runtime: org.gnome.Platform
33
runtime-version: '46'
44
sdk: org.gnome.Sdk
5-
command: run.sh
5+
command: savedesktop
66
finish-args:
77
- --share=ipc
88
- --share=network
@@ -59,7 +59,7 @@ modules:
5959
- name: savedesktop
6060
buildsystem: simple
6161
build-commands:
62-
- install -Dm755 -t /app/bin run.sh
62+
- install -Dm755 -t /app/bin savedesktop
6363
- cp -R src/* /app
6464
- install -D -t /app/share build-beta.sh
6565
- install -D -t /app/share/applications flatpak/io.github.vikdevelop.SaveDesktop.desktop

native/install_native.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
if [ "$1" = "--install" ]
33
then
44
sed -i "s\Exec=run.sh\Exec=/home/${USER}/.local/bin/savedesktop\ " flatpak/io.github.vikdevelop.SaveDesktop.desktop
5-
install -Dm755 native/run_natively.sh ~/.local/bin/savedesktop
5+
install -Dm755 savedesktop ~/.local/bin/
66
install -D -t ~/.local/share/applications flatpak/io.github.vikdevelop.SaveDesktop.desktop
77
install -D -t ~/.local/share/metainfo flatpak/io.github.vikdevelop.SaveDesktop.metainfo.xml
88
install -D -t ~/.local/share/glib-2.0/schemas flatpak/io.github.vikdevelop.SaveDesktop.gschema.xml
@@ -18,9 +18,9 @@ then
1818
install -D -t ~/.local/share/icons/hicolor/scalable/apps flatpak/icons/io.github.vikdevelop.SaveDesktop.svg
1919
install -D -t ~/.local/share/icons/hicolor/symbolic/apps flatpak/icons/io.github.vikdevelop.SaveDesktop-symbolic.svg
2020
install -D -t ~/.local/share/icons/hicolor/symbolic/apps flatpak/symbolic-icons/desktop-symbolic.svg
21-
install -D -t ~/.local/share/icons/hicolor/symbolic/apps flatpak/symbolic-icons/edit-symbolic.svg
2221
install -D -t ~/.local/share/icons/hicolor/symbolic/apps flatpak/symbolic-icons/list-view.png
2322
install -D -t ~/.local/share/icons/hicolor/symbolic/apps flatpak/symbolic-icons/done.svg
23+
install -D -t ~/.local/share/icons/hicolor/symbolic/apps flatpak/preferences-system-symbolic.svg
2424
# Create cache and data dirs
2525
mkdir ~/.cache/io.github.vikdevelop.SaveDesktop
2626
mkdir ~/.local/share/io.github.vikdevelop.SaveDesktop
@@ -41,6 +41,8 @@ if [ "$1" = "--remove" ]
4141
rm ~/.local/share/icons/hicolor/symbolic/apps/desktop-symbolic.svg
4242
rm ~/.local/share/icons/hicolor/symbolic/apps/edit-symbolic.svg
4343
rm ~/.local/share/icons/hicolor/symbolic/apps/list-view.png
44+
rm ~/.local/share/icons/hicolor/symbolic/apps/done.svg
45+
rm ~/.local/share/icons/hicolor/symbolic/apps/preferences-system-symbolic.svg
4446
rm -rf /tmp/SaveDesktop
4547
echo "SaveDesktop has been removed."
4648
fi

native/run_natively.sh

Lines changed: 0 additions & 26 deletions
This file was deleted.

run.sh

Lines changed: 0 additions & 46 deletions
This file was deleted.

savedesktop

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
#!/usr/bin/python3
2+
import os, sys, shutil, zipfile, tarfile, argparse
3+
from pathlib import Path
4+
5+
flatpak = os.path.exists("/.flatpak-info")
6+
snap = os.environ.get('SNAP_NAME', '') == 'savedesktop'
7+
8+
# Cache directory
9+
cache_path = f"{Path.home()}/.var/app/io.github.vikdevelop/SaveDesktop/cache/tmp" if flatpak else f"{os.getenv('SNAP_USER_COMMON')}/.cache/tmp" if snap else f"{Path.home()}/.cache/io.github.vikdevelop.SaveDesktop"
10+
11+
# Init dir for loading the Python scripts
12+
init_dir = "/app" if flatpak else f"{os.getenv('SNAP')}/usr" if snap else f"{Path.home()}/.local/share/savedesktop/src"
13+
sys.path.append(init_dir)
14+
15+
# Command-line arguments
16+
parser = argparse.ArgumentParser()
17+
parser.add_argument("--background", action="store_true", help="Start periodic saving")
18+
parser.add_argument("--sync", action="store_true", help="Sync desktop configuration")
19+
parser.add_argument("--save-now", action="store_true", help="Save configuration using UI parameters")
20+
parser.add_argument("--import-config", help="Import configuration from a file", type=str)
21+
args = parser.parse_args()
22+
23+
# Run Python scripts from the listed command-line arguments
24+
if args.background:
25+
from periodic_saving import PeriodicBackups
26+
pb = PeriodicBackups()
27+
pb.run(None)
28+
exit()
29+
elif args.sync:
30+
from network_sharing import Syncing
31+
exit()
32+
elif args.save_now:
33+
from periodic_saving import PeriodicBackups
34+
pb = PeriodicBackups()
35+
pb.run(now=True)
36+
if args.import_config:
37+
file_path = args.import_config
38+
if not os.path.exists(file_path):
39+
print(f"File not found: {file_path}")
40+
exit(1)
41+
42+
shutil.rmtree(os.path.join(cache_path, "import_config"), ignore_errors=True)
43+
os.makedirs(os.path.join(cache_path, "import_config"), exist_ok=True)
44+
os.chdir(os.path.join(cache_path, "import_config"))
45+
46+
if file_path.endswith('.sd.zip'):
47+
os.system(f"unzip {file_path}")
48+
elif file_path.endswith('.sd.tar.gz'):
49+
os.system(f"tar -xf {file_path}")
50+
else:
51+
print("Unsupported file type. Use *.sd.tar.gz or *.sd.zip.")
52+
exit(1)
53+
54+
os.system(f"python3 {init_dir}/config.py --import_")
55+
exit()
56+
else:
57+
import main_window

src/README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@
22
In this directory is located the most important part of the app, which is its source code.
33
Because there are a lot of files, this README helps you with navigate in this directory:
44

5-
- `backup_flatpaks.sh` - saving Flatpak applications to a list in the configuration archive
65
- `config.py` - saving and importing user configuration from and in the configuration archive
6+
- `flatpak_apps_dialog.py` - the dialog for setting, what user data of the Flatpak apps will be included in the configuration archive
77
- `install_flatpak_from_script.py` - installing Flatpak apps from the list to the system and copying user data from the configuration archive to the ~/.var/app directory
88
- `localization.py` - Based on the detected system language, the application sets the interface language (if the system language is not in the list of available languages, English is set), also sets the cache and application data folders and also the application version and release notes
99
- `main_window.py` - the GUI of the app
10-
- `network_sharing.py` - synchronization between computers in the network within Python HTTP server
10+
- `network_sharing.py` - synchronization between computers in the network within Python HTTP server or cloud drive folder
1111
- `open_wiki.py` - opening the Github wiki of this app in the system language (if it is not available in the list of available languages, English opens)
1212
- `periodic_saving.py` - saving configuration periodically
13-
- `server.py` - starting Python HTTP server for synchronization between computers in the network
1413
- `shortcuts_window.py` - showing available Keyboard shortcuts in the window
1514
- `tty_environments.py` - detecting desktop environemnt in the TTY mode

src/backup_flatpaks.sh

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)