feat: bin -> .local/bin, vcs_info untracked
This commit is contained in:
parent
af14629939
commit
7c98658d24
30 changed files with 31 additions and 46 deletions
48
.local/bin/am
Executable file
48
.local/bin/am
Executable file
|
@ -0,0 +1,48 @@
|
|||
#!/bin/bash -e
|
||||
|
||||
# TODO
|
||||
# mount all partitions by selecting disk
|
||||
# usage
|
||||
# support for /mnt
|
||||
|
||||
function get_row() {
|
||||
local row _col
|
||||
|
||||
IFS=';' read -rsdR -p $'\e[6n' row _col
|
||||
echo "${row#??}"
|
||||
}
|
||||
|
||||
ROW="$(($(get_row) + 1))"
|
||||
function clear_output() {
|
||||
local row
|
||||
|
||||
row="$(get_row)"
|
||||
for _ in $(seq "$ROW" "$row"); do
|
||||
printf '\e[1A\e[K'
|
||||
done
|
||||
}
|
||||
|
||||
function main() {
|
||||
while true; do
|
||||
mapfile -t LSBLK <<< "$(lsblk -n --paths --list | grep part)"
|
||||
|
||||
COLUMNS=1
|
||||
select dev in "${LSBLK[@]}"; do
|
||||
if [ -z "$dev" ]; then
|
||||
clear_output
|
||||
break
|
||||
fi
|
||||
name="$(awk '{print $1}' <<< "$dev")"
|
||||
|
||||
clear_output
|
||||
if mount | grep -q "$name"; then
|
||||
umount "$name"
|
||||
else
|
||||
udisksctl mount -b "$name" > /dev/null
|
||||
fi
|
||||
break
|
||||
done || exit
|
||||
done
|
||||
}
|
||||
|
||||
main "$@"
|
Loading…
Add table
Add a link
Reference in a new issue