Schneegans / Fly-Pie

:pie: Fly-Pie is an innovative marking menu written as a GNOME Shell extension.

Home Page:http://schneegans.github.io/news/2021/12/02/flypie10

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ability to run terminal commands?

therealrobster opened this issue · comments

The Motivation

I want to be able to run a terminal command to run an executable file. For example, item that loads terminal and runs ./filename in say /home/user/applications/game/

Maybe it does this already, but I just can't figure it out. Loving Fly-Pie though, thank you for this great work!

You can use the "Launch Application" action. It can be used to execute any shell command! In your case, simply put /home/user/applications/game/filename into the command entry. If it's important that the working directory is /home/user/applications/game/, you could use bash -c "cd /home/user/applications/game/ && ./filename". For more complicated cases you can also create a shell script and execute this script from the action!

Does this solve your issue?

Thank you for this.
Are there any error logs I can use? I used the example as you mentioned and used the following command bash -c "cd /usr/local/bin/ && ./cdconverter.sh" but nothing happens. If I can read a log I could find what the issue is perhaps?

Thanks again

You can use journalctl -f -o cat | grep -E 'flypie|' for debugging!

This will highlight all occurrences of Fly-Pie in the log output. However, i guess that there will be no error message directly from Fly-Pie but rather from the spawned process. So watch the output closely when you activate the action!

Thank you for this. I opened terminal and ran the journalctl commmand.
What was surprising was my script did start outputting into the terminal and then failed (it's a simple script to launch a docker container). My script has a menu asking what you'd like to do. Docker up, docker down, docker build, etc etc.

The error after was :

Could not create transient scope for PID 475684: GDBus.Error:org.freedesktop.DBus.Error.UnixProcessIdUnknown: Process with ID 475684 does not exist.

So the first issue is when run from Fly-Pie the terminal doesn't show up and the second issue is there is no input for me to type when run from an already open container and the third of course is the above error. :-)

I'm probably a fringe case and I don't expect you to put time into it, honestly. I just thought I'd share. I am ok to open a terminal and run my own command, just thought it would be cool to launch it from fly-pie.

I am pretty sure that this can be solved easily. It seems that your script does not like to be run non-interactively. Could you try

gnome-terminal -- bash -c "cd /usr/local/bin/ && ./cdconverter.sh"

to run it in a terminal?

BAM! That works :-)

OK so it was more my lack of knowledge and not a bug at all. I VERY much appreciate you helping though.
Now I know how to do that, I have a lot of scripts I use regularly that I can now attach to Fly-Pie.

Thanks again!