-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflatpak-apps-permissions.sh
More file actions
49 lines (37 loc) · 1.82 KB
/
flatpak-apps-permissions.sh
File metadata and controls
49 lines (37 loc) · 1.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/bash
# ==============================================================================
# FLATPAK PERMISSION REPORTER
# This script lists the current permissions (including overrides) for all
# installed Flatpak applications (user and system).
# ==============================================================================
# Check for flatpak command presence
if ! command -v flatpak &> /dev/null; then
echo "ERROR: 'flatpak' command not found. Please ensure Flatpak is installed."
exit 1
fi
echo "--- FLATPAK PERMISSION REPORT ---"
# ------------------------------------------------------------------------------
# Function to process applications for a given scope (user or system)
# ------------------------------------------------------------------------------
process_scope() {
local scope="$1"
echo -e "\n========================================================"
echo "Processing $scope-installed Applications:"
echo "========================================================"
# Use 'flatpak list' and pipe the output line-by-line using 'while read -r'
flatpak list --app --"$scope" --columns=application | while read -r APP_ID; do
if [ -z "$APP_ID" ]; then
continue
fi
echo -e "\n📦 [Application ID: $APP_ID]"
# Use flatpak info with --show-permissions to get a detailed list.
# This will show permissions explicitly granted and those inherited/overridden.
if ! flatpak info --show-permissions "$APP_ID"; then
echo " (Could not retrieve permissions. Application may be partially installed or misconfigured.)"
fi
echo "--------------------------------------------------------"
done
}
# Run the function for user-installed applications
process_scope "user"
echo -e "\n--- REPORT COMPLETE ---"