From 0013b79d6e0124f157df6304da439ec5771810f7 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Thu, 2 Aug 2018 14:30:01 -0400 Subject: [PATCH] -A added to sudo in mount scripts --- .scripts/dmenumount | 6 +++--- .scripts/dmenuumount | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.scripts/dmenumount b/.scripts/dmenumount index aeb9916..91683e6 100755 --- a/.scripts/dmenumount +++ b/.scripts/dmenumount @@ -10,7 +10,7 @@ drives="$(lsblk -rpo "$COLS" | awk '$2=="part"&&$4==""{printf "%s (%s)\n",$1,$3} [ -z "$drives" ] && exit 1 chosen="$(echo "$drives" | dmenu -i -p "Mount which drive?" | awk '{print $1}')" [ -z "$chosen" ] && exit 1 -sudo mount "$chosen" && exit 0 +sudo -A mount "$chosen" && exit 0 # You may want to change the line below for more suggestions for mounting. # I.e. you can increase the depth of the search, or add directories. # This will increase the load time briefly though. @@ -18,6 +18,6 @@ mp="$(find /mnt /media /mount /home -type d -maxdepth 5 2>/dev/null | dmenu -i - [ "$mp" = "" ] && exit 1 if [ ! -d "$mp" ]; then mkdiryn=$(printf "No\\nYes" | dmenu -i -p "$mp does not exist. Create it?") - [ "$mkdiryn" = "Yes" ] && sudo mkdir -p "$mp" + [ "$mkdiryn" = "Yes" ] && sudo -A mkdir -p "$mp" fi -sudo mount "$chosen" "$mp" && pgrep -x dunst && notify-send "$chosen mounted to $mp." +sudo -A mount "$chosen" "$mp" && pgrep -x dunst && notify-send "$chosen mounted to $mp." diff --git a/.scripts/dmenuumount b/.scripts/dmenuumount index df40ae9..8d0928a 100755 --- a/.scripts/dmenuumount +++ b/.scripts/dmenuumount @@ -9,4 +9,4 @@ drives=$(lsblk -rpo "$COLS" | awk '$2=="part"&&$4!~/boot|home|SWAP/&&length($4)> [ -z "$drives" ] && exit chosen=$(echo "$drives" | dmenu -i -p "Unmount which drive?" | awk '{print $1}') [ -z "$chosen" ] && exit -sudo umount "$chosen" && pgrep -x dunst && notify-send "$chosen unmounted." +sudo -A umount "$chosen" && pgrep -x dunst && notify-send "$chosen unmounted."