Skip to content

Instantly share code, notes, and snippets.

@moraisaugusto
Last active May 27, 2025 18:41
Show Gist options
  • Save moraisaugusto/aa44aae44a8ff541f397f1143af7b569 to your computer and use it in GitHub Desktop.
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
// 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;
}
});
@moraisaugusto
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment