-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathREADME
148 lines (104 loc) · 5.45 KB
/
README
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
Taverner <https://raw.github.com/Earnestly/taverner>
INTRODUCTION
Taverner is a small collection of shell scripts (read: 2) designed
to generate and maintain a bunch of game launchers (or anything else
really). It uses a modified {dmenu}[dmenu] for creating list of entries
along with a nice cover image and an accompanying tool to make creating
these entries a bit more convenient.
Screenshot: <https://raw.github.com/Earnestly/taverner/master/scrot.png>
REQUIRES
- bash 4.2+
- graphicsmagick
- dmenu-pango-imlib <https://github.com/Cloudef/dmenu-pango-imlib>
INSTALL
I keep my local binaries in LOCALDIR/bin:
make PREFIX="$LOCALDIR" install
Optionally you can add the launch script's directory to PATH:
export PATH="$PATH:${LOCALDIR-$HOME/local}/data/taverner/bin"
WHAT & HOW
Briefly, a typical session may look like this
% barkeep -h
Usage: barkeep [-h] [mk | ls | ed | rm]
Each mode has an -h flag which produces a summary of its help section.
-e Preferred editor, uses $EDITOR if not set.
Create a new menu entry. Uses $EDITOR to complete the new entry.
mk [-c <cover>] -t <template> <entry>
-t Select a template to base the new entry on.
-c Path or url to a cover image. (Note: This is destructive)
entry The name for the new launcher script.
List entries and templates.
ls [-t]
-t List all available templates.
If no arguments given this will list all entries.
Edit the selected entry or template. Only one entry may be edited per
invocation.
ed [-t <template>] [-c <cover>] [entry]
-t Attempts to open the template with $EDITOR.
-c Replace the cover for entry, note that the entry is required
for this operation.
entry Attempts to open the entry with $EDITOR.
Issue: If -c is specified for an entry, it will both update the entries
cover image but also offer to edit the entry as well.
Remove selected entries and corresponding covers. If no argument given,
attempt to remove all entires.
rm [entry [entry]]
entry The chosen entry to remove.
Examples:
# Creates an entry using the psx template called wipeout_3 using emacs
# as the editor.
barkeep mk -e emacs -t psx -c ~/wipeout.png wipeout_3
# Removes both wipeout_3 and crash_bandicoot launchers along with any
# cover images if found.
barkeep rm wipeout_3 crash_bandicoot
% barkeep ls -t
ppsspp
wine
% barkeep mk wipeout_pulse -t ppsspp -c ~/wipeout_pulse_cover.jpg
‘/home/earnest/wipeout_pure_cover.jpg’ -> ‘/home/earnest/local/data/taverner/covers/wipeout_pure’
‘/home/earnest/local/data/taverner/templates/ppsspp’ -> ‘/home/earnest/local/data/taverner/bin/wipeout_pure’
At this point you'll get prompted with your editor to make any changes
to the template such as specifying what to execute, and where the data
files are located. Here is an example template with places left for you
to fill in:
#!/bin/bash
# Title: Wipeout Pure (PSP 2005)
exec ppsspp --fullscreen "$LOCALDIR"/data/games/psp/wipeout_pure.iso
Here the title is read and passed to dmenu, if "# Title:" isn't present,
taverner will fallback on the file name of the launch script.
After editing the template, run taverner.
WHY
I wanted to turn an old machine into a game box that could play various
emulated games on the SNES, PSX, PSP and some older ones via WINE while
unifying the UI. Many existing solutions were quite sophisticated,
beautiful but complex graphical frontends, usually existing to serve a
specific set of emulators.
Since the machine I was planning to use is quite limited in terms of
hardware I wanted something simple (and not very clever) which did as
little as possible and with enough flexibility for anything I might
conceivably throw at it.
As Cloudef <https://github.com/Cloudef> had been working on providing
extra functionality for dmenu which allows me to embed images based on
the entry selected, I decided that would be perfect to list a bunch of
games including any cover art.
Initially I simply wrote a few lines of shell that passed a handwritten
list to dmenu which launched a second script that contained all the
logic necessary for starting the program. Eventually this manual
insertion and deletion of list entries became inconvenient which
resulted in the creation of the `taverner` script that generates menus
on the fly.
Now that was reasonably well solved, I still had the issue of manually
writing the launcher scripts and setting up the cover image along with
other potential tweaks. This is where `barkeep` comes in, it exists
simply to aid me in creating the launchers, copying over templates and
letting me just add any necessary tweaks.
COLOPHON
The barkeep script can only read the Title if the launcher is text, this
could be changed with a better design but for now it means all launchers
must be text files if the Title is needed.
Taverner makes use of a personal convention called "LOCALDIR", it
behaves like the DESTDIR convention from makefiles and supplants the XDG
Base Directory Specification.
Under LOCALDIR a familiar hierarchy to the FHS is found with a few
changes.
See <https://github.com/Earnestly/dotfiles/blob/master/README> for some
more information.