msetzerii created an issue (geany/geany#4607)
Question on script to solve some issues I've had with Fedora 44 and geany.
If in a terminal windows after doing su or su -
trying to open a file using in geany would result in a blank file
opening. Sometime an error message, and sometimes the regular
users files in .config would change to be owned by root?
Some things just said to use nano to edit files as root??
Worked with goog.com AI and came up with this script ge that
seems to handle the issue as far as I can tell. Am I missing
anything?
Do note that if I use regular user to open files that are only r
access for regular user can not change them, but usually just
looking. But can see files, and use saveas if need to.
Otherwise the change to Fedora 43 to 44 has gone smoothly.
Thanks. Did just run into another issue the other day. Peazip GTK2
stopped working if run as root, but the Qt6 version worked fine.
google said geay uses GTK2, so might be related.
#!/bin/bash
# 1. If no file arguments are passed, just open Geany blank
if [ $# -eq 0 ]; then
exec geany
fi
# 2. If run as root, open all passed arguments directly
if [ "$USER" = "root" ] || [ "$EUID" -eq 0 ]; then
exec geany "$@"
fi
# 3. If regular user, resolve absolute paths cleanly
PROCESSED_ARGS=()
for ARG in "$@"; do
ABS_PATH=$(realpath -m "$ARG")
PROCESSED_ARGS+=("$ABS_PATH")
done
# 4. Launch Geany with the entire list of formatted files
exec geany "${PROCESSED_ARGS[@]}"
--
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/issues/4607
You are receiving this because you are subscribed to this thread.
Message ID: <geany/geany/issues/[email protected]>