8000 Add `on-init` hook command by joelim-work · Pull Request #1838 · gokcehan/lf · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add on-init hook command #1838

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 6, 2024
Merged

Conversation

joelim-work
Copy link
Collaborator

See #1767 (reply in thread) for more details.

If autoquit is enabled, then running lf -remote commands immediately in the config file will fail as the server hasn't started yet. This change adds an on-init hook command, for anything that should run after lf has finished initializing and connecting to the server.

set autoquit true
set drawbox true

cmd on-redraw &{{
    if [ "$lf_width" -le 80 ]; then
        lf -remote "send $id set ratios 1:2"
    elif [ "$lf_width" -le 160 ]; then
        lf -remote "send $id set ratios 1:2:3"
    else
        lf -remote "send $id set ratios 1:2:3:5"
    fi
}}

cmd on-init on-redraw

# the following will not work if used instead of `on-init`
# on-redraw

@joelim-work joelim-work merged commit 670343a into gokcehan:master Nov 6, 2024
4 checks passed
@joelim-work joelim-work deleted the on-init branch November 6, 2024 01:12
@joelim-work joelim-work added the new Pull requests that add new behavior label Nov 6, 2024
@joelim-work joelim-work added this to the r34 milestone Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new Pull requests that add new behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant
0