boredsquirrel, (edited )

This is very easy in KDE but Desktop entries work the same on all Desktops.

See this post where I mentioned how to do this with running Konsole with root.

In general, use polkit instead of sudo, every desktop has a GUI dialog that pops up.


<span style="color:#323232;">pkexec APPNAME
</span>

And add this as a desktop action, following the guide.


<span style="color:#323232;">[Desktop Entry]
</span><span style="color:#323232;">Type=Application
</span><span style="color:#323232;">Exec=konsole
</span><span style="color:#323232;">Icon=utilities-terminal
</span><span style="color:#323232;">Categories=System;TerminalEmulator;
</span><span style="color:#323232;">Actions=root
</span><span style="color:#323232;">Name=Konsole
</span><span style="color:#323232;">GenericName=Terminal
</span><span style="color:#323232;">Comment="$GenericName"
</span><span style="color:#323232;">
</span><span style="color:#323232;">[Desktop Action root]
</span><span style="color:#323232;">Name=root
</span><span style="color:#323232;">Icon=folder-root-symbolic
</span><span style="color:#323232;">Exec=pkexec konsole
</span>

In the specific case of Konsole you could use a profile instead.

Be aware that nearly no program should be ran as root. Also not Konsole. The program is ran as the user, and can enter a root shell, but never run random apps as root. Not even many terminal apps are made to be ran as root, for example use sudoedit instead of sudo nano for editing files.

To view and change system files in KDE, type admin:/ into the location bar.

Running apps as root doesnt work with Wayland, and for a good reason.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • linux@lemmy.ml
  • fightinggames
  • All magazines