termux-packages icon indicating copy to clipboard operation
termux-packages copied to clipboard

[Package]: lingmo-manager

Open quiverwing-personal opened this issue 6 months ago • 0 comments

Why is it worth to add this package?

lingmo-filemanager is a GUI-related successor of (filemanager) that remain a CutefishOS' design despite people fork a filemanager without commit (see (zhan92's filemanager).

It provide command without a name filemanager (and insulates). lingmo-filemanager is depend on a dependencies required by its language-related files, qml-formatted files, etc. Itself Inducing three of its dependencies.

Home page URL

https://wiki.lingmo.org/wiki/lingmo-filemanager#lingmo-filemanager

Source code URL

https://www.github.com/LingmoOS/lingmo-filemanager/archive/refs/tags/1.7.0.tar.gz

Packaging policy acknowledgement

  • [x] The project is actively developed.

  • [x] The project has existing packages and is "well known".

  • [x] Licensed under an open source license.

  • [x] Not available through a language package manager: pip, npm, cpan, cargo, etc.

  • [ ] Not taking up too much disk space (< 100MiB per architecture, exceptions can be made)

  • [ ] Not duplicating the functionality of existing packages.

  • [x] Not serving hacking, malware, phishing, spamming, spying, ddos functionality.

  • [x] I certify that I have read Termux Packaging Policy and understand that my request will be denied if it is found lacking.

Additional information

lingmo-manager.sh.

#!/data/data/com.termux/files/usr/bin/bash --posix

INPUT="${@:1}"

CMDS_NAME="$0"
VERSION=$($PREFIX/libexec/lingmo/lingmo-filemanager --version)
shopt -s expand_aliases

function determine_file () {
        local INPUT_THEN="$1"
        local SECOND_INPUT_THEN="$2"

        [[ -n ${INPUT_THEN+xxx} || -n ${SECOND_INPUT_THEN+xxx} ]] || (
             printf "@SHELL@: @CMDS_NAME@: %s\r\n" "An input that is not \"---\" is required by determine_file for determing your favourite file." | \
                   sed -E -r --unbuffered \
                         -e "s|@SHELL@*|$SHELL|" \
                         -e "s|@CMDS_NAME@*|$CMDS_NAME|"
             exit 1
        )

        [[ $INPUT_THEN == "--" ]] || (
             TARGET_FOR_FILE="$INPUT_THEN"
        )

        [[ -z ${SECOND_INPUT_THEN+xxx} ]] || (
             TARGET_FOR_FILE="$SECOND_INPUT_THEN"
        )

        [[ ! -d $TARGET_FOR_FILE ]] || (
             printf "@SHELL@: @CMDS_NAME@: %s\r\n" "@TARGET_FOR_FILE@ is directory. Obtaining sames and omitting @TARGET_FOR_FILE@." | \
                   sed -E -r --unbuffered \
                         -e "s|@SHELL@*|$SHELL|" \
                         -e "s|@CMDS_NAME@*|$CMDS_NAME|" \
                         -e "s|@TARGET_FOR_FILE@*|$TARGET_FOR_FILE|"
             exit 2
        )

        [[ -f $TARGET_FOR_FILE ]] || (
             printf "@SHELL@: @CMDS_NAME@: %s\r\n" "@TARGET_FOR_FILE is such not founded, not file or not recognized." | \
                   sed -E -r --unbuffered \
                         -e "s|@SHELL@*|$SHELL|" \
                         -e "s|@CMDS_NAME@*|$CMDS_NAME|" \
                         -e "s|@TARGET_FOR_FILE@*|$TARGET_FOR_FILE|"
             exit 2
        )
}

