Skip to content

[Feature Request] Add list of pending Flatpak updates #43

Closed as not planned

Description

@pfr-dev

Before I found this extension, I'd set up my own systemd service to periodically check for updates by calling the following script:

#!/usr/bin/env bash

# Setup environment so notify-send can talk to your desktop session
export DISPLAY=:0
export DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/$(id -u)/bus"

# --- Get DNF updates count ---
dnf_count=$(
  dnf upgrade -q --refresh --assumeno \
    | awk '
        /^Upgrading:/ {in_upgrading=1; next}
        /^Transaction Summary:/ {in_upgrading=0}
        in_upgrading && /^ [^ ]/ {c++}
        END {print c+0}
     '
)

# --- Get Flatpak updates count ---
# Refresh metadata quietly
flatpak update --appstream > /dev/null 2>&1

# Count actual planned updates (apps + runtimes + extensions)
flatpak_count=$(
  flatpak update --appstream --assumeno \
    | grep -E '^\s*[0-9]+\.\s+\[.\]' \
    | wc -l
)

# --- Build the notification message ---
message=""

if (( dnf_count > 0 )); then
    message+="• $dnf_count DNF updates available"$'\n'
fi

if (( flatpak_count > 0 )); then
    message+="• $flatpak_count Flatpak updates available"$'\n'
fi

# --- Send notification if needed ---
if [[ -n "$message" ]]; then
    notify-send "Software Updates Available" "$message"
fi

This still works great, but your extension is a little neater. I wonder if you could also incorporate the Flatpak updates into this extension?
I'd recommend a separate icon/list for these updates.

What do you think?

So far, I've been able to edit the commands to include flatpak, however it's skews the number of total updates slightly. But I have kept the install command to also include updates, just in case there are any.

Activity

  1. purejava commented on Jan 31, 2026

    @purejava
    Owner

    Duplicate of #9 and #35

  2. pfr-dev commented on Feb 8, 2026

    @pfr-dev
    Author

    ok, fair enough. I've just altered the install command to call this script instead: (slight edits to the script in my first comment).

    /usr/local/bin/fupgrade :

    #!/usr/bin/env bash
    #
    # Run this script from Fedora Linux Update Indicator with this command:
    # ptyxis -- /bin/sh -c "/path/to/script; echo Done - Press enter to exit; read _"
    
    # --- Root check ---
    if [[ $EUID -eq 0 ]]; then
        # Running as root via pkexec: only run DNF upgrade
        echo "Running DNF upgrade..."
        dnf upgrade -y
        exit 0
    fi
    
    # --- Normal user section ---
    
    # Setup environment for notifications
    export DISPLAY=:0
    export DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/$(id -u)/bus"
    
    # --- Check DNF updates ---
    dnf_count=$(
        dnf check-update -yq 2>/dev/null \
            | grep -E 'x86_64|i686|noarch|aarch64' \
            | wc -l
    )
    
    # --- Check Flatpak updates ---
    flatpak update --appstream > /dev/null 2>&1
    flatpak_count=$(
        flatpak remote-ls --updates --columns=application 2>/dev/null \
            | grep -v '(pinned)' \
            | wc -l
    )
    
    # --- Track upgrades performed ---
    upgraded=0
    message=""
    
    # --- Upgrade DNF if needed ---
    if (( dnf_count > 0 )); then
        echo "DNF updates available ($dnf_count). Running upgrade via pkexec..."
        pkexec "$0"  # Rerun this script as root, triggers root block above
        upgraded=1
    fi
    
    # --- Upgrade Flatpak if needed ---
    if (( flatpak_count > 0 )); then
        echo "Flatpak updates available ($flatpak_count). Running upgrade..."
        flatpak update -y --noninteractive 2>/dev/null | sed '/end-of-life/,+2d'
        upgraded=1
    fi
    
    # --- Build notification message ---
    (( dnf_count > 0 )) && message+="• $dnf_count DNF updates installed"$'\n'
    (( flatpak_count > 0 )) && message+="• $flatpak_count Flatpak updates installed"$'\n'
    
    # --- Send notification if anything upgraded ---
    if (( upgraded )); then
        notify-send "Software Updates Completed" "$message"
    else
        echo "System is already up to date."
    fi
    

    So now the install command doesn't need to call pkexec as it's called from within the script. So the new install command is ptyxis -- /bin/sh -c "/usr/local/bin/fupgrade; echo Done - Press enter to exit; read _"

    works for me 👍

  3. pinned this issue on Feb 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions