Score:0

Password protection on flatpak apps

jp flag

I found a bash script to password protect one of my flatpak apps but it doesn't seem to work, please tell me where I got it wrong script->

#!/bin/bash
read -s -p "Enter password: " PASSWORD
flatpak run com.example.app --password="$PASSWORD"

now since I wanted this script to run every time I open the app, I found out that I need to do changes in the .desktop file of that app, so I changed the Exec line in that file accordingly

Exec=/home/user/scripts/password-script.sh flatpak run com.example.app

I tried running this, but it didn't work, is there anything that I am missing? My OS is Ubuntu 22.04 and the app is saved in the .local/share/flatpak/app directory since I made a user installation. Any help would be appreciated.

Terrance avatar
id flag
Since your script is a bash script have you told the desktop file `Terminal=True`?
Krrish Dhaneja avatar
jp flag
I dont think so i have, lemme try
Krrish Dhaneja avatar
jp flag
@Terrance i tried it but it didnt work either
Terrance avatar
id flag
Sorry, I just noticed that you are running the flatpak twice. Once in the script and once outside the script. You probably need to remove the call outside of the script.
Krrish Dhaneja avatar
jp flag
Ill try that too wait
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.