1 / 4
SUDO button — zdjęcie 1
1 / 4

SUDO button

Zamów wydruk tego modelu

Obliczymy ostateczną cenę na podstawie wybranego pliku. Sprawdzisz ją i zaakceptujesz przed płatnością.

Zapisane na tym urządzeniu.

Informacje o modelu

Źródło
Printables
Kategoria
Computers
Licencja
Creative Commons — Attribution — Noncommercial

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.

Tagi