Skip to content

Instantly share code, notes, and snippets.

@1player
Created June 14, 2022 09:14
Show Gist options
  • Save 1player/ca926a7e7c6a4d4e1b7de5e41f32c949 to your computer and use it in GitHub Desktop.
Save 1player/ca926a7e7c6a4d4e1b7de5e41f32c949 to your computer and use it in GitHub Desktop.
Show all unused ~/.var/app directories from uninstalled Flatpaks, and their size
#!/bin/bash
set -euo pipefail
base_dir=$(realpath $HOME/.var/app --relative-to=$(pwd))
comm -13 <(flatpak list --columns=application | sort) <(ls -1 $HOME/.var/app/ | sort) \
| sed "s#^#$base_dir/#" | tr '\n' '\0' | du -sch --files0-from=-
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment