LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Question about running a program from terminal window (https://www.linuxquestions.org/questions/linux-newbie-8/question-about-running-a-program-from-terminal-window-387633/)

ganoo 11-29-2005 01:33 PM

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)?

AwesomeMachine 11-29-2005 03:19 PM

If you are using KDE:

alt+F2 cal

ganoo 11-30-2005 10:20 AM

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. :)

ethics 11-30-2005 10:30 AM

I was hoping this was the same as my problem and someone would answer :p

i need to use aterm -e and retain other properties such as transparency, dont suppose yours does?

Emmanuel_uk 11-30-2005 02:19 PM

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

ganoo 12-01-2005 04:00 PM

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). :D

ethics 12-01-2005 06:18 PM

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

EoXz 11-01-2010 12:44 PM

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?


All times are GMT -5. The time now is 02:10 PM.