summaryrefslogtreecommitdiffstats
path: root/.scripts
diff options
context:
space:
mode:
authorLuke Smith <luke@lukesmith.xyz>2019-04-01 17:51:00 -0400
committerGitHub <noreply@github.com>2019-04-01 17:51:00 -0400
commit5f92f3ceccd0c5583a53697fc8d4eaccbb0d5c74 (patch)
tree19968d2cdbf5a5b5ebf3831a24738007846953d1 /.scripts
parent4139a6a0e7fd463ddaac98b9628702e20c8f3424 (diff)
parente9fc2e0290b23f3b3a22372368540891c2a6945f (diff)
downloadeibhear-5f92f3ceccd0c5583a53697fc8d4eaccbb0d5c74.tar.gz
eibhear-5f92f3ceccd0c5583a53697fc8d4eaccbb0d5c74.tar.zst
eibhear-5f92f3ceccd0c5583a53697fc8d4eaccbb0d5c74.zip
Merge pull request #258 from TomJansen/master
Prune existing mountpoints from find in dmenumount
Diffstat (limited to '.scripts')
-rwxr-xr-x.scripts/i3cmds/dmenumount3
1 files changed, 2 insertions, 1 deletions
diff --git a/.scripts/i3cmds/dmenumount b/.scripts/i3cmds/dmenumount
index 4de7438..615e94a 100755
--- a/.scripts/i3cmds/dmenumount
+++ b/.scripts/i3cmds/dmenumount
@@ -18,7 +18,8 @@ getmount() { \
mountusb() { \
chosen="$(echo "$usbdrives" | dmenu -i -p "Mount which drive?" | awk '{print $1}')"
sudo -A mount "$chosen" && notify-send "$chosen mounted." && exit 0
- getmount "/mnt /media /mount /home -maxdepth 5 -type d"
+ alreadymounted=$(lsblk -nrpo "name,type,mountpoint" | awk '$2=="part"&&$3!~/\/boot|\/home$|SWAP/&&length($3)>1{printf "-not \( -path *%s -prune \) \ \n",$3}')
+ getmount "/mnt /media /mount /home -maxdepth 5 -type d $alreadymounted"
partitiontype="$(lsblk -no "fstype" "$chosen")"
case "$partitiontype" in
"vfat") sudo -A mount -t vfat "$chosen" "$mp" -o rw,umask=0000;;