Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Any operation requiring xdg-open wont work #307

Closed
yereter opened this issue Nov 21, 2024 · 1 comment · Fixed by #309
Closed

[BUG] Any operation requiring xdg-open wont work #307

yereter opened this issue Nov 21, 2024 · 1 comment · Fixed by #309
Assignees
Labels
bug Something isn't working pre-release Not from the master branch

Comments

@yereter
Copy link

yereter commented Nov 21, 2024

Describe the bug
Any operation like editing the URLs.txt won't work if the downloader isn't running on a desktop session, following the changes from #297 . As it is stated also in the man page of xdg-open, "xdg-open is for use inside a desktop session only." in the case that the tool runs in a headless environment with no desktop session, xdg-open, xdg-mime etc. probably wont even exist (like it didn't in my system) so first, after the change xdg-utils is a requirement for linux systems. But even after installing xdg-utils it won't work because xdg-mime query fallbacks to "file" command where it is possible that is also not installed. After file command and xdg-utils is installed then it is possible to use xdg-mime to query stuff but even then, xdg-open won't work without more tinkering. Tbh at that point finding the related file by myself and editing it makes more sense.

To Help Reproduce
Easiest way to reproduce and the way I am producing this would be SSH'ing into a linux computer and trying to edit urls file.

Screenshots
An error message saying "No default text editor found" will be printed until "xdg-utils" and "file" is installed

Setup Information

  • OS: Linux, Debian 12
  • Cyberdrop Downloader Version: Installed from the source master branch
@yereter yereter added the bug Something isn't working label Nov 21, 2024
@NTFSvolume NTFSvolume assigned NTFSvolume and unassigned jbsparrow Nov 21, 2024
@NTFSvolume NTFSvolume added the pre-release Not from the master branch label Nov 21, 2024
@yereter
Copy link
Author

yereter commented Nov 21, 2024

As a suggestion I could say,

subprocess.call([os.getenv("EDITOR"), file_path]) would get the editor set in environment variables to open the file, it works for "vim". I think it would be wiser to use this in linux since the app already runs in terminal, opening the editor set for terminal makes more sense rather then a GUI editor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pre-release Not from the master branch
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants