Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save kopiro/a61255dc320cdfc9efb61d26b0f65ed3 to your computer and use it in GitHub Desktop.
Save kopiro/a61255dc320cdfc9efb61d26b0f65ed3 to your computer and use it in GitHub Desktop.

Revisions

  1. kopiro created this gist Oct 28, 2022.
    19 changes: 19 additions & 0 deletions var-lib-webosbrew-init.d-50-custom-screensavef
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,19 @@
    #!/bin/sh

    set -e -o pipefail

    MOUNT_TARGET="/usr/palm/applications/com.webos.app.screensaver/qml/main.qml"
    QML_PATH="$(dirname "$(realpath "$0")")/screensaver-main.qml"

    if [[ ! -f "$MOUNT_TARGET" ]]; then
    echo "[-] Target file does not exist: $MOUNT_TARGET" >&2
    exit 1
    fi

    # umount "$MOUNT_TARGET"
    if ! findmnt "$MOUNT_TARGET"; then
    mount --bind "$QML_PATH" "$MOUNT_TARGET"
    echo "[+] Enabled succesfully" >&2
    else
    echo "[~] Enabled already" >&2
    fi