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

Libreoffice configured as default editor for text/plain #8385

Closed
marmarek opened this issue Aug 1, 2023 · 11 comments · Fixed by QubesOS/qubes-core-agent-linux#448
Closed
Labels
affects-4.1 This issue affects Qubes OS 4.1. affects-4.2 This issue affects Qubes OS 4.2. C: core C: templates diagnosed Technical diagnosis has been performed (see issue comments). P: default Priority: default. Default priority for new issues, to be replaced given sufficient information. pr submitted A pull request has been submitted for this issue. r4.2-vm-bookworm-stable r4.2-vm-bullseye-stable r4.2-vm-centos-stream8-stable r4.2-vm-fc37-stable r4.2-vm-fc38-stable
Milestone

Comments

@marmarek
Copy link
Member

marmarek commented Aug 1, 2023

How to file a helpful issue

Qubes OS release

R4.2, possibly R4.1 too

Brief summary

Plain text files are opened in LibreOffice Writer, which is an overkill for the simple file format. Simpler editors are installed (depending on the template and its flavor - gnome-text-editor, gedit, mousepad), but they are not set as default for text/plain.

Steps to reproduce

xdg-mime query default text/plain
Or simply open a .txt file from a file manager (or using xdg-open).

Expected behavior

File opens in a simple text editor, default one for given distribution.
In gnome template flavor (the default one): gnome-text-editor or gedit
In xfce template flavor: mousepad

Actual behavior

File opens in LibreOffice Writer.

Additional context

This issue needs some explanation regarding https://www.qubes-os.org/faq/#what-is-qubes-attitude-toward-changing-guest-distros.

For Debian template, the consensus based on IRC discussion is that Debian does not define default applications for file types at all, and it is a long standing upstream issue. Even properly tracking it upstream is problematic, as the file configuring which applications open what (/usr/share/applications/mimeapps.list) doesn't exist, so the (hypothetical) issue cannot be assigned to any package (admittedly, this is rather lame excuse...). The result is that default application is chosen more or less at random (in practice depends on lexicographic sorting applications...) from the installed applications.

For Fedora template, the intended default is configured (mimeapps.list does exist and points at org.gnome.gedit.desktop), but for some reason, it isn't respected by xdg-mime in qubes template.

This is similar issue to #4195 or #3148

@marmarek marmarek added T: bug C: templates P: default Priority: default. Default priority for new issues, to be replaced given sufficient information. labels Aug 1, 2023
@marmarek marmarek added this to the Release 4.1 updates milestone Aug 1, 2023
marmarek added a commit to marmarek/qubes-core-agent-linux that referenced this issue Aug 1, 2023
Debian does not define default application, so the choice is a bit
random (in practice - lexicographical). For text/plain, it hits
LibreOffice, which is very unfriendly for text/plain. Choose something
that is not libreoffice instead.
Fedora does define gedit as default editor, but xdg-open doesn't handle
mimeapps.list, it only looks for defaults.list file. Add a symlink to
fix this.

Fixes QubesOS/qubes-issues#8385
marmarek added a commit to marmarek/qubes-core-agent-linux that referenced this issue Aug 1, 2023
Debian does not define default application, so the choice is a bit
random (in practice - lexicographical). For text/plain, it hits
LibreOffice, which is very unfriendly for text/plain. Choose something
that is not libreoffice instead.
Fedora does define gedit as default editor, but xdg-open doesn't handle
mimeapps.list, it only looks for defaults.list file. Add a symlink to
fix this.

Re-calculate the choice on package update too, if the currently selected
editor doesn't exist anymore (happens for example when org.gnome.gedit is replaced
with org.gnome.TextEditor).

Fixes QubesOS/qubes-issues#8385
@h01ger
Copy link

h01ger commented Aug 1, 2023

someone else than me on irc:

foo.txt opens in gedit in my debian 11 at least
this happens if you haven't set XDG_CURRENT_DESKTOP=gnome

