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

direct commands #1

Open
yetzt opened this issue May 9, 2016 · 9 comments
Open

direct commands #1

yetzt opened this issue May 9, 2016 · 9 comments

Comments

@yetzt
Copy link

yetzt commented May 9, 2016

i'd like to write my commands directly into the configuration instead of "choosing a file". i'd like to simply /usr/bin/say butts without #!/bin/sh and butts.sh. please adjust the interface accordingly.

@AntonMeier
Copy link
Contributor

You have a good point. I will make sure to add support for that in the new version.

@yetzt
Copy link
Author

yetzt commented May 9, 2016

thanks!

@erikvg01
Copy link

I'm not sure how the script is being executed by the flic app on OSx, but it seems that it does not execute nested scripts. I have a script that calls another script conditionally, and the flic trigger seems to never execute the sub script... I cannot replicate the behavior outside of using the flic app.

@AntonMeier
Copy link
Contributor

Interesting, I will take a look at that.

@AntonMeier
Copy link
Contributor

AntonMeier commented May 11, 2016

The nested scripts that you refer to, is it executed related to the path of the main script? If it is then try to run it with an absolute path. I believe all scripts, including nested, will be run relative to the root.

@erikvg01
Copy link

Root is able to execute the script, and it does reside in $PATH on the box. I tested with absolute path, and it still does not work. Mine is likely a corner case, and I have a workaround in place...Now I just need multiple buttons.

@jonathan-dejong
Copy link

jonathan-dejong commented May 13, 2016

I think I have a similar situation..
Just got the flic to work (Thanks @AntonMeier!) and decided to write a tiny shell script to boot up my vagrant enviroment.

vagrantup.sh:

#!/bin/sh
#function to display commands
exe() { echo "\$ $@" ; "$@" ; }
exe echo start vagrant
startdev
exe echo vagrant started

And I have added an alias to .bashrc
alias startdev="cd ~/sites/vvv && vagrant up"

This works when I run the script from terminal (I've put the file in a folder "flic" on user root)
cd flic && . vagrantup.sh

but when I attempt to have flic run it nothing happens. I get a beachball on the actual flic app in the menu bar which tells me it attempts to do something but alas nothing happens and the beachballs disappear after a while.

EDIT: In the systemlog this appears:

2016-05-13 16:09:11,077 HaxWithFlic[14107]: Script return value:
$ echo start vagrant
start vagrant
$ echo vagrant started
vagrant started

which would be right since it's the same as is being echoed to the terminal if I run the script from there. But it seems it just skips the alias.

@AntonMeier
Copy link
Contributor

I don't think alias works outside of bash. Try changing your script so that it does the cd ~/sites/vvv and vagrant up in the shell script directly.

So, instead of using startdevyou can try:

cd ~/sites/vvv
vagrant up

Perhaps you have to do some ./vagrant up or something.. play around with it.

@jonathan-dejong
Copy link

Hmm but cd inside a shell script does not seem to work on its own according to "the internet". That's the reason I created the alias in the first place :)

But I'll try some variations and post back my results (for future devs)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants