You are not logged in.
Hi there guys!
I need to open a terminal window(that needs to stay open" and run a command in it to start a game server. I keep getting the error "Unable to find shell" when I try it, however.
<item label="Start Local Server">
<action name="Execute">
<command>
<command>x-terminal-emulator -T 'Local FiveM Server' -e "cd /home/schwim/fivem/server-data && ../server/run.sh +exec server.cfg"</command>
</command>
</action>
</item>
I'm not sure what I'm doing wrong. Could someone straighten me out?
Thanks for your time!
Last edited by schwim (2018-10-29 02:14:33)
Schw.im! A social site with an identity crisis.
Offline
You need to start a shell in x-terminal-emulator first, before shell commands will run. The general format is
x-terminal-emulator -e /bin/bash -c "<your command here>;bash"
The trailing "bash" keeps the terminal open, and you would need to escape any quotes in your commands.
Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt «» BunsenLabs on DeviantArt
Offline
Thanks for the help, Damo!
I tried but my double ampersand isn't registering, causing bash to think the whole line is the cd command. How do I tell it that there are two separate commands?
x-terminal-emulator -e /bin/bash -c "\"cd /home/schwim/fivem/server-data && ../server/run.sh +exec server.cfg\";bash"
Schw.im! A social site with an identity crisis.
Offline
I think you might have too much quoting there. Try:
x-terminal-emulator -e /bin/bash -c "cd /home/schwim/fivem/server-data && ../server/run.sh +exec server.cfg;bash"
...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )
Online
Hmm, with that in place, it just opens a terminal and no command prints to screen at all.
x-terminal-emulator -e /bin/bash -c "cd /home/schwim/fivem/server-data && ../server/run.sh +exec server.cfg;bash"
Schw.im! A social site with an identity crisis.
Offline
With multiple commands I put them in a script, then call that in menu.xml. That way you don't need to worry about escaping characters etc.
Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt «» BunsenLabs on DeviantArt
Offline
openbox' xml files do not like '&'.
i'm surprised you didn't get any errors after reconfiguring.
they need to be escaped like this: '&'
here's an example of a fairly complex chain of commands that works in rc.xml:
<command>
dash -c 'wmctrl -l | grep -F "$(printf "0x%08x" "$(xdotool getwindowfocus)")" | grep Geany && sleep 0.1 && xdotool keyup Super_L Super_R key Alt_L+d t'
</command>
but it's definitely safer to simply put it in a script and call that instead.
Offline
^A bonus of using a script is that you don't need to reconfigure openbox every time you change something.
...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )
Online
Thank you all so much for your help. I just didn't think to use a script to handle this. It worked fantastically.
Thanks again!
Schw.im! A social site with an identity crisis.
Offline