-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwinmess-usage
executable file
·78 lines (61 loc) · 1.85 KB
/
winmess-usage
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#!/usr/bin/env bash
# 2021-08-27 WinMess inspired by WinGrid-antiX
# Write the usage messege on the screen.
SUMMARY='Prints usage message on screen.'
HELP='Internal script not intended to run separatly.'
declare -A TEXT
TEXT[place_summary]='Place and resize active window to specifired hints.'
TEXT[place_help]=$(
cat <<EOS
Place and resize active window to specifired hints.
The hints are defined in winmess.conf as dictionary keys.
So
winmess-place T
places and resizes active window to
350 0 1100 1000
that can be specifired in $HOME/.config/winmess.conf
EOS
)
TEXT[dim_summary]='Get screen resolutions in pixels.'
TEXT[dim_help]=$(
cat <<EOS
Configuration script in $HOME/.config/winmess.conf must use screen dimentions in pixels.
So winmess-dim shows screen width and hight for convenience.
EOS
)
PROGDIR=${0%/*}
case $PROGNAME in
'' )
PROGNAME='winmess-usage'
PROGVERSION="$($PROGDIR/winmess-version)"
;;
winmess-place )
SUMMARY=${TEXT[place_summary]}
HELP=${TEXT[place_help]}
;;
winmess-dim )
SUMMARY=${TEXT[dim_summary]}
HELP=${TEXT[dim_help]}
;;
esac
SEEALSO='winmess-place, winmess-dim, winmess-version'
SEEALSO=$(echo ${SEEALSO/$PROGNAME/} | tr -d , | tr -s ' ' | sed -e 's/^ //' -e 's/ /, /g')
cat << EOS | fmt
$PROGNAME version $PROGVERSION
$SUMMARY
Usage:
$PROGNAME <MyUsefulHintCategory>
Options:
-h, --help Show this output
Summary:
$HELP
Launching WinMess cripts is normally done using the keyboard via a combined key press.
The combination of keys are assigned by the system window manager and can
be reassigned if desired.
Optional configuration items are available in
$HOME/.config/winmess.conf
Requires:
x11-utils package, wmctrl, xdpyinfo, yad, xwininfo, awk, fmt, sed, tr...
See also:
$SEEALSO
EOS