$ xdg-mime query default text/plain; (unset XDG_CURRENT_DESKTOP; xdg-mime query default text/plain)
org.gnome.gedit.desktop
libreoffice-writer.desktop

@andrewdavidwong andrewdavidwong added C: core diagnosed Technical diagnosis has been performed (see issue comments). pr submitted A pull request has been submitted for this issue. labels Aug 2, 2023
@qubesos-bot
Copy link

Automated announcement from builder-github

The package core-agent-linux has been pushed to the r4.2 testing repository for the Debian template.
To test this update, first enable the testing repository in /etc/apt/sources.list.d/qubes-*.list by uncommenting the line containing bullseye-testing (or appropriate equivalent for your template version), then use the standard update command:

sudo apt-get update && sudo apt-get dist-upgrade

Changes included in this update

@qubesos-bot
Copy link

Automated announcement from builder-github

The component core-agent-linux (including package core-agent-linux) has been pushed to the r4.2 testing repository for the Fedora template.
To test this update, please install it with the following command:

sudo dnf update --enablerepo=qubes-vm-r4.2-current-testing

Changes included in this update

@qubesos-bot
Copy link

Automated announcement from builder-github

The package core-agent-linux has been pushed to the r4.2 testing repository for the Debian template.
To test this update, first enable the testing repository in /etc/apt/sources.list.d/qubes-*.list by uncommenting the line containing bookworm-testing (or appropriate equivalent for your template version), then use the standard update command:

sudo apt-get update && sudo apt-get dist-upgrade

Changes included in this update

@qubesos-bot
Copy link

Automated announcement from builder-github

The package core-agent-linux has been pushed to the r4.2 testing repository for the CentOS centos-stream8 template.
To test this update, please install it with the following command:

sudo yum update --enablerepo=qubes-vm-r4.2-current-testing

Changes included in this update

@qubesos-bot
Copy link

Automated announcement from builder-github

The component core-agent-linux (including package core-agent-linux) has been pushed to the r4.2 testing repository for the Fedora template.
To test this update, please install it with the following command:

sudo dnf update --enablerepo=qubes-vm-r4.2-current-testing

Changes included in this update

@andrewdavidwong andrewdavidwong added the affects-4.1 This issue affects Qubes OS 4.1. label Aug 8, 2023
@qubesos-bot
Copy link

Automated announcement from builder-github

The package core-agent-linux has been pushed to the r4.2 stable repository for the CentOS centos-stream8 template.
To install this update, please use the standard update command:

sudo yum update

Changes included in this update

@qubesos-bot
Copy link

Automated announcement from builder-github

The package core-agent-linux has been pushed to the r4.2 stable repository for the Debian template.
To install this update, please use the standard update command:

sudo apt-get update && sudo apt-get dist-upgrade

Changes included in this update

@qubesos-bot
Copy link

Automated announcement from builder-github

The package core-agent-linux has been pushed to the r4.2 stable repository for the Debian template.
To install this update, please use the standard update command:

sudo apt-get update && sudo apt-get dist-upgrade

Changes included in this update

@qubesos-bot
Copy link

Automated announcement from builder-github

The component core-agent-linux (including package core-agent-linux) has been pushed to the r4.2 stable repository for the Fedora template.
To install this update, please use the standard update command:

sudo dnf update

Changes included in this update

@qubesos-bot
Copy link

Automated announcement from builder-github

The component core-agent-linux (including package core-agent-linux) has been pushed to the r4.2 stable repository for the Fedora template.
To install this update, please use the standard update command:

sudo dnf update

Changes included in this update

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-4.1 This issue affects Qubes OS 4.1. affects-4.2 This issue affects Qubes OS 4.2. C: core C: templates diagnosed Technical diagnosis has been performed (see issue comments). P: default Priority: default. Default priority for new issues, to be replaced given sufficient information. pr submitted A pull request has been submitted for this issue. r4.2-vm-bookworm-stable r4.2-vm-bullseye-stable r4.2-vm-centos-stream8-stable r4.2-vm-fc37-stable r4.2-vm-fc38-stable
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants