diff options
| author | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2025-02-16 05:38:47 +0900 |
|---|---|---|
| committer | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2025-02-16 05:38:47 +0900 |
| commit | bed58b07b5669cd6e333cd20c984a808ca16fbaa (patch) | |
| tree | 653c0a462cff144800388dbeb7e6967263795e89 /ar/.local/bin/setfirmware | |
| parent | d351456d06ee07841f03714b2468cffc340b9112 (diff) | |
deleted qutebrowser/moergo-glove80-keyboard-layers.pdf, created glove80/, created bin/setfirmware
Diffstat (limited to 'ar/.local/bin/setfirmware')
| -rwxr-xr-x | ar/.local/bin/setfirmware | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/ar/.local/bin/setfirmware b/ar/.local/bin/setfirmware new file mode 100755 index 0000000..4c4dad1 --- /dev/null +++ b/ar/.local/bin/setfirmware @@ -0,0 +1,17 @@ +#!/bin/sh + +lsblk +drive=$(lsblk | grep -E '3[0-9].*M' | cut -d' ' -f1) +drive="/dev/$drive" +printf "\n%s\n" "Target drive: $drive" +firmwarepath="${XDG_CONFIG_HOME:-${HOME}/.config}/glove80" +firmware="$(find "$firmwarepath" -type f -iname '*.uf2' | fzf --prompt "Choose a firmware: ")" +mp="/media/$USER/firmware" +[ -d "$mp" ] || mkdir -p "$mp" +sudo -A mount "$drive" "$mp" +sudo -A cp "$firmware" "$mp/" +[ -f "$firmware" ] || exit 1 +ls "$mp" +sudo -A umount "$mp" +[ -e "$mp" ] && [ ! -s "$mp" ] && sudo -A rm -rf "$mp" +echo "Done!" |
