Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ release/*.run
.bzr
.git
*~
.pc
.idea
build
builddir
rust
po-lp/
parts/
stage/
Expand All @@ -30,3 +35,4 @@ debian/timeshift.debhelper.log
debian/timeshift.substvars

debian/.debhelper/
.vscode/
6 changes: 6 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
timeshift (25.07.8) xia; urgency=medium

* Added supported for multiple configuration files

-- Jiang Meng(Jay) <jiangmang.1992@163.com> Tue, 03 Jun 2025 23:15:15 +0000

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't modify the changelog, this is done at release time.

timeshift (25.07.7) zara; urgency=medium

* l10n: Update translations
Expand Down
14 changes: 14 additions & 0 deletions docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ sudo apt install meson \
help2man \
gettext \
valac \
libvala-dev \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This shouldn't be necessary to build.

libvte-2.91-dev \
libgee-0.8-dev \
libjson-glib-dev \
Expand Down Expand Up @@ -50,6 +51,19 @@ meson compile -C build

### Step 4. Install Timeshift

Install
```bash
sudo meson install -C build
```
Uninstall
```
cd build
sudo ninja uninstall
```

### Step 5. Build the debian package
#### Package
```bash
sudo apt install debhelper-compat=10
dpkg-buildpackage -us -uc
```
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ endif
install_data(
sources: 'debian/com.linuxmint.timeshift.metainfo.xml',
install_dir: join_paths(get_option('datadir'), 'metainfo')
)
)
5 changes: 5 additions & 0 deletions src/AppConsole.vala
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,10 @@ public class AppConsole : GLib.Object {
App.validate_cmd_tags();
break;

case "--config":
App.cmd_config = args[++k];
break;

case "--debug":
LOG_COMMANDS = true;
LOG_DEBUG = true;
Expand Down Expand Up @@ -368,6 +372,7 @@ public class AppConsole : GLib.Object {
msg += _("Backup") + ":\n";
msg += " --check " + _("Create snapshot if scheduled") + "\n";
msg += " --create " + _("Create snapshot (even if not scheduled)") + "\n";
msg += " --config " + _("Specify the config json") + "\n";
msg += " --comments <string> " + _("Set snapshot description") + "\n";
msg += " --tags {O,B,H,D,W,M} " + _("Add tags to snapshot (default: O)") + "\n";;
msg += "\n";
Expand Down
3 changes: 3 additions & 0 deletions src/AppGtk.vala
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ public class AppGtk : GLib.Object {
case "--debug":
LOG_DEBUG = true;
break;
case "--config":
App.cmd_config = args[++k];
break;
default:
//unknown option - show help and exit
log_error(_("Unknown option") + ": %s".printf(args[k]));
Expand Down
11 changes: 10 additions & 1 deletion src/Core/Main.vala
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ public class Main : GLib.Object{
public string cmd_target_device = "";
public string cmd_backup_device = "";
public string cmd_snapshot = "";
public string cmd_config = "";
public bool cmd_confirm = false;
public bool cmd_verbose = true;
public bool cmd_scripted = false;
Expand Down Expand Up @@ -298,7 +299,7 @@ public class Main : GLib.Object{
string local_exec = args[0];
string local_conf = app_path + "/timeshift.json";
string local_share = app_path + "/share";

log_msg("cmd_config" + ": " + cmd_config);
var f_local_exec = File.new_for_path(local_exec);
if (f_local_exec.query_exists()){

Expand All @@ -316,6 +317,10 @@ public class Main : GLib.Object{
//timeshift is running from system directory - update app_path
this.app_path = get_cmd_path("timeshift");
}
var f_config_path = File.new_for_path(cmd_config);
if (f_config_path.query_exists()){
this.app_conf_path = cmd_config;
}

// initialize lists -----------------

Expand Down Expand Up @@ -573,6 +578,9 @@ public class Main : GLib.Object{
case "--list-devices":
app_mode = "list-devices";
break;
case "--config":
cmd_config = args[++k];
break;
}
}
}
Expand Down Expand Up @@ -684,6 +692,7 @@ public class Main : GLib.Object{
if (entry.mount_point.has_prefix("/srv")){ continue; }
if (entry.mount_point.has_prefix("/sys")){ continue; }
if (entry.mount_point.has_prefix("/system")){ continue; }
if (entry.mount_point.has_prefix("/work")){ continue; }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't a standard folder, remove please

if (entry.mount_point.has_prefix("/tmp")){ continue; }
if (entry.mount_point.has_prefix("/usr")){ continue; }
if (entry.mount_point.has_prefix("/var")){ continue; }
Expand Down
8 changes: 6 additions & 2 deletions src/timeshift-launcher
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,15 @@ else
# script is running in non-interactive mode
if [ "$XDG_SESSION_TYPE" = "wayland" ] ; then
xhost +SI:localuser:root
pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY ${app_command}
export DISPLAY=$DISPLAY
export XAUTHORITY=$XAUTHORITY
pkexec ${app_command}
xhost -SI:localuser:root
xhost
elif command -v pkexec >/dev/null 2>&1; then
pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY ${app_command}
export DISPLAY=$DISPLAY
export XAUTHORITY=$XAUTHORITY
pkexec ${app_command}
elif command -v sudo >/dev/null 2>&1; then
x-terminal-emulator -e "sudo ${app_command}"
elif command -v su >/dev/null 2>&1; then
Expand Down