Introduction
Have you ever tried launching a graphical application with sudo on Wayland? I recently ran into a common Wayland problem: I couldn’t use a GUI text editor to edit a protected configuration file. On my setup attempting to launch graphical applications with elevated privileges did not work and only generated errors and warnings. It’s one of multiple Wayland-related issues I’m seeing and trying to find practical workarounds.
I understand the security concerns around running graphical applications with administrator privileges. Still, when a GUI editor can’t access a protected file, users generally have no choice bu to turn to command-line tools, even for simple configuration changes.
Without a convenient graphical option, users will end up doing more work from the command line than they’re comfortable with. This increases the chance of mistakes, especially when editing system files. This basically knocks the legs out from under the argument for limiting GUI application’s elevated permissions.
What I want to do here is find a practical workaround that lets average users edit protected configuration files without resorting to the command line.
The major desktop environments (KDE Plasma, Gnome, XFCE, etc) tend to provide their own administrative tools, but not everyone uses a major desktop. In this video, I’ll explore a workaround that should also be useful on other minimal setups.
For context, I’m using a system I built and documented in earlier articles: a base Arch Linux installation on a Btrfs filesystem, using the Labwc Wayland compositor, and greetd Display (login) manager. I’m also using PCManFM-Qt as my file manager and Geany as my text editor.
The option I will be using is sudoedit, which takes a different approach from launching the editor itself with administrator privileges. It lets you edit a temporary copy of the protected file as a regular user, then applies the changes to the original file with elevated privileges. That makes it a promising option for editing system configuration files with a graphical editor.
The exact behavior can and will vary depending on the application, compositor, and system configuration. I’m describing how it works on my setup; your experience and the usability of this approach may differ.
(more…)


Leave a Reply