trash 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. #!/bin/sh -e
  2. #
  3. # trash: show icon (and optionally count) if entries in trash.
  4. #
  5. # Copyright (C) 2011 Canonical Ltd.
  6. # Copyright (C) 2011-2014 Dustin Kirkland
  7. #
  8. # Authors: James Hunt <james.hunt@canonical.com>
  9. # Dustin Kirkland <kirkland@byobu.org>
  10. #
  11. # This program is free software: you can redistribute it and/or modify
  12. # it under the terms of the GNU General Public License as published by
  13. # the Free Software Foundation, version 3 of the License.
  14. #
  15. # This program is distributed in the hope that it will be useful,
  16. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. # GNU General Public License for more details.
  19. #
  20. # You should have received a copy of the GNU General Public License
  21. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  22. TRASH_DIR="$HOME/.local/share/Trash/files"
  23. __trash_detail() {
  24. find "$TRASH_DIR"
  25. }
  26. __trash() {
  27. local count
  28. [ -d "$TRASH_DIR" ] || return
  29. count=$(ls $dir|wc -l)
  30. [ "$count" = "0" ] && return
  31. printf "%s[%s]" "$ICON_TRASH" "$count"
  32. }
  33. # vi: syntax=sh ts=4 noexpandtab