Setting RoxTerm as default Terminal

Using applications, configuring, problems
Post Reply
Message
Author
slavvo67
Posts: 1610
Joined: Sat 13 Oct 2012, 02:07
Location: The other Mr. 305

Setting RoxTerm as default Terminal

#1 Post by slavvo67 »

There are a few items that I prefer running with Roxterm instead of URXVT. How can I set RoxTerm as my default via a script in the Terminal or Bash?

Is there a way to code a script to run in a certain terminal?

User avatar
Puppus Dogfellow
Posts: 1667
Joined: Tue 08 Jan 2013, 01:39
Location: nyc

Re: Setting RoxTerm as default Terminal

#2 Post by Puppus Dogfellow »

slavvo67 wrote:There are a few items that I prefer running with Roxterm instead of URXVT. How can I set RoxTerm as my default via a script in the Terminal or Bash?

Is there a way to code a script to run in a certain terminal?
does

Code: Select all

#!/bin/sh
roxterm -e [script]
work?


don't know how to swap default (right click > set run action gave "you can only do that for regular files" or some similar error message), but i use something similar to the above to run htop in the urxvt (default is rxvt in precise) terminal.

User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

Re: Setting RoxTerm as default Terminal

#3 Post by MochiMoppel »

slavvo67 wrote:Is there a way to code a script to run in a certain terminal?
Not sure what you are trying to achieve. The title says "Setting RoxTerm as default Terminal" but from your explanation I understand that you want to keep URXVT as the default and run ROXTerm only for selected scripts.

How do you start your scripts? If you use desktop shortcuts, you could follow Puppus' advice, if you start them from Geany (F5), you would have to tweak the xterm script, and if you start them by clicking on them in ROX (which by default wouldn't run them in any terminal emulator), you could add file extensions, which would let ROX search for a suitable MIME type and the associated run action.

slavvo67
Posts: 1610
Joined: Sat 13 Oct 2012, 02:07
Location: The other Mr. 305

#4 Post by slavvo67 »

Let me elaborate. I create menu entries for most of my scripts using the Menu Entry Maker pet. It works real nice but it doesn't give me Roxterm as a choice for the default terminal on a specific script. My default is urxvt, which seems to run faster than Roxterm (or is my imagination... which is nice, too). I can open Roxterm and just run direct from terminal but I've been curious about how to have the menu entry default to Roxterm.

I'm actual curious on how to do both. How to set the default to Roxterm for all the scripts or how to default just one or two specific to Roxterm.

Actually better, MIME drives me crazy but maybe adding a file extension for Roxterm would be a neat way to go. How would I set MIME for that?

Thanks again for the input...

Slavvo67

User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

#5 Post by MochiMoppel »

In this case the easiest way is to input the full command into Menu Maker. E.g. to run the script /usr/bin/foo.sh in ROXTerm your input in field "Add App, File,Directory or URL" would be

Code: Select all

roxterm -e "usr/bin/foo.sh"
In "Open with" you have to select "None".

The most elegant way is to hack Menu Entry Maker and add the missing ROXTerm choice. Not difficult to do, but I don't know the version you are using (both Puppy and Menu Maker) and I don't want to suggest something you are not comfortable with.

As for setting an extension for ROXTerm scripts: AFAIK the correct way would be to create a MIME type, define an extension and let Puppy know about it. Complicated and tedious. Not for me :lol: I prefer the unlawful way and would hijack an existing MIME type. There are plenty which you probably would never use. The file /usr/share/mime/globs lists MIME types and extensions and is a good start to look for potential victims. E.g. if you know you'll never come across a Pathetic Writer file (extension PW) , you could add the extension to your script: foo.pw. When you now click on it in ROX-Filer, ROX will know that this is a Pathetic Writer (I love that name) file, but doesn't know what to do with it: "No run action specified.." . Right-click and set a run action only for this type : roxterm -e "$@". ROX will save this run action in the file /root/.config/rox.sourceforge.net/MIME-types/application_x-pw . All your scripts with *.pw extensions will open in ROXTerm.

slavvo67
Posts: 1610
Joined: Sat 13 Oct 2012, 02:07
Location: The other Mr. 305

#6 Post by slavvo67 »

OK. So I got it working one way so far.

In Menu Entry Maker, under Choose App., File, Directory or URL I put exactly the following, where root/my-applications/bin is my directory and websource6.sh is my bash script:

roxterm -e /root/my-applications/bin/websource6.sh

Mochi, thanks for your help. An error occurs if you quote the /root/my-app.... line. No quotes and you must use the / before your first directory. Then it works perfectly.

I'm now trying to update the Menu Entry Maker to have a default in there. For now, the above works perfectly.

Thank you all for your help!

Slavvo67

User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

#7 Post by MochiMoppel »

slavvo67 wrote:An error occurs if you quote the /root/my-app.... line. "
Works for me. I used menumaker-1.1.17. The line was correctly copied to the JWM menu and you will need this syntax when your file names contain spaces. You didn't say which of the 3 applications involved produced the error, so you may want to check again.
and you must use the / before your first directory.
:oops: Sorry.

slavvo67
Posts: 1610
Joined: Sat 13 Oct 2012, 02:07
Location: The other Mr. 305

#8 Post by slavvo67 »

Looks like I'm using 1.1.15. You're correct, though. It works with the quotes, as well. I had something in my script that caused Roxterm to error which I initially thought was due to the quotes. I corrected it and removed the quotes at almost the same time so I thought the quotes were a part of the issue.

The quotes are fine. Thanks.

Post Reply