Bug#1111482: gnome-tweaks-autostart-cleanup.sh fails when trying to remove a non-existing file

Thomas Loimer thomas.loimer at tuwien.ac.at
Mon Aug 18 14:48:00 BST 2025


Package: gnome-tweaks
Version: 46.1-1
Severity: minor
Tags: patch

Dear Maintainer,

the script gnome-tweaks-autostart-cleanup.sh contains one command,
rm .config/autostart/ignore-lid-switch-tweak.desktop

This command fails, if the file does not exist. Then,
journalctl --user -b -u user-sesion-migration reports
user-session-migration[..]: Exited with an error
user-session-migration[..]: stdout:
user-session-migration[..]: stderr: rm: cannot remove '.config/autostart/igno..'

The simplest is to provide the -f option to the rm-command,
rm -f .config/autostart/ignore-lid-switch-tweak.desktop

Optionally, test for the existence of the file, and probably also use
XDG_CONFIG_HOME,
test "x$XDG_CONFIG_HOME" = x && config_dir="$HOME/.config" || config_dir="$XDG_CONFIG_HOME"
test -x "$config_dir/autostart" -a test -f "$config_dir/autostart/ignore-lid-switch-tweak.desktop" && \
    rm "$config_dir/autostart/ignore-lid-switch-tweak.desktop"
unset config_dir


-- System Information:
Debian Release: 13.0
Architecture: amd64 (x86_64)
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages gnome-tweaks depends on:
.
.
ii  user-session-migration                       0.4.3+nmu1



More information about the pkg-gnome-maintainers mailing list