Ok, let’s back up and take that command apart. Here’s what the AIs had to suggest:
Assistant A
Excellent catch—this one is a little gnarly, but we can straighten it out. The desktop entry Exec line you posted is tripping over several common pitfalls:
The original:
Exec=gnome-terminal -x bash -c “flatpak run --filesystem=host --socket=session-bus --socket=wayland --device=dri --cwd=“pwd” --talk-name=org.freedesktop.Flatpak --command=“/usr/bin/python” org.gnome.Characters /home/pursim/glowup/.glowup.py; exec bash”
Problems inside it:
-
Wrong quotation marks
Those are curly “smart quotes” (“ ”) instead of straight ASCII quotes ("). Desktop files and shells are very picky—they need plain quotes.
-
-x with gnome-terminal is deprecated
Modern gnome-terminal no longer supports -x. The correct way is:
gnome-terminal -- bash -c ...
-
Substitution "pwd"
You wrote --cwd=“pwd”. That’s a literal string, not a shell substitution. The shell won’t expand it if quoted with "pwd". You need command substitution: --cwd="$(pwd)".
-
Layered quoting around bash -c
Since you are already in bash -c "...", you need to carefully manage quotes inside. Each inner --command="/usr/bin/python" must use straight quotes.
-
Unnecessary exec bash at the end
If you append ; exec bash, you’re launching a new bash shell after your Flatpak program finishes. This is only useful if you want the terminal to stay open interactively after execution. If that was intentional, that’s fine—just be aware.
A corrected version:
Exec=gnome-terminal -- bash -c "flatpak run --filesystem=host --socket=session-bus --socket=wayland --device=dri --cwd=\"$(pwd)\" --talk-name=org.freedesktop.Flatpak --command='/usr/bin/python' org.gnome.Characters /home/pursim/glowup/.glowup.py; exec bash"
Key fixes:
- Straight quotes only. Copy-paste smart quotes are the bane of shell commands.
- Use
-- instead of -x with gnome-terminal.
- Use
$(pwd) instead of "pwd".
- Consistent quoting around paths. Notice how
--cwd=\"$(pwd)\" protects spaces properly.
Optional simplification
If you don’t actually need to keep the terminal open afterward, you can drop the trailing ; exec bash:
Exec=gnome-terminal -- bash -c "flatpak run --filesystem=host --socket=session-bus --socket=wayland --device=dri --cwd=\"$(pwd)\" --talk-name=org.freedesktop.Flatpak --command='/usr/bin/python' org.gnome.Characters /home/pursim/glowup/.glowup.py"
So the primary culprit was curly quotes, with a side dish of (-x being obsolete) and incorrect pwd usage. After fixing those, your launcher should behave properly.
Assistant B
Looking at this command, there are several issues that need to be fixed:
Problems Identified:
-
Incorrect quoting around pwd: The pwd command is inside double quotes, which means it won’t be executed as a command but treated as the literal string “pwd”.
-
Mismatched application: You’re using org.gnome.Characters (a character map application) but trying to run a Python script, which doesn’t make sense.
-
Path mismatch: You’re specifying --command="/usr/bin/python" but then trying to run a script at /home/pursim/glowup/.glowup.py which would be outside the flatpak container.
Fixed Version:
Here’s the corrected command:
Exec=gnome-terminal -x bash -c "flatpak run --filesystem=host --socket=session-bus --socket=wayland --device=dri --cwd=$(pwd) --talk-name=org.freedesktop.Flatpak --command=/usr/bin/python org.freedesktop.Sdk//23.08 /home/pursim/glowup/.glowup.py; exec bash"
Or, if you have a specific Python flatpak application:
Exec=gnome-terminal -x bash -c "flatpak run --filesystem=home --socket=session-bus --socket=wayland --device=dri org.freedesktop.Sdk//23.08 python3 /home/pursim/glowup/.glowup.py; exec bash"
Key Changes:
- Fixed
pwd: Changed from "pwd" to $(pwd) to actually execute the command
- Changed application: Replaced
org.gnome.Characters with a proper Python runtime like org.freedesktop.Sdk
- Simplified permissions:
--filesystem=host might be overkill; --filesystem=home is probably sufficient
Alternative Approach:
If you don’t actually need flatpak for this Python script, a simpler approach would be:
Exec=gnome-terminal -x bash -c "cd /home/pursim/glowup && python3 .glowup.py; exec bash"
This would run the Python script directly without the flatpak overhead.
Shared insight seems to be use $(pwd) instead of "pwd" among others. The latter alternatively also suggests skipping the flatpak.
And for testing at least I agree that leaving the hiding (.) from filename for now might be a good idea.