Prusa Black Friday is here! Free shipping, printer discounts, amazing gifts & more! See all deals!
SUDO button to connect to your computer
10
23
0
255
updated October 5, 2025

Description

PDF

Working on macOS and Linux, I often forget to use the sudo command to run system tools. If that happens, you can type sudo !! to run the command typed just before using the sudo command. So I created this button to automate that.

The button works as follows:

  • On a short press, it sends the command sudo !! to the computer, which will run the command last typed with elevated permissions.
  • If you press long (>0.5 seconds), it sends the command sudo -s which will elevate the shells permissions to root.

You need the following additional parts:

  • 1x ProMicro nrf52840 (~ 3$ on AliExpress)
  • 1x Microswitch 12x12x5mm (~ 2$ on AliExpress)
  • 3x Spring 7x12mm
  • Screws and Thread Insets

The firmware is provided here as hex file, so you can flash it pretty easily to the ProMicro Module. You can find the Git repository for the firmware here, if you would like to build the firmware yourself or change it's functionality.

The module is powered by the USB-C connection. You need to wire the button between GND and GPIO 0.20.

Tags



Model origin

The author marked this model as their own original creation.

License


Highlighted models from creator

View more