Xfce Forum

Sub domains
 

You are not logged in.

#1 2022-12-22 17:29:20

jeff story
Member
From: Shelton, WA, USA
Registered: 2011-05-09
Posts: 26
Website

Thunar Custom Actions "open root terminal here"

I'm trying to get a root terminal to open via thunar custon actions.
I followed this guide: https://docs.xfce.org/xfce/thunar/custo … minal_here
Installed the deprecated package and dependencies via Arch AUR: gksu libgksu gconfig
And it just doesn't work. I've tried various combinations of commands with pkexec as well.
I can get a root terminal to open easy enough, but not within the existing directory.

Anyone have any luck with this or suggestions?

Edit:
I'm still on xfce4 4.16. System is up to date except xfce4 group until I get some time to test it.

Last edited by jeff story (2022-12-22 17:37:30)

Offline

#2 2022-12-22 19:04:01

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,007

Re: Thunar Custom Actions "open root terminal here"

Two ways to do this (you can uninstall those deprecated packages, they are not needed).

  1. Via sudo, set the command to:

    xfce4-terminal --working-directory=%f --color-text red -e 'sudo -s'
  2. If you want to use pkexec & polkit, then you first need to create a policykit policy action (/usr/share/polkit-1/actions/org.xfce.terminal.policy) with the following content:

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE policyconfig PUBLIC
     "-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
     "https://www.freedesktop.org/standards/PolicyKit/1/policyconfig.dtd">
    <policyconfig>  
    
     <vendor>Xfce4-terminal</vendor>
     <vendor_url>https://xfce.org/</vendor_url>
     <icon_name>org.xfce.xfce4-terminal</icon_name>
    
     <action id="org.xfce.terminal">
     
     <description>Run xfce4-terminal as root</description>
     <defaults>
     <allow_any>no</allow_any>
     <allow_inactive>auth_admin</allow_inactive>
     <allow_active>auth_admin</allow_active>
     </defaults>
     <annotate key="org.freedesktop.policykit.exec.path">/usr/bin/xfce4-terminal</annotate>
     <annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
     </action>
    
    </policyconfig>

    ...then use the following as a custom action command:

    pkexec xfce4-terminal --working-directory=%f --color-text red

Last edited by ToZ (2022-12-22 19:10:28)


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#3 2022-12-24 04:41:01

jeff story
Member
From: Shelton, WA, USA
Registered: 2011-05-09
Posts: 26
Website

Re: Thunar Custom Actions "open root terminal here"

Thanks Toz,

I went with the sudo version. Simple and just prompts for password in terminal, which is what I want to use anyway.
Also made/saved notes for the pkexec version.

Last edited by jeff story (2022-12-24 06:07:01)

Offline

Board footer

Powered by FluxBB