shell scripts added

This commit is contained in:
ed 2019-11-22 22:14:53 +01:00
parent 5eda643c40
commit acc9d6e3bd
3 changed files with 44 additions and 0 deletions

36
scripts/muusb Executable file
View File

@ -0,0 +1,36 @@
#!/bin/sh
MNTPOINTS="/media/usb1\n/media/usb2\n/mnt"
MOUNTABLE=$(lsblk -lp | grep "^/dev/sd[b-z][1-9]" | awk '{print $1, "(" $4 ")"}')
#check if MOUTABLE is empty
if [ -z "$MOUNTABLE" ]; then
echo "nothing to (un)mount" | dmenu
exit 1
fi
MOU=$(printf "m\nu" | dmenu -p "mount or unmount?")
case $MOU in
m)
TOMOUNT=$(echo "$MOUNTABLE" | dmenu -i -p "which one?" | awk '{print $1}')
if [ ! -z "$TOMOUNT" ]; then
MNTPNT=$(printf "$MNTPOINTS" | dmenu -p "where?")
echo "$TOMOUNT"
echo "$MNTPNT"
sudo mount $TOMOUNT $MNTPNT
exit 0
fi
;;
u)
MOUNTED=$(lsblk -lp | grep " /media/*" | awk '{print $1}')
if [ -z "$MOUNTED" ]; then
FAIL=$(echo "ok then..." | dmenu -p "nothing to unmount...")
exit 0
else
TOUNMOUNT=$(echo "$MOUNTED" | dmenu -p "which one?")
sudo umount $TOUNMOUNT
fi
;;
esac

5
scripts/scrotshot Executable file
View File

@ -0,0 +1,5 @@
#!/bin/sh
scrot $HOME/pic/screen/%y%m%d%H%M%S-scrn.png
#notify-send -u low "screnn shot saved"
#ns "screen shoted"

3
scripts/sxivb Executable file
View File

@ -0,0 +1,3 @@
#!/bin/sh
sxiv -t *.jpg *.png *.ff