Should I be using run0 instead of sudo?

I dit not insult you. It was not my target.

But if you reed properly … its in my first post

And everithing after is solution to open display :slight_smile:
Like the example about display env in run0

Its common heavy discused problem with some gnome app mainly gparted on internet.

And yes .. its not broken system → there is something missing in dependencies for gparted or gnome :slight_smile: …something that is not instaled on WM systems → not broken because it was newer there and newer asked to install :slight_smile:

And mayby editig gparted.desktop is not ideal solution to the problem , buts is eassy and quit harmless that file dosend change for long time so even blocking in pacman.conf with
NoUpgrade= cant do harm :slight_smile:

@CyberDeath, perhaps, before you request that others read your post, you install a spell checker. I find your comments genuinely difficult to parse.

1 Like

In every forum is guy like you :slight_smile: :+1:
Sorry for my myspell , english is not my nativ language and im only self lerner :smiley: , i have only checker for my nativ (czech) becaus i have problems even with that . And some times when im faster over my thought , i made more mistakes.

1 Like

@CyberDeath, hence my recommendation. None of your faults are egregious, and would be caught by a spell checker. I’ve a Polish friend who does the same.

Most likely you haven’t installed or started a GUI Polkit authentication agent like mate-polkit or polkit-gnome. https://wiki.archlinux.org/title/Polkit#Authentication_agents

The default pkttyagent only works in the terminal; for a GUI app you need a GUI Polkit agent running. Install one and autostart it in your WM config. See here for example, or check the wiki for whatever WM you are using: https://github.com/swaywm/sway/wiki#wayland-wont-let-me-run-apps-as-root

With a GUI Polkit agent running, you can just run GParted with the normal desktop file and skip all the mucking about with environment variables in desktop files altogether.

Your first post is mostly false though. You claimed run0 cannot do certain things that sudo can, but the way you are launching GParted is not an example of that. Your issue has nothing to do with run0 or sudo at all, rather it is caused by trying to run GParted without setting environment variables that need to be defined for the application to launch.

The only reason it was “working” with sudo is because you were running it with the -E flag, which passes the user environment to root (including the one or two variables that you actually need in this case). You should not launch applications this way because it has security implications and can cause certain things to break (for example, by causing root to write in user-owned spaces).

Most likely you are not defining the theme properly. Try either setting the GTK_THEME environment variable, or use gsettings or a gschema override. Check out this article here: https://github.com/swaywm/sway/wiki/GTK-3-settings-on-Wayland

That’s not quite right. You are not missing dependencies that need to be installed (unless you are missing the optional dependency xorg-xhost–see the note in pacman -Qi gparted). Rather, there are things missing from your environment which need to be defined before the application will launch.

That is definitely false. You should not block the application from updating, nor any other application if you can help it. Holding back updates can cause major issues that are difficult to troubleshoot or resolve. https://wiki.archlinux.org/title/System_maintenance#Partial_upgrades_are_unsupported

If you are blocking updates to prevent modifications to the desktop file from being overwritten, then you are editing your desktop file incorrectly. You should not be editing them directly in /usr/share/applications, you should first copy them to ~/.local/share/applications and then modify them there.

https://wiki.archlinux.org/title/Desktop_entries#Modify_desktop_files

Modify desktop files

For system-wide .desktop files (e.g. those installed from a package), first copy the relevant .desktop file (e.g. from /usr/share/applications/) to $XDG_DATA_HOME/applications/ (e.g. ~/.local/share/applications/). This prevents your changes from being overwritten when the package gets updated during system upgrades. The local user-specific .desktop files should automatically take precedence over the system-wide files. Now you can modify the local user-specific .desktop file as needed.

In general, your grievance toward run0 is wholly misdirected because none of the issues you have mentioned are caused by or related to run0 in any way. Rather, your issues are caused by having a system which is not properly configured for what you are trying to do.

I think you are doing fine. Personally I haven’t found any of this difficult to follow.

If you wanted to add support for spell-checking another language to your browser, it’s as simple as installing the corresponding Hunspell package (see pacman -Ss hunspell): https://wiki.archlinux.org/title/Firefox#Spell_checking

