diff options
author | InigoGutierrez <inigogf.95@gmail.com> | 2019-03-13 12:13:50 +0100 |
---|---|---|
committer | InigoGutierrez <inigogf.95@gmail.com> | 2019-03-13 12:13:50 +0100 |
commit | a5c1f264db4bcf99238a4c6b772eb5ad4dd2e386 (patch) | |
tree | 948e4a0e326a529c5a5af2952287c89c378e542f /dmenuUmount.sh | |
parent | 02308076e833029cb84467e1773aacbac8ae1f0a (diff) | |
download | scripts-a5c1f264db4bcf99238a4c6b772eb5ad4dd2e386.tar.gz scripts-a5c1f264db4bcf99238a4c6b772eb5ad4dd2e386.zip |
Now mount and unmount scripts show label and format on dmenu.
Diffstat (limited to 'dmenuUmount.sh')
-rwxr-xr-x | dmenuUmount.sh | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/dmenuUmount.sh b/dmenuUmount.sh index 61af1c1..7c19019 100755 --- a/dmenuUmount.sh +++ b/dmenuUmount.sh @@ -21,7 +21,12 @@ i=0 while read -r line do i=$((i+1)) - drives="$drives$i. $( echo "$line" | awk '{print $1, "(" $4 ")", "on", $7}' )"$'\n' + name="$(echo "$line" | awk '{print $1}')" + size="$(echo "$line" | awk '{print $4}')" + mountpoint="$(echo "$line" | awk '{print $7}')" + label="$(lsblk -lpo "name,label" | grep "$name" | awk '{print $2}')" + fstype="$(lsblk -lpo "name,fstype" | grep "$name" | awk '{print $2}')" + drives="$drives$i. $name ($size) \"$label\" [$fstype] on $mountpoint"$'\n' done <<< "$list" [ "$drives" == "" ] && exit lines=$(echo "$drives" | wc -l) |