Skip to content

issue-2209: Add support for the Flatpak package manager.#2222

Merged
bim9262 merged 2 commits intogreshake:masterfrom
zheltikov:issue-2209-flatpak
Jan 7, 2026
Merged

issue-2209: Add support for the Flatpak package manager.#2222
bim9262 merged 2 commits intogreshake:masterfrom
zheltikov:issue-2209-flatpak

Conversation

@zheltikov
Copy link
Contributor

@zheltikov zheltikov commented Dec 30, 2025

  • packages: Add Flatpak package manager backend.

Resolves #2209 .
Depends on #2221 being merged first.

@MaxVerevkin @bim9262 @ammgws

@bim9262
Copy link
Collaborator

bim9262 commented Jan 5, 2026

@zheltikov can you rebase your change?

@zheltikov
Copy link
Contributor Author

Rebased, @bim9262

}

async fn get_updates_list(&self) -> Result<Vec<String>> {
Command::new("flatpak")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this necessary? I thought that flatpak remote-ls alone would list the updates?
Under what circumstance do you need to run the flatpak update --appstream -y first?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As per the manual:
remote-ls lists the whole contents of a remote repository.
update --appstream updates the info for that all remotes.

So we need to update the local info before listing updates.

Copy link
Collaborator

Choose a reason for hiding this comment

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

This helped clarify the matter further: flatpak/flatpak#5974 (comment)


let stdout = Command::new("flatpak")
.env("LC_ALL", "C")
.args(["remote-ls", "--updates", "--no-header", "--columns=ref"])
Copy link
Collaborator

Choose a reason for hiding this comment

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

When I run this I get the following error:

> LC_ALL=C flatpak remote-ls --updates --no-header --columns=ref
error: Unknown option --no-header

> flatpak --version
Flatpak 1.16.2

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My bad, i guess we can replace it with a .skip(1)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Upon further investigation, it turns out that flatpak does not print headers for non-tty outputs. So we can just omit stripping the header line entirely.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

//! [[block.click]]
//! # shows dmenu with cached available updates. Any dmenu alternative should also work.
//! button = "left"
//! cmd = "flatpak remote-ls --updates --no-header --columns=ref | tail -n +2 | rofi -dmenu"
Copy link
Collaborator

Choose a reason for hiding this comment

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

With the --no-header (if it worked) you wouldn't need the tail. Without --no-header, you only need to skip the first line, not the first 2.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, we can remove the tail invocation entirely.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

@bim9262
Copy link
Collaborator

bim9262 commented Jan 7, 2026

This looks good now! I'm able to see the correct count of packages available for update 😄

@bim9262 bim9262 merged commit 4755643 into greshake:master Jan 7, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Support for Flatpak in packages Block

2 participants