Skip to content
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

Proper way to exec GUI applications in script mode #87

Closed
mardukbp opened this issue Nov 7, 2014 · 3 comments
Closed

Proper way to exec GUI applications in script mode #87

mardukbp opened this issue Nov 7, 2014 · 3 comments

Comments

@mardukbp
Copy link

mardukbp commented Nov 7, 2014

I want to use rofi to quickly open a PDF file. I am using the following script:

if [ -z "$@" ]
then
    cd ~/Zotero/ && ls 
else
    zathura ~/Zotero/$@
fi

When I select the file, it is opened and I get the rofi prompt again but the keyboard is dead. I can only switch to another tty and kill rofi. I tried sending stdout and stderr to /dev/null and also tried using different PDF viewers. I suspect that I am doing something wrong.

@DaveDavenport
Copy link
Collaborator

zathura keeps running, so rofi has no way of knowing if there is going to be more data coming or not. (e.g. script hasn't finished.)

Something like this works:

    if [ -z "$@" ]
    then
        cd ~/Downloads/ && ls *.pdf
    else
        zathura "~/Downloads/$@" > /dev/null 2>&1 &
    fi

@mardukbp
Copy link
Author

mardukbp commented Nov 7, 2014

Thank you!

@mardukbp mardukbp closed this as completed Nov 7, 2014
@github-actions
Copy link

github-actions bot commented Nov 7, 2020

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 7, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants