linux_cac icon indicating copy to clipboard operation
linux_cac copied to clipboard

Setup doesn't autodetect Chrome or Firefox when installed via Flathub/Flatpak

Open jGDarkness opened this issue 9 months ago • 3 comments

I had just done a fresh install of Debian 12, updated repos and updated/upgraded, and then installed Flatpak/Flathub repos and rebooted. Then installed the flathub versions of Firefox and Chrome, and came straight here to run the script. This is my terminal output, and I am assuming that it doesn't detect them because they are the containerized versions. I will simply switch to the standard installs instead of Flatpak versions, as it's a viable workaround. I was using the standard installs before this without issue with the linux-cac repo. Works really well!

sudo bash -c "$(wget https://raw.githubusercontent.com/jdjaxon/linux_cac/main/cac_setup.sh -O -)"

--2024-04-30 09:51:56-- https://raw.githubusercontent.com/jdjaxon/linux_cac/main/cac_setup.sh Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 2606:50c0:8002::154, 2606:50c0:8001::154, 2606:50c0:8000::154, ... Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|2606:50c0:8002::154|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 16587 (16K) [text/plain] Saving to: ‘STDOUT’

  •               100%[===================>]  16.20K  --.-KB/s    in 0s      
    

2024-04-30 09:51:56 (260 MB/s) - written to stdout [16587/16587]

[sudo] password for jeremy: [INFO] Checking for Firefox and Chrome... [INFO] Firefox not found. [INFO] Chrome not found. [ERROR] No version of Mozilla Firefox OR Google Chrome has been detected. [INFO] Please install either or both to proceed.

jGDarkness avatar Apr 30 '24 13:04 jGDarkness

Must be a discrepancy with how Flatpak lays it down in the system.

If you've never ran either, that might be the reason also. Though, it should have still shown up when getting the path for the program...

On Tue, Apr 30, 2024, 9:55 AM Jeremy G. Davenport @.***> wrote:

I had just done a fresh install of Debian 12, updated repos and updated/upgraded, and then installed Flatpak/Flathub repos and rebooted. Then installed the flathub versions of Firefox and Chrome, and came straight here to run the script. This is my terminal output, and I am assuming that it doesn't detect them because they are the containerized versions. I will simply switch to the standard installs instead of Flatpak versions, as it's a viable workaround. I was using the standard installs before this without issue with the linux-cac repo. Works really well!

sudo bash -c "$(wget https://raw.githubusercontent.com/jdjaxon/linux_cac/main/cac_setup.sh -O -)"

--2024-04-30 09:51:56-- https://raw.githubusercontent.com/jdjaxon/linux_cac/main/cac_setup.sh Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 2606:50c0:8002::154, 2606:50c0:8001::154, 2606:50c0:8000::154, ... Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|2606:50c0:8002::154|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 16587 (16K) [text/plain] Saving to: ‘STDOUT’

             100%[===================>]  16.20K  --.-KB/s    in 0s

2024-04-30 09:51:56 (260 MB/s) - written to stdout [16587/16587]

[sudo] password for jeremy: [INFO] Checking for Firefox and Chrome... [INFO] Firefox not found. [INFO] Chrome not found. [ERROR] No version of Mozilla Firefox OR Google Chrome has been detected. [INFO] Please install either or both to proceed.

— Reply to this email directly, view it on GitHub https://github.com/jdjaxon/linux_cac/issues/27, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGLSFW7RUMSOVJXHDT6N7DDY76PE3AVCNFSM6AAAAABHAKNN2WVHI2DSMVQWIX3LMV43ASLTON2WKOZSGI3TCNJUGY3TKOI . You are receiving this because you are subscribed to this thread.Message ID: @.***>

bengooch7 avatar Apr 30 '24 14:04 bengooch7

I'm going to take a look and see if I can find a quick solution to it, and if I can I'll submit a pull request with the update. The package and script itself are quite slick and super easy to install. Happy to contribute, if I can.

Also, I had run them both a couple of times before I ran cac_setup.sh.

On Tue, Apr 30, 2024, 10:51 AM Ben Gooch @.***> wrote:

Must be a discrepancy with how Flatpak lays it down in the system.

If you've never ran either, that might be the reason also. Though, it should have still shown up when getting the path for the program...

On Tue, Apr 30, 2024, 9:55 AM Jeremy G. Davenport @.***> wrote:

I had just done a fresh install of Debian 12, updated repos and updated/upgraded, and then installed Flatpak/Flathub repos and rebooted. Then installed the flathub versions of Firefox and Chrome, and came straight here to run the script. This is my terminal output, and I am assuming that it doesn't detect them because they are the containerized versions. I will simply switch to the standard installs instead of Flatpak versions, as it's a viable workaround. I was using the standard installs before this without issue with the linux-cac repo. Works really well!

sudo bash -c "$(wget https://raw.githubusercontent.com/jdjaxon/linux_cac/main/cac_setup.sh -O -)"

--2024-04-30 09:51:56-- https://raw.githubusercontent.com/jdjaxon/linux_cac/main/cac_setup.sh Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 2606:50c0:8002::154, 2606:50c0:8001::154, 2606:50c0:8000::154, ... Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|2606:50c0:8002::154|:443...

connected. HTTP request sent, awaiting response... 200 OK Length: 16587 (16K) [text/plain] Saving to: ‘STDOUT’

100%[===================>] 16.20K --.-KB/s in 0s

2024-04-30 09:51:56 (260 MB/s) - written to stdout [16587/16587]

[sudo] password for jeremy: [INFO] Checking for Firefox and Chrome... [INFO] Firefox not found. [INFO] Chrome not found. [ERROR] No version of Mozilla Firefox OR Google Chrome has been detected. [INFO] Please install either or both to proceed.

— Reply to this email directly, view it on GitHub https://github.com/jdjaxon/linux_cac/issues/27, or unsubscribe < https://github.com/notifications/unsubscribe-auth/AGLSFW7RUMSOVJXHDT6N7DDY76PE3AVCNFSM6AAAAABHAKNN2WVHI2DSMVQWIX3LMV43ASLTON2WKOZSGI3TCNJUGY3TKOI>

. You are receiving this because you are subscribed to this thread.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/jdjaxon/linux_cac/issues/27#issuecomment-2085554930, or unsubscribe https://github.com/notifications/unsubscribe-auth/APMPKWACEM3KO2YAMQC3NEDY76VV7AVCNFSM6AAAAABHAKNN2WVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOBVGU2TIOJTGA . You are receiving this because you authored the thread.Message ID: @.***>

jGDarkness avatar Apr 30 '24 15:04 jGDarkness

So, flatpak turns out to be more complex of a solution than I had hoped to add to your already very streamlined script, and it looks like I may just have to install manually for now. I'm new to flatpak, so I'm not currently able to execute the automation to find the cert.db files and install/import in the new flatpak locations, I do have a few snippets in this comment that can be added to the scrip to at least detect flatpak installations of both Firefox and Chrome. Maybe someone else will beat me to an eventual pull request on this, but if not, I'll return to this when I have some more time to work on it.

added two new variables at the top:

fp_chrome=false                     # Flag to prompt for how to handle Flatpak Chrome
fp_firefox=false                    # Flag to prompt for how to handle Flatpak Firefox

added a new elif check to find the flatpak version of Firefox if the snap version wasn't already found (goes before the apt install):

elif flatpak list | grep -q 'com.mozilla.firefox' >/dev/null
        then
            fp_firefox=true
            ff_exists=true
            print_info "Found Firefox (Flatpak Edition)."

added a new elif check to find the flatpak version of Chrome:

elif flatpak list | grep -q 'com.google.Chrome' >/dev/null
    then
        fp_chrome=true
        chrome_exists=true
        print_info "Found Google Chrome (Flatpak Edition)."

The flatpak list command returns ALL results, but the grep -q does a quiet return of the targeted install. Both browsers turn up in the list:

image

jGDarkness avatar Apr 30 '24 19:04 jGDarkness

@jGDarkness, if you have found a solution to this problem, feel free to reopen this issue and submit a pull request.

jdjaxon avatar Nov 26 '24 21:11 jdjaxon