Add files via upload
This commit is contained in:
1 parent
326c2d8820
commit
19741e568a
26 files changed
+1213
No files matched your search
@@ -0,0 +1,40 @@
|
||||
#!/bin/sh
|
||||
|
||||
# merged and modified luke smith's mount and unmount script and imported to rofi
|
||||
# Modified by S4NKALP
|
||||
|
||||
# ┌─┐┌─┐┌┐┌┌─┐┬┌─┐┬ ┬┬─┐┌─┐┌┬┐┬┌─┐┌┐┌┌─┐
|
||||
# │ │ ││││├┤ ││ ┬│ │├┬┘├─┤ │ ││ ││││└─┐
|
||||
# └─┘└─┘┘└┘└ ┴└─┘└─┘┴└─┴ ┴ ┴ ┴└─┘┘└┘└─┘
|
||||
|
||||
# rofi sconfig
|
||||
roficonfig=~/.config/rofi/mount/prompt.rasi
|
||||
# Always mount your phone here
|
||||
mountpoint=$HOME/Cell
|
||||
[ -d "$mountpoint" ] || mkdir -pv "$mountpoint"
|
||||
|
||||
# ┬─┐┌─┐┌─┐┬
|
||||
# ├┬┘│ │├┤ │
|
||||
# ┴└─└─┘└ ┴
|
||||
|
||||
androiddevices=$(simple-mtpfs -l 2>/dev/null)
|
||||
[ -z "$androiddevices" ] && printf "exit" | rofi -config $roficonfig -dmenu -i -only-match -p "No Android Device Found" && exit
|
||||
|
||||
chk=$(printf "Mount\nUnmount" | rofi -config $roficonfig -dmenu -i -hover-select -p "Android Device: ")
|
||||
|
||||
case $chk in
|
||||
Unmount)
|
||||
unmountable=$(grep simple-mtpfs /etc/mtab 2>/dev/null)
|
||||
if [ -z "$unmountable" ]; then
|
||||
printf "exit" | rofi -config $roficonfig -dmenu -i -only-match -p "Nothing to Unmount" && exit
|
||||
else
|
||||
devices="$(awk '/simple-mtpfs/ {print $2}' /etc/mtab | rofi -config $roficonfig -dmenu -fuzzy -hover-select -i -p "Choose Device to Unmount")"
|
||||
fusermount -u $devices && printf "exit" | rofi -config $roficonfig -dmenu -i -only-match -p "Unmounted Successfully"
|
||||
fi
|
||||
;;
|
||||
Mount)
|
||||
device="$(echo "$androiddevices" | rofi -config $roficonfig -dmenu -i -hover-select -p "Choose Device")"
|
||||
simple-mtpfs --device "$device" "$mountpoint" && echo "exit" | rofi -config $roficonfig -dmenu -i -only-match -p "Mounted Successfully" && exit
|
||||
echo "Ok" | rofi -config $roficonfig -dmenu -i -p "Tap Allow on your phone, after that Enter."
|
||||
simple-mtpfs --device "$device" "$mountpoint" && echo "exit" | rofi -config $roficonfig -dmenu -only-match -i -p "Mounted Successfully" || echo "exit" | rofi -config $roficonfig -only-match -dmenu -i -p "Not mounted"
|
||||
esac 2>/dev/null
|
||||
Reference in new issue
Block a user