remove xtrakeys, add storage_menu
This commit is contained in:
parent
4f05f8a6e4
commit
e39753cb88
1 changed files with 43 additions and 0 deletions
43
storage_menu.sh
Executable file
43
storage_menu.sh
Executable file
|
@ -0,0 +1,43 @@
|
|||
#!/bin/sh
|
||||
IFS="
|
||||
"
|
||||
|
||||
any=0
|
||||
echo "<openbox_pipe_menu>"
|
||||
for l in $(udiskie-info -a -o "{device_file} '{ui_id_label}' '{ui_id_uuid}' {is_filesystem} {is_luks} {is_mounted}"); do
|
||||
IFS=" "
|
||||
set -- $l
|
||||
device=$1
|
||||
label=$2
|
||||
uuid=$3
|
||||
fs=$4
|
||||
luks=$5
|
||||
mounted=$6
|
||||
|
||||
# set label to UUID if none
|
||||
# and strip single quotes, which made tokenization simpler
|
||||
if [ "${label}" = "''" ]; then
|
||||
label=${uuid}
|
||||
fi
|
||||
label=$(echo "${label}" | sed -e s/\'//g)
|
||||
|
||||
# fs or luks should be true if we can mount it
|
||||
if [ "${fs}" = "True" ] || [ "${luks}" = "True" ]; then
|
||||
any=1
|
||||
if [ "${mounted}" = "True" ]; then
|
||||
echo "<item label=\"${device}: ${label} ⏏\">"
|
||||
echo "<action name=\"Execute\"><execute>udiskie-umount ${device}</execute></action>"
|
||||
echo "</item>"
|
||||
else
|
||||
echo "<item label=\"${device}: ${label}\">"
|
||||
echo "<action name=\"Execute\"><execute>udiskie-mount ${device}</execute></action>"
|
||||
echo "</item>"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
if [ ${any} -eq 0 ]; then
|
||||
echo "<separator label=\"none\"/>"
|
||||
fi
|
||||
|
||||
echo "</openbox_pipe_menu>"
|
Loading…
Reference in a new issue