Add 'mounter' and 'umounter' scripts
This commit is contained in:
parent
a997059c98
commit
d8a2a48744
@ -47,6 +47,10 @@ super + shift + e
|
|||||||
fawesome
|
fawesome
|
||||||
F11
|
F11
|
||||||
[ $(pgrep ffmpeg) ] && blaze -s || blaze
|
[ $(pgrep ffmpeg) ] && blaze -s || blaze
|
||||||
|
F1
|
||||||
|
mounter
|
||||||
|
F2
|
||||||
|
umounter
|
||||||
|
|
||||||
|
|
||||||
#~~~~~~~~~~~
|
#~~~~~~~~~~~
|
||||||
|
14
.local/bin/scripts/mounter
Executable file
14
.local/bin/scripts/mounter
Executable file
@ -0,0 +1,14 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
data() { lsblk -r | sed '/.*k $/d; /t \//d; 1d' | awk '{ print $1 " - " $4 }' ;}
|
||||||
|
[ ! "$(data)" ] && { rofi -e "Nothing to mount!"; exit 1 ;}
|
||||||
|
m() { rofi -dmenu -i "$@" ;}
|
||||||
|
|
||||||
|
part="$(data | m -p "Partition" -l "$(data | wc -l)" | awk '{ print $1 }')"
|
||||||
|
[ ! "$part" ] && exit 1
|
||||||
|
mpoints() { find /mnt /media -type d ;}
|
||||||
|
mountpoint="$(mpoints | m -p "Mountpoint" -l "$(mpoints | wc -l)")"
|
||||||
|
[ ! "$mountpoint" ] && exit 1
|
||||||
|
|
||||||
|
pass="$(m -l 0 -p "Password" -password)"
|
||||||
|
echo "$pass" | sudo -S -v && sudo mount /dev/"$part" "$mountpoint"
|
10
.local/bin/scripts/umounter
Executable file
10
.local/bin/scripts/umounter
Executable file
@ -0,0 +1,10 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
data() { lsblk -r | awk '/t \// { print $1 " - " $7 }' ;}
|
||||||
|
m() { rofi -dmenu -i "$@" ;}
|
||||||
|
|
||||||
|
part="$(data | m -p "Partition" -l "$(data | wc -l)" | awk '{ print $1 }')"
|
||||||
|
[ ! "$part" ] && exit 1
|
||||||
|
|
||||||
|
pass="$(m -l 0 -p "Password" -password)"
|
||||||
|
echo "$pass" | sudo -S -v && sudo umount /dev/"$part"
|
Loading…
x
Reference in New Issue
Block a user