Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Fri 28 Nov 2014, 10:39
All times are UTC - 4
 Forum index » House Training » Users ( For the regulars )
Setting RoxTerm as default Terminal
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [8 Posts]  
Author Message
slavvo67

Joined: 12 Oct 2012
Posts: 456
Location: The other Mr. 305

PostPosted: Fri 19 Sep 2014, 18:44    Post subject:  Setting RoxTerm as default Terminal  

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?
Back to top
View user's profile Send private message 
Puppus Dogfellow


Joined: 07 Jan 2013
Posts: 659
Location: nyc

PostPosted: Fri 19 Sep 2014, 19:09    Post subject: Re: Setting RoxTerm as default Terminal  

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:

#!/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.
Back to top
View user's profile Send private message 
MochiMoppel


Joined: 26 Jan 2011
Posts: 479
Location: Japan

PostPosted: Fri 19 Sep 2014, 23:34    Post subject: Re: Setting RoxTerm as default Terminal  

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.
Back to top
View user's profile Send private message 
slavvo67

Joined: 12 Oct 2012
Posts: 456
Location: The other Mr. 305

PostPosted: Sat 20 Sep 2014, 02:41    Post subject:  

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
Back to top
View user's profile Send private message 
MochiMoppel


Joined: 26 Jan 2011
Posts: 479
Location: Japan

PostPosted: Sat 20 Sep 2014, 03:42    Post subject:  

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:
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 Laughing 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.
Back to top
View user's profile Send private message 
slavvo67

Joined: 12 Oct 2012
Posts: 456
Location: The other Mr. 305

PostPosted: Sat 20 Sep 2014, 13:22    Post subject:  

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
Back to top
View user's profile Send private message 
MochiMoppel


Joined: 26 Jan 2011
Posts: 479
Location: Japan

PostPosted: Sat 20 Sep 2014, 21:56    Post subject:  

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.
Quote:
and you must use the / before your first directory.
Embarassed Sorry.
Back to top
View user's profile Send private message 
slavvo67

Joined: 12 Oct 2012
Posts: 456
Location: The other Mr. 305

PostPosted: Sun 21 Sep 2014, 12:14    Post subject:  

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.
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [8 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » Users ( For the regulars )
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0665s ][ Queries: 11 (0.0066s) ][ GZIP on ]