mirror of
https://github.com/LukeSmithxyz/voidrice.git
synced 2026-03-20 01:37:45 +01:00
By changing CF_ICONS variable you can edit icons all across your system.
For example if you want to use material-design-icons-git (AUR) all you
need to do is to change the variable like below:
export CF_ICONS="/home=:/mnt=:android=:bat-charging=:\
bat-discharging=:bat-f=:bat-unknown=:bat=:\
batt=:btc=:cb=📋:clock-00=:clock-01=:clock-02=:\
clock-03=:clock-04=:clock-05=:\
clock-06=:clock-07=:clock-08=:clock-09=:clock-10=:\
clock-11=:clock-12=:cpu=:crypto=:disk=:\
down=:eth=:f-move=:help=:\
hib=:internet=:lan-x=:lan=:lbc=:leave=:lock=:\
mail=:mem=:music=:news=:pause=:pc=:\
pkg-down=:pkg=:q-add=:reboot=:\
rec-cam=:rec-screen=:rec-voice=:renew=:sheets=:\
shutdown=:sync=:temp=:tick-clock=:tick-cloud=:\
time=:tor=:torrent-add=:torrent-seed-x=:torrent-idle=:\
torrent-seed=:up=:usb=:vol-0=:vol-1=:\
vol-2=:vol-m=:vol-x=:vol=:vpn=:weather-h=:\
weather-l=:weather-perc=:weather=:\
wifi-x=:wifi=:🌑=:🌒=:🌓=:🌔=:🌕=:🌖=:🌗=:🌘=:"
45 lines
1.3 KiB
Bash
Executable File
45 lines
1.3 KiB
Bash
Executable File
#!/bin/sh
|
|
|
|
# A dmenu prompt to unmount drives.
|
|
# Provides you with mounted partitions, select one to unmount.
|
|
# Drives mounted at /, /boot and /home will not be options to unmount.
|
|
|
|
unmountusb() {
|
|
[ -z "$drives" ] && exit
|
|
chosen="$(echo "$drives" | dmenu -i -p "Unmount which drive?")" || exit 1
|
|
chosen="$(echo "$chosen" | awk '{print $1}')"
|
|
[ -z "$chosen" ] && exit
|
|
sudo -A umount "$chosen" && notify-send "$(ico usb) USB unmounting" "$chosen unmounted."
|
|
}
|
|
|
|
unmountandroid() { \
|
|
chosen="$(awk '/simple-mtpfs/ {print $2}' /etc/mtab | dmenu -i -p "Unmount which device?")" || exit 1
|
|
[ -z "$chosen" ] && exit
|
|
sudo -A umount -l "$chosen" && notify-send "$(ico android) Android unmounting" "$chosen unmounted."
|
|
}
|
|
|
|
asktype() { \
|
|
choice="$(printf "USB\\nAndroid" | dmenu -i -p "Unmount a USB drive or Android device?")" || exit 1
|
|
case "$choice" in
|
|
USB) unmountusb ;;
|
|
Android) unmountandroid ;;
|
|
esac
|
|
}
|
|
|
|
drives=$(lsblk -nrpo "name,type,size,mountpoint" | awk '$4!~/\/boot|\/home$|SWAP/&&length($4)>1{printf "%s (%s)\n",$4,$3}')
|
|
|
|
if ! grep simple-mtpfs /etc/mtab; then
|
|
[ -z "$drives" ] && echo "No drives to unmount." && exit
|
|
echo "Unmountable USB drive detected."
|
|
unmountusb
|
|
else
|
|
if [ -z "$drives" ]
|
|
then
|
|
echo "Unmountable Android device detected."
|
|
unmountandroid
|
|
else
|
|
echo "Unmountable USB drive(s) and Android device(s) detected."
|
|
asktype
|
|
fi
|
|
fi
|