Skip to content

Add disable_systray option to settings.xml #821

Description

@sporteka2

Problem

The --disable_systray flag is only available as a command-line argument. There is no way to persist this setting in the config file (~/.shutter/settings.xml), so users must either:

  • Pass --disable_systray every time Shutter is launched
  • Manually edit .desktop files in /usr/share/applications/ (requires root, and gets overwritten on package updates)

Suggested solution

Add a disable_systray key to ~/.shutter/settings.xml under the <general> element, similar to other boolean settings like save_auto, cursor, etc.

Config format

<opt>
  <general ... disable_systray="1" />
</opt>

Code changes

The change spans three areas in /usr/bin/shutter:

1. Load setting on startup (before tray creation, ~line 646)

Currently the tray creation block checks only the CLI flag:

unless ($sc->get_disable_systray) {
    $tray = Gtk3::StatusIcon->new();
    ...
}

Should also check the loaded config value:

# After settings_xml is loaded, before tray creation:
if (defined $settings_xml->{'general'}->{'disable_systray'}
    && $settings_xml->{'general'}->{'disable_systray'} eq '1') {
    $sc->set_disable_systray(TRUE);
}

unless ($sc->get_disable_systray) {
    $tray = Gtk3::StatusIcon->new();
    ...
}

2. Save setting (in fct_save_settings, ~line 4490)

Add alongside other boolean settings:

$settings{'general'}->{'disable_systray'} = $self->{_disable_systray_cparam} ? 1 : 0;

Or, if a UI checkbox is added:

$settings{'general'}->{'disable_systray'} = $disable_systray_active->get_active();

3. (Optional) Add UI checkbox in Settings dialog

Add a checkbox in the Basic or Advanced settings tab:

my $disable_systray_active = Gtk3::CheckButton->new($d->get("Disable systray icon"));
# Load state:
if (defined $settings_xml->{'general'}->{'disable_systray'}) {
    $disable_systray_active->set_active(
        $settings_xml->{'general'}->{'disable_systray'}
    );
}

Additional context

On modern GNOME/Cinnamon desktops, the system tray icon is often not embedded properly (GtkStatusIcon is deprecated, AppIndicator fallback has limited functionality). Many users prefer to disable it entirely. Making this a persistent config option avoids the need to modify system files or create wrapper scripts.

Workaround (current): Edit /usr/share/applications/shutter.desktop and add --disable_systray to every Exec= line. This gets overwritten on package updates.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions