File: nautilus-word-count

package info (click to toggle)
gxmessage 3.4.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,232 kB
  • sloc: sh: 1,565; ansic: 819; makefile: 46
file content (30 lines) | stat: -rw-r--r-- 901 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#! /bin/bash
# .gnome2/nautilus-scripts/word-count

# I, the Copyright holder of this work, hereby release it into the Public
# Domain. This applies worldwide. In case this is not legally possible, I
# grant anyone the right to use this work for any purpose, without any
# conditions, unless such conditions are required by law.
#
# 2009 Timothy Richard Musson <trmusson@gmail.com>

PROG=$(basename $0)

if [ "$1" = '-h' ]; then
  echo "Usage: $PROG FILE..."
  exit 0
fi

XMESSAGE=$(which gxmessage) || XMESSAGE=xmessage

font=monospace
[ "$XMESSAGE" = xmessage ] && font=fixed

[ "$#" -ge 1 ] &&
  wc "$@" 2>&1 | $XMESSAGE ${font:+-fn "$font"}     \
                         -title "$PROG"             \
                         -nearmouse                 \
                         -buttons GTK_STOCK_CLOSE:0 \
                         -default GTK_STOCK_CLOSE   \
                         -file -