Skip to content

Commit

Permalink
Adds open elevated folder to right-click menu
Browse files Browse the repository at this point in the history
Adds ability to open file manager as an elevated user, by adding a PolKit
script for xdg-open  and integrating it into PCManFM's right-click context menu
after a user called for this [1].

[1] #281
  • Loading branch information
shasheene committed Nov 10, 2021
1 parent 7996468 commit b0b55e2
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/livecd/chroot/usr/local/bin/xdg-open-pkexec
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
pkexec "/usr/bin/xdg-open" "$@"
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[Desktop Entry]
Type=Action
Name=Open root file manager
Profiles=profile-zero;
Icon=system-file-manager

[X-Action-Profile profile-zero]
MimeTypes=inode/directory;
Exec=/usr/local/bin/xdg-open-pkexec %f
Name=Default profile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?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>

<vendor>Rescuezilla</vendor>
<vendor_url>https://rescuezilla.com/</vendor_url>
<icon_name>xdg-open</icon_name>
<action id="com.rescuezilla.xdg-open">

<description gettext-domain="rescuezilla">Run xdg-open as root</description>
<message gettext-domain="rescuezilla">Authentication is required to run xdg-open as root</message>
<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">/usr/bin/xdg-open</annotate>
<annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>

</action>

</policyconfig>

0 comments on commit b0b55e2

Please sign in to comment.