Xfce Forum

Sub domains
 

You are not logged in.

#1 2017-07-25 19:49:32

mabra
Member
Registered: 2015-09-05
Posts: 49

How to run a GUI program as root

Hi !

I've just installed Debian Strech with XFCE4 (4.12.3).
How to start a GUI program as root? I need a filemanger and an editor, may be others too.
I also want to create my own shortcuts/menuentries to start a program this way.
There is even not shortcut to run a terminal as root.

Where can I find something like this?

Thanks anyway,
Manfred

Offline

#2 2017-07-25 20:17:35

sixsixfive
Member
From: behind you
Registered: 2012-04-08
Posts: 579
Website

Re: How to run a GUI program as root

apt install gksu
gksu $app 

or better

apt install menu
su-to-root -X -c $app 

or if you have a polkit-client installed

pkexec --user root $fullpathtoapp

you need to add a policy for ever app in /usr/share/polkit-1/actions/org.xfce.pkexec.$appname.policy

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE policyconfig PUBLIC
 "-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
 "http://www.freedesktop.org/standards/PolicyKit/1/policyconfig.dtd">
<policyconfig>
  <action id="org.xfce.pkexec.$appname">
    <message>Authentication is required to run $appname</message>
    <icon_name>$appicon</icon_name>
    <defaults>
      <allow_any>auth_admin</allow_any>
      <allow_inactive>auth_admin</allow_inactive>
      <allow_active>auth_admin</allow_active>
    </defaults>
    <annotate key="org.freedesktop.policykit.exec.path">$fullpathtoapp/annotate>
    <annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
  </action>
</policyconfig> 

there are also more ways like with YAD, Zenity or with any terminal that lauches a sux shell...

Offline

#3 2017-07-25 22:17:19

mabra
Member
Registered: 2015-09-05
Posts: 49

Re: How to run a GUI program as root

Hi !

Thanks a lot!
I'll start with this first.

sixsixfive wrote:
apt install gksu
gksu $app 

and then look for the other options, step by step.

Regards,
Manfred

Offline

Board footer

Powered by FluxBB