Last active
May 27, 2025 18:41
-
-
Save moraisaugusto/aa44aae44a8ff541f397f1143af7b569 to your computer and use it in GitHub Desktop.
automount partitions using polkit-1 and udisk2 - used for external disks and usb drives
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// See the polkit(8) man page for more information | |
// about configuring polkit. | |
// SAVE IT ON: /etc/polkit-1/rules.d/ | |
// replace the ntfs-3g package: ntfs-3g-fuse | |
// Allow udisks2 to mount devices without authentication | |
// for users in the "wheel" group. | |
polkit.addRule(function(action, subject) { | |
if ((action.id == "org.freedesktop.udisks2.filesystem-mount-system" || | |
action.id == "org.freedesktop.udisks2.filesystem-mount") && | |
subject.active && | |
subject.isInGroup("storage")) { | |
return polkit.Result.YES; | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Make sure the polkit-1 and udisk2 is installed. then, save the file above in
/etc/polkit-1/rules.d/
ref: https://bbs.archlinux.org/viewtopic.php?id=151954