LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 11-29-2005, 01:33 PM   #1
ganoo
LQ Newbie
 
Registered: Jan 2005
Posts: 15

Rep: Reputation: 0
Question about running a program from terminal window


I have recently found out that you can invoke a terminal program in aterm by starting it with the "-e" option. For example, I can configure a program launcher (a shortcut or something similar) to start Midnight Commander in aterm by configuring the program launcher to run the command "aterm -e mc". So far so good.

But now I've run into a problem when I'd like the program launcher to start aterm showing me the output for the "cal" command in a similar manner that I can make it start Midnight Commander. When I configure a program launcher to execute "aterm -e cal", this just flashes aterm very quickly and then aterm disappears. Apparently aterm prints the output for the "cal" command and after doing that it immediately exits. So my question is: How should I edit my "aterm -e cal" program launcher so that it starts aterm, runs the "cal" command in aterm and then leaves aterm there enabling me to view the output (the current calendar)?
 
Old 11-29-2005, 03:19 PM   #2
AwesomeMachine
Senior Member
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian jessie/sid; OpenSuSE; Fedora
Posts: 1,591

Rep: Reputation: 162Reputation: 162
If you are using KDE:

alt+F2 cal
 
Old 11-30-2005, 10:20 AM   #3
ganoo
LQ Newbie
 
Registered: Jan 2005
Posts: 15

Original Poster
Rep: Reputation: 0
Thanks for your reply. No, I'm not using KDE. I use Window Maker with fbpanel. This fbpanel has a clock display that you can click with mouse in order to execute a program -- this is the "program launcher" that I mentioned in the previous post. I want fbpanel to launch aterm and show me the current calendar whenever I click fbpanel's clock display with mouse.

I did some research and found the following solution:

1. I created a /bin subdirectory to my home directory.
2. Then I created a file called "cal.sh" into this new directory.
3. Then I made that file to contain the following lines:
Code:
#!/bin/sh
cal; sleep 15
4. Then I made the edited file executable with "chmod +x /home/ganoo/bin/cal.sh"
5. Then I configured fbpanel's program launcher to execute this command:
Code:
aterm -g 22x9+759+576 -e /home/ganoo/bin/cal.sh &
Now I can click fbpanel's clock display with mouse and a small aterm window appears right above fbpanel showing me the current calendar for 15 seconds, after which the aterm window disappears.

Last edited by ganoo; 11-30-2005 at 10:22 AM.
 
Old 11-30-2005, 10:30 AM   #4
ethics
Senior Member
 
Registered: Apr 2005
Location: London
Distribution: Arch - Latest
Posts: 1,522

Rep: Reputation: 45
I was hoping this was the same as my problem and someone would answer

i need to use aterm -e and retain other properties such as transparency, dont suppose yours does?
 
Old 11-30-2005, 02:19 PM   #5
Emmanuel_uk
Senior Member
 
Registered: Nov 2004
Distribution: Mandriva mostly, vector 5.1, tried many.Suse gone from HD because bad Novell/Zinblows agreement
Posts: 1,604

Rep: Reputation: 47
re transparency maybe maybe only, not sure, try to call the script with
. ./nameofscript.sh
instead of just
./nameofscript.sh

I know this keep aliases and much more

xterm -e mc
the windows does not close in mandy.
It might be because of your profile

Look into konsole (with a k) it is interesting as well
 
Old 12-01-2005, 04:00 PM   #6
ganoo
LQ Newbie
 
Registered: Jan 2005
Posts: 15

Original Poster
Rep: Reputation: 0
Quote:
i need to use aterm -e and retain other properties such as transparency, dont suppose yours does?
Yes, it does. I've got these lines in my ~/.Xresources file:
Code:
XTerm*saveLines: 10000
aterm*foreground: gray90
aterm*background: black
aterm*transparent: true
aterm*transpscrollbar:true
aterm*shading: 60
I changed aterm*foreground from white to gray90 simply because this allows aterm to show transparent GNU Midnight Commander if it's invoked with "mc -b" (which I aliased in ~/.bashrc).
 
Old 12-01-2005, 06:18 PM   #7
ethics
Senior Member
 
Registered: Apr 2005
Location: London
Distribution: Arch - Latest
Posts: 1,522

Rep: Reputation: 45
Thanks so much dude, i tried .Xdefaults with that and nada, so tried it in .Xresources, logged out/in and it's all good.

thanks alot
 
Old 11-01-2010, 12:44 PM   #8
EoXz
LQ Newbie
 
Registered: Feb 2005
Location: Netherlands
Distribution: Fedora 13
Posts: 2

Rep: Reputation: 0
Sorry for bumping such an old thread, but I have exactly the same problem and the suggested solution does not work for me. I can't find newer threads about this problem.

I am trying to get a simple calendar to pop up for a few seconds when I press my middle mouse button. I am using Fluxbox v1.1.1.5 on Fedora 13, and this is the code in my Fluxbox' keys-file:
Code:
OnDesktop Mouse2 :ExecCommand aterm -e cal -3
Using the suggested script does not change anything for me, the window appears for a millisecond but closes again. Adding " &" behind the command doesn't help, also when I run the command from terminal. I think it occures with programs that don't need input after the command, because ls does not work either:
Code:
aterm -e ls
while su does work:
Code:
aterm -e su
Ideally I want the window with calendar to be open for as long as I press the middle mouse button, but a timeout of a few seconds would also do.

The temporary solution I found is running Gdeskcal with this time-out script, but I don't like the program and want to use cal.
Can anyone help?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to launch an app in terminal, & keep it running after I close terminal? kornerr Linux - General 7 06-24-2006 05:54 PM
Running a Program in a new Virtual Terminal Johnsernickle Linux - Software 2 07-09-2004 11:50 AM
Scripting question: the width of the terminal window Bebo Programming 13 11-06-2003 04:41 PM
scripting or programming question - running a program ewto Linux - Newbie 2 09-05-2003 11:46 AM
Running program when terminal closed? mikeshn Linux - General 9 11-23-2002 08:00 PM


All times are GMT -5. The time now is 04:13 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration