Skip to content

Instantly share code, notes, and snippets.

View buldezir's full-sized avatar

Alexander Arutyunov buldezir

  • Berlin, Germany
  • 20:13 (UTC +02:00)
View GitHub Profile
@buldezir
buldezir / toggle-display.sh
Created November 18, 2024 07:16
Switch external display input with m1ddc
#!/bin/bash
function choose_from_menu() {
local prompt="$1" outvar="$2"
shift
shift
local options=("$@") cur=0 count=${#options[@]} index=0
local esc=$(echo -en "\033") # cache ESC as test doesn't allow esc codes
printf "$prompt\n"
while true