function _lingmo-manager () {
        local JUST_INPUT_THEN="${@:1}"

        determine_file $PREFIX/libexec/lingmo/lingmo-filemanager || exit 2
        determine_file $PREFIX/bin/grep || exit 2

        determine_file $HOME/.lingmo-manager || {
            touch $HOME/.lingmo-manager || (
                 rm -r \
                    --force \
                    $HOME/.lingmo-manager
                 touch $HOME/.lingmo-manager
            )
        }

        # "-f" method is same as / used over function-related method for determing if "~/.lingmo-manager" is directory, not found or not recognized.
        # "until" is excepted to store a functions from "_lingmo-manager" (not function) or "_lingmo-manager.sh".
        until [[ ! -f $HOME/.lingmo-manager ]]; do
                  [[ -n $(ps -c -a -x -t | grep -E -i "usr/libexec/lingmo/lingmo-filemanager") ]] || (
                       $PREFIX/libexec/lingmo/lingmo-filemanager $JUST_INPUT_THEN 1>&2 3>&2
                  )
        done

        determine_file $HOME/.lingmo-manager || killall -9 lingmo-filemanager
}

complete -r -F determine_file file
alias lingmo-manager="_lingmo-manager"
lingmo-manager $INPUT

If you want include a script lingmo-manager.sh as a command or script lingmo-manager and provide lingmo-filemanager to <"/" or "/data/data/<identify applications package (e.g. 'bin.mt.plus')/">(/)libexec/lingmo/, create a function for build.sh.

function determine_file () {
        local INPUT_THEN="$1"
        local SECOND_INPUT_THEN="$2"

        [[ -n ${INPUT_THEN+xxx} || -n ${SECOND_INPUT_THEN+xxx} ]] || (
             termux-error-exit "@SHELL@: @CMDS_NAME@: %s\r\n" "An input that is not \"---\" is required by determine_file for determing your favourite file." | \
                   sed -E -r --unbuffered \
                         -e "s|@SHELL@*|$SHELL|" \
                         -e "s|@CMDS_NAME@*|$CMDS_NAME|"
        )

        [[ $INPUT_THEN == "--" ]] || (
             TARGET_FOR_FILE="$INPUT_THEN"
        )

        [[ -z ${SECOND_INPUT_THEN+xxx} ]] || (
             TARGET_FOR_FILE="$SECOND_INPUT_THEN"
        )

        [[ ! -d $TARGET_FOR_FILE ]] || (
             termux-error-exit "@SHELL@: @CMDS_NAME@: %s\r\n" "@TARGET_FOR_FILE@ is directory. Obtaining sames and omitting @TARGET_FOR_FILE@." | \
                   sed -E -r --unbuffered \
                         -e "s|@SHELL@*|$SHELL|" \
                         -e "s|@CMDS_NAME@*|$CMDS_NAME|" \
                         -e "s|@TARGET_FOR_FILE@*|$TARGET_FOR_FILE|"
        )

        [[ -f $TARGET_FOR_FILE ]] || (
             termux-error-exit "@SHELL@: @CMDS_NAME@: %s\r\n" "@TARGET_FOR_FILE is such not founded, not file or not recognized." | \
                   sed -E -r --unbuffered \
                         -e "s|@SHELL@*|$SHELL|" \
                         -e "s|@CMDS_NAME@*|$CMDS_NAME|" \
                         -e "s|@TARGET_FOR_FILE@*|$TARGET_FOR_FILE|"
        )
}

With this/our function, write these in lines between termux_step_post_make_install() { and } section after termux_step_post_make_install (and before a next function (e.g. termux_step_post_massage)).

   determine_file "<directories inducing sources code from 'lingmo-filemanager'>/lingmo-filemanager" || termux-error-exit ""
   install -D --mode=775 -Z <directories inducing sources code from 'lingmo-filemanager'>/lingmo-filemanager $PREFIX/libexec/lingmo/
   install -D --mode=775 -Z <specific directories>/lingmo-manager.sh <$TERMUX_PREFIX or $PREFIX>/bin/lingmo-manager

*If a process of this/our LingmoOS-related issue I posted suspend a #13824 (issue), its recommended to package a lingmo-desktop instead of component from lingmo-desktop.

quiverwing-personal avatar Jun 06 '25 13:06 quiverwing-personal