all repos — zenUtils @ e39753cb887e587ede7f60d3131c1c7e95f41a0c

misc utilities for computing zen

remove xtrakeys, add storage_menu
Iris Lightshard nilix@nilfm.cc
PGP Signature
-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEEkFh6dA+k/6CXFXU4O3+8IhROY5gFAmQIGzAACgkQO3+8IhRO
Y5gbUQ//dM9LMZKVOcfpVS8chy1mmUDFp98YFsAc/oJYMi9WOZdZgGknSm+PrjXd
5InO/bqNI7hCxs8KbD+608EH/9Yh+sawQ6dBQOK/qlXL2AinJxMmkl4A2GRQqBzW
j0ecbEp/ZwDZ/qNAant9/ImFm9v3qll9TB+S/tuZC+J4wlMzgv5VrhbVSh0hmniE
hAweRu0jeoxQAnqAKXssuQYAVXesbUW0AnHzgwLyfAcwrMzwiK2aQgVzMi0fX1SF
XH0bMUCgQCw4I0Oveg+bKWp5SvP1MNAvia/jJuMM9oiCEi33rh/G0VG/Rclp362b
6pKon33lOreY7bd12U4RpNo/f8ygEGaLCuS7H3LTHgEAqXhsh6szlPS1Ky+TeMMl
ywm+wqrVVxfn46AY6govnmS/Y4NdmbtGzr5eqoaIKYwIUP5b7jql8D0Va6mXUqvO
pXn8kwIExkgUAXeIcJ0MAzhBMu48LkFYUn1dGdNRDRvvSvyBkqWtAb6i67Fsxikb
ZolsKCJcXDNQx3IDjDxb8j/HlU5HkygllA/9/lt1wuqXRGfZ/kEVWb110E/HsQQn
PpZO0jHBkagcCziYHQDTv4TGUvqH2CgLoG0nrZujbTMeu7Imf7A0JtTu2SEUsyGM
NPLgaoOc5WU9A9vn46xCKzqF1xiwljkDJEpHxistTerMxdPA9C4=
=pdz9
-----END PGP SIGNATURE-----
commit

e39753cb887e587ede7f60d3131c1c7e95f41a0c

parent

4f05f8a6e41dc32af80144d9c078d8a5dc898b5c

1 files changed, 43 insertions(+), 0 deletions(-)

jump to
A storage_menu.sh

@@ -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>"