4 Likes

Oh ! I didnt expect so therall answer , and help.

so longer answer from me →

Polkit → i have polkit-gnome and its running

Yes run0 less powerful ,in that moment it was true → because i dit not know how to made it works → you helped me to find solution.

I was not using sudo -E in the desktop file , i edited added my ovn rule to /etc/sudoers.d/ with Defaults env_keep += "QT_QPA_PLATFORM WAYLAND_DISPLAY XDG_RUNTIME_DIR"

GTK theme → when i fist got to this i answered from phone so i dit not remember the name of theme , im not using Adwaia but Arc … i have configured GTK file … i try to use arc-dark and arc whit forcing dark version → booth aproache work for all apps → their dark with corect theme , Only gparted and gnome-calculator ingores the setting and need to force them before launch.

From optional dependencies im missing the xorg-xhost → if this is the source of problem why is not in force dependencies ???

NoUpgrade = im only block upgrade for dekstop file of gparted and gnome-calculator … I dont like second file in .local … Sometimes it show two icons in launcher .

And thanks for more help :slight_smile:

EDIT: and yes the xorg-xhost is the source of problems → after i install it it lanch just fine → only with bad theme → so i dont need to run it with run0 or sudo any more only with the GTK_Theme wariables.

EDIT2 : BTW if you not using sudo and removed it from the system you dit not runn into any problem ? Like with eos-update or other “made” scripts ? Dit u need to create alias for run0 → sudo ?

Because not everyone needs it. Only users running GParted on Wayland will need this package installed.

When you install a package with optional dependencies, it’s a good idea to read through them and decide if you want to install any of them. Often a brief note regarding the purpose of the optional dependency will be listed in the package info:

❯ pacman -Si gparted
Repository      : extra
Name            : gparted
Version         : 1.7.0-1
Description     : A Partition Magic clone, frontend to GNU Parted
Architecture    : x86_64
URL             : https://gparted.org/
Licenses        : GPL-2.0-or-later  GFDL-1.2-or-later
Groups          : None
Provides        : None
Depends On      : parted  gtkmm3
Optional Deps   : dosfstools: for FAT16 and FAT32 partitions
                  jfsutils: for jfs partitions
                  f2fs-tools: for Flash-Friendly File System
                  btrfs-progs: for btrfs partitions
                  exfatprogs: for exFAT partitions
                  ntfs-3g: for ntfs partitions
                  udftools: for UDF file system support
                  xfsprogs: for xfs partitions
                  nilfs-utils: for nilfs2 support
                  polkit: to run gparted from application menu
                  gpart: for recovering corrupt partition tables
                  mtools: utilities to access MS-DOS disks
                  xorg-xhost: authorization from wayland
[...]

Pacman also prints out this information when you install the package.

I did not remove it, I just never installed it in the first place. But no, I have not run into any problems.

This is an Arch Linux installation, so I have not tested against any EOS scripts. I do have an EOS installation but it is basically just a stock install for testing changes to the Community Sway spin (so sudo is installed on that one).

I did have a script that used sudo -u (to run a process as a specific user), but run0 also supports the -u flag for running a process as a specific user so it was a drop-in replacement in that case.

I use Fish shell and set an abbreviation for sudo > run0 in my Fish config.

abbr sudo run0

When I type sudo it “expands” to run0. This is good because I type sudo every time (it’s essentially muscle memory at this point), but it still prints run0 in the terminal which kind of reminds me what is happening.

I also have an alias for run0 > 'run0 --background=""' because I do not really care for the red background feature.

alias run0 'run0 --background=""'

Yeh → xorg-xhost → its unwise to not to be in required dependencies . Now when the world moves to wayland :slight_smile:

My → River EOS is based on comunity sway edition :smiley:

Yes im using fish allso … abbr works only in fish → but most of the scripts runs in bash so i thing alias needed for backward compatibility.

run0 --background=“”’ → what red bacground → For me nothing changes when i run run0 ?

But i dont hawe the Balls for completly remove sudo for now .