aboutsummaryrefslogtreecommitdiff
path: root/dmenuMount.sh
diff options
context:
space:
mode:
authorInigoGutierrez <inigogf.95@gmail.com>2019-03-13 12:13:50 +0100
committerInigoGutierrez <inigogf.95@gmail.com>2019-03-13 12:13:50 +0100
commita5c1f264db4bcf99238a4c6b772eb5ad4dd2e386 (patch)
tree948e4a0e326a529c5a5af2952287c89c378e542f /dmenuMount.sh
parent02308076e833029cb84467e1773aacbac8ae1f0a (diff)
downloadscripts-a5c1f264db4bcf99238a4c6b772eb5ad4dd2e386.tar.gz
scripts-a5c1f264db4bcf99238a4c6b772eb5ad4dd2e386.zip
Now mount and unmount scripts show label and format on dmenu.
Diffstat (limited to 'dmenuMount.sh')
-rwxr-xr-xdmenuMount.sh7
1 files changed, 6 insertions, 1 deletions
diff --git a/dmenuMount.sh b/dmenuMount.sh
index e79d650..edbf4d7 100755
--- a/dmenuMount.sh
+++ b/dmenuMount.sh
@@ -24,7 +24,12 @@ i=0
while read -r line
do
i=$((i+1))
- mountable="$mountable$i. $( echo "$line" | awk '{print $1, "(" $4 ")"}' )"$'\n'
+ name="$(echo "$line" | awk '{print $1}')"
+ size="$(echo "$line" | awk '{print $4}')"
+ label="$(lsblk -lpo "name,label" | grep "$name" | awk '{print $2}')"
+ fstype="$(lsblk -lpo "name,fstype" | grep "$name" | awk '{print $2}')"
+ mountable="$mountable$i. $name ($size) \"$label\" [$fstype]"$'\n'
+ #$( echo "$line" | awk '{print $, "(" $2 ")", "\"" $3 "\"", "[" $4 "]"}' )"$'\n'
done <<< "$(lsblk -lp | grep "part $" )"
[[ "$mountable" = "" ]] && exit 1
lines=$(echo "$mountable" | wc -l)