|
2 | 2 |
|
3 | 3 | export LC_ALL="en_US.UTF-8" |
4 | 4 |
|
5 | | -UNPACK_DIR='/mnt/us' |
| 5 | +if [ ! -n "${UNPACK_DIR+x}" ]; then |
| 6 | + UNPACK_DIR='/mnt/us' |
| 7 | +fi |
6 | 8 | # KOReader's working directory. |
7 | 9 | KOREADER_DIR="${UNPACK_DIR}/koreader" |
8 | 10 |
|
@@ -260,9 +262,9 @@ if [ "${STOP_FRAMEWORK}" = "no" ] && [ "${INIT_TYPE}" = "upstart" ]; then |
260 | 262 | # FIXME: There's apparently a nasty side-effect on FW >= 5.12.4 which somehow softlocks the UI on exit (despite wmctrl succeeding). Don't have the HW to investigate, so, just drop it. (#6117) |
261 | 263 | if [ "$(version "${FW_VERSION}")" -lt "$(version "5.12.4")" ]; then |
262 | 264 | logmsg "Hiding the title bar . . ." |
263 | | - TITLEBAR_GEOMETRY="$(${KOREADER_DIR}/wmctrl -l -G | grep ":titleBar_ID:" | awk '{print $2,$3,$4,$5,$6}' OFS=',')" |
264 | | - ${KOREADER_DIR}/wmctrl -r ":titleBar_ID:" -e "${TITLEBAR_GEOMETRY%,*},1" |
265 | | - logmsg "Title bar geometry: '${TITLEBAR_GEOMETRY}' -> '$(${KOREADER_DIR}/wmctrl -l -G | grep ":titleBar_ID:" | awk '{print $2,$3,$4,$5,$6}' OFS=',')'" |
| 265 | + TITLEBAR_GEOMETRY="$("${KOREADER_DIR}/wmctrl" -l -G | grep ":titleBar_ID:" | awk '{print $2,$3,$4,$5,$6}' OFS=',')" |
| 266 | + "${KOREADER_DIR}/wmctrl" -r ":titleBar_ID:" -e "${TITLEBAR_GEOMETRY%,*},1" |
| 267 | + logmsg "Title bar geometry: '${TITLEBAR_GEOMETRY}' -> '$("${KOREADER_DIR}/wmctrl" -l -G | grep ":titleBar_ID:" | awk '{print $2,$3,$4,$5,$6}' OFS=',')'" |
266 | 268 | USED_WMCTRL="yes" |
267 | 269 | fi |
268 | 270 | if [ "${FROM_KUAL}" = "yes" ]; then |
@@ -396,17 +398,17 @@ if [ "${STOP_FRAMEWORK}" = "no" ] && [ "${INIT_TYPE}" = "upstart" ]; then |
396 | 398 | # NOTE: Wait and retry for a bit, because apparently there may be timing issues (c.f., #5990)? |
397 | 399 | usleep 250000 |
398 | 400 | WMCTRL_COUNT=0 |
399 | | - until [ "$(${KOREADER_DIR}/wmctrl -l -G | grep ":titleBar_ID:" | awk '{print $2,$3,$4,$5,$6}' OFS=',')" = "${TITLEBAR_GEOMETRY}" ]; do |
| 401 | + until [ "$("${KOREADER_DIR}/wmctrl" -l -G | grep ":titleBar_ID:" | awk '{print $2,$3,$4,$5,$6}' OFS=',')" = "${TITLEBAR_GEOMETRY}" ]; do |
400 | 402 | # Abort after 5s |
401 | 403 | if [ ${WMCTRL_COUNT} -gt 20 ]; then |
402 | 404 | log "Giving up on restoring the title bar geometry!" |
403 | 405 | break |
404 | 406 | fi |
405 | | - ${KOREADER_DIR}/wmctrl -r ":titleBar_ID:" -e "${TITLEBAR_GEOMETRY}" |
| 407 | + "${KOREADER_DIR}/wmctrl" -r ":titleBar_ID:" -e "${TITLEBAR_GEOMETRY}" |
406 | 408 | usleep 250000 |
407 | 409 | WMCTRL_COUNT=$((WMCTRL_COUNT + 1)) |
408 | 410 | done |
409 | | - logmsg "Title bar geometry restored to '$(${KOREADER_DIR}/wmctrl -l -G | grep ":titleBar_ID:" | awk '{print $2,$3,$4,$5,$6}' OFS=',')' (ought to be: '${TITLEBAR_GEOMETRY}') [after ${WMCTRL_COUNT} attempts]" |
| 411 | + logmsg "Title bar geometry restored to '$("${KOREADER_DIR}/wmctrl" -l -G | grep ":titleBar_ID:" | awk '{print $2,$3,$4,$5,$6}' OFS=',')' (ought to be: '${TITLEBAR_GEOMETRY}') [after ${WMCTRL_COUNT} attempts]" |
410 | 412 | fi |
411 | 413 | fi |
412 | 414 |
|
|
0 commit comments