Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Linux


Ubuntu :: Bash For Programs Running In Terminal?

Trying to write a script for desktop launchers that are adaptable to screen resolution. Ideally, the program should:

1. Determine screen resolution:

if "a" use xdotool options window size 1305 x 869 px and move to 135,0
if "b" use xdotool options window size 1545 x 1019 px and move to 135,0

2. Check if program running:

if no, open program, and use "a" or "b" placement options, focus window
if yes, focus window

3. Close script and leave program open (if possible).

Problems arise when trying to use the script on programs that run from and hog the terminal
(e.g. brasero, gcalctool, nautilus)

Here the script will load the program, and nothing else (probably because it still occupies the terminal as it runs)


gcalctool && xdotool search "calculator" windowmove 135 0

This next command will cause the program to load, move, but it keeps focusing itself like xdotool is running the windowmove function constantly - it keeps focusing itself until script stopped.


gcalctool & xdotool search "calculator" windowmove 135 0

This had the same effect as the above code, but seems to work as a conditional subscript running when the process is running in the terminal - it just goes infinitely.


while [1] ; do xdotool search "calculator" windowmove 135 0 done exit

Is there some kind of "if, then" or "while, do" or some kind of conditional I can put in to the script ensure the window is moved only once if the program is running within the terminal? Is there a way to remove the program from the terminal from the script once it's been called?

View 5 Replies (Posted: August 9th, 2011)

Sponsored Links:

Related Forum Messages For Linux category:
Ubuntu :: Compiling And Running Some C++ Programs (with G++ From The Terminal)?
so i've just been sitting here, compiling and running some c++ programs (with g++ from the terminal), I looked away for one minute to open a file that had just been written out (opened it with gedit if that makes a difference), now my terminal says:kbuildsyscoca4 I'm wondering if anyone knows what this is about?hy it suddenly started running and why it has appeared on my terminal. I'm basically just curious as I though bash shells were entirely separate virtualizations of shells, and unrepresentative of other processes. i'm also wondering what kbuildsyscoca4 is/does (i've got gnome going on and generally gnome varieties of programs). I found a post from about a year ago mentioning the same thing, though no replies.

Posted: June 7th, 2011

View 1 Replies!   View Related
Ubuntu :: Bash: Determine If Running In Terminal?
I'm writing a bash script to move files around based on various bits of metadata. For a few reasons, this script will be run regularly both from the terminal, and from the nautilus-scripts folder ("graphically", if you will). What I'm stumped on is having the script defer outputs based on which mode the script is running in. For example, how can I have the script know whether to echo error statements, or pump them out to zenity based on the method of invocation?

Posted: July 10th, 2010

View 2 Replies!   View Related
Ubuntu :: Short Key To Command Histroy In Terminal Running Bash?
In windows command prompt, F8 key can cycle through your previously entered commands i.e say you enter "ping" and then "pushd <dir>". Next when you type p and then press F8 brings pushd and next F8 brings ping command. You can then hit enter to execute the corresponding command i.e ping in this case.Is there anything similar in Ubuntu Terminal running bash? Very handy to get back previously entered commands.

Posted: January 20th, 2011

View 3 Replies!   View Related
General :: Make A Bash Script Keep Running In Same Terminal After It Calls Second Script?
I have a startup script for jboss ( that sets some JAVA_OPTS and then calls bash I run it ( from the command line it runs in the terminal fine. If I make a shortcut launcher for it in gnome and set it for 'application in terminal' it pops up then immediately dies after launch.Not sure what the problem is. Is this not working because one script is calling a second script? But then why does it work when I call ./

Posted: 06-25-2010, 12:22 AM

View 4 Replies!   View Related
General :: Run Programs From System Terminal Without Blocking Terminal?
Right now when I start a program from a terminal I can't use that terminal instance again until I close the program.

I am a new user of linux, and I want to know if there is a way to execute a program/application from a terminal without blocking the terminal until the program ends.

Posted: Jun 19 10 at 16:52

View 3 Replies!   View Related
Ubuntu :: Bash Broken, Lost Functionality In Terminal (gnome-terminal)?
Linux-goers. I did some research on this, but I am still fairly new to Linux. In Ubuntu 10.10 (Maverick), I accidentally overwrote my "/bin/bash" file. Dude, using "sudo" with a small typo can work disasters. Bash is now broken in the Terminal (gnome-terminal). Terminal itself still works fine, technically, but bash is still hosed/broken. Here is what I did to try to fix it: Booted from Ubuntu 10.10 live CD. Mounted my Ubuntu partition and manually copied the good/fresh "bash" file onto my hard drive. Verified copy was successful. Didn't help, as you see. Reinstalled "gnome-terminal" using synaptic package manager. Tried to reinstall bash via synaptic, it failed with error, "E: /var/cache/apt/archives/bash_4.1-2ubuntu4_i386.deb: subprocess new pre-removal script returned error exit status 2"

In Terminal, all basic commands work as far as I can tell. ("ls", "pwd", navigation, etc.) Here are some problems:My "username@computername" does not display in the prompt; only the $ sign. Bash keyboard shortcuts such as uparrow and tab do not work. Instead, each inserts a key code. I can't even move the cursor left/right. Aliases (a function of bash and .bashrc) are broken, of course. My sanity level decreases when I use Terminal now. For what it's worth, even with "sudo" I get a "permission denied" error when trying to run Google Chrome! I read something about a ".bashrc" file being a possible problem, but I don't know how to make it work, or the file's proper locations in Ubuntu 10.10. Is there something I can do with a "make" or "apt-get install" command or something?? Could this simply be a permissions problem? Is the link to "/bin/bash", "/bin/sh", or a ".bashrc" file broken? Guide me, oh Linux gurus.

P.S. I always wondered what exactly bash was and how it was different from the basic terminal. LoL, this is an excellent way to demonstrate the difference, and I WANT IT BACK!

Posted: December 10th, 2010

View 9 Replies!   View Related
Ubuntu :: Terminal Bash / -bash: Ls: Command Not Found
I got a problem with terminal, since i'm really a noob with terminal i don't know how to fix it.Everytime i type in a command it shows for example:

-bash: ls: command not found

Even the basic commands don't work... just cd <directory> and those things works

Posted: June 5th, 2011

View 9 Replies!   View Related
General :: Running Bash But Common Bash Commands Not Working?
below are the details of my system. I have bash as my current shell, some really common commands aren't working.

Do I need to do a re-installation of bash? Or how do I install a selection of bash commands which I need? (for example a subset of [URL])

root@sdptfw:~ # uname -a
Linux 2.4.36 #1 Tue Jul 22 13:13:24 GMT 2008 i686 i686 i386 GNU/Linux
root@sdptfw:~ # echo $SHELL$


Posted: 07-17-2010, 03:43 AM

View 13 Replies!   View Related
General :: Why Does Running A Program In Bash Work, When Running It In The Menu Doesn't?
I presume there is something in the JWM window manager - or Puppy Linux Lupu 5.01 itself that is conflicting with the normal loading of GMPLAYER....

I would like to know how to troubleshoot, and fix this problem if possible (even a workaround would be great).

Posted: Jul 26 10 at 6:47

View 1 Replies!   View Related
Software :: Terminal For Running VB Scripts (a SecureCRT Like Terminal)?
I would like to hear about a (telnet) terminal for Linux that can run VB scripts. The need is for configuration of a target board. I like secureCRT very much, but I can not use it from a Linux workstation.

Posted: 04-05-2011, 10:19 AM

View 4 Replies!   View Related
Ubuntu :: Where Are Programs Download With Apt-get In Terminal
I have just installed qBittorrent with terminal with apt-get but I do not know where I can find it besides the Launcher and the panel on the top of the screen.

Posted: 4 Weeks Ago

View 9 Replies!   View Related
Ubuntu :: Run GUI Programs From Terminal Correctly?
I can't figure this out. If i run GUI program (in GNOME) from terminal. It doesn't works the same as if i run it from menus (or shortcut on desktop or panel). Or some times I run it from Alt+F2 method.

What is the difference in this methods?

For example what is the difference if i put this...

metacity --replace terminal or in ALT+F2 dialog window. If I put it in terminal. GNOME doesn't work correctly. If i put it in Alt+F2 dialog window. It works as it should. With no problems.

And what is the difference if i like to run for example FireFox or gnome-control-center from terminal or select it from menus.

If i like to run from terminal. What would be right way to do it?

Because sometimes i get errors in terminal (but GUI works) sometimes after i close terminal GUI program closes to. Sometimes it doesn't. But if i run that program from menus (icons) there is no such problem. It just works. If i put & at the end of program. I can work in terminal. But still all of the above is still true.

Posted: August 3rd, 2010

View 3 Replies!   View Related
Ubuntu :: Auto Start Programs In Terminal?
I am setting up a streaming audio server. I would like to have Darkice and sc_serv (Shoutcast server) start automagically on boot.

I have set Xubuntu (10.04) to auto login

Both Darkice and sc_serv are command line apps and I would like them to each run in their own terminal window so I can monitor any status messages they produce. For instance sc_serv displays connections disconnections with time connected, and current number of listeners, and I want to see that.

One important note: sc_serv must be up and running before Darkice can be started.

Posted: September 18th, 2010

View 1 Replies!   View Related
Ubuntu :: Removing Start Up Programs In Terminal?
I recently learned how to add start up programs in the terminal using the following command:

ln /usr/bin/whateverprogram ~/.kde/Autostart

This worked, but now I want to remove some start up programs using the command line. Can someone point me in the right direction to what I need to do for this?

I'm assuming that default start up programs are not links in the ~/.kde/Autostart folder because when I run:

ls -a ~/.kde/Autostart
I only find the files that I have set to start up.

Posted: March 11th, 2010

View 3 Replies!   View Related
Ubuntu Installation :: Install Programs And Use Them By Using The Terminal?
How can i install programs using the terminal and how can i use programs by using the terminal?

Posted: June 25th, 2011

View 3 Replies!   View Related
Ubuntu :: Terminal: Run Programs As Separate Process?
I want to run programs from Terminal as a separate process, so that for example gedit file

will launch gedit and return to the terminal prompt (so no need to open up another terminal).

Posted: July 11th, 2011

View 8 Replies!   View Related
Ubuntu :: Finding Names Of Programs To Use In Terminal?
I would like to know how to find out the name of programs so that I could launch them in Terminal. For example, to launch gimp, I just type

Code:gimp and it launches. Well how do I find out other names to other programs?

Posted: October 30th, 2010

View 2 Replies!   View Related
Slackware :: If Close Terminal Ran Bash Script Inside / Bash Script Stops
I've noticed something, and hoped there was a work around.when I write a simple bash script, and run it, if I close the terminal i ran the bash script inside, the bash script stops. What are the solutions for this? Basically I want to run my bash script and close the terminal, keep the bash script running.

Posted: 04-28-2011, 05:30 PM

View 6 Replies!   View Related
Ubuntu :: KDE Programs Running Under Gnome?
Are there potential compatibility problems if a KDE program is installed and run under Gnome in the standard Ubuntu Desktop 10.10? If two programs with the same functions are available, is it better to select the Gnome version?

Posted: February 15th, 2011

View 3 Replies!   View Related
Ubuntu :: Running Programs After ISO Mount
My problems is that after i've DL a program and then use unrar to open up the files...I was able to successfully mount a linux version game using Furious ISO mount (the game is Civilization call to power loki) Now I can see the files inside the folder but I can't figure out how to run the game after its mounted

I've looked around a lil bit and I know someone has probably asked this question before but most of what i find is people asking how to mount the image to begin with

Posted: April 8th, 2010

View 5 Replies!   View Related
Ubuntu :: Running Programs From Windows?
I have a dual boot system, Windows 7 and a WUBI installed Ubuntu 10.04, both are 64 bit. Can I use Wine to run a program installed on the Windows partition? If so is there anything special I need to do? My Ubuntu partition is really small and I:d like to keep it that way.

Posted: July 3rd, 2010

View 3 Replies!   View Related
Fedora :: Installing The Programs With Terminal?
Installing the programs with terminal?

Posted: 23rd July 2010, 02:46 AM

View 6 Replies!   View Related
Fedora :: Can Install Programs Other Than Using The Terminal
How can we install programs other than using the terminal. To be honest, I liked this system and I got used to it, but the problem is someone who wants to use Fedora but has no idea on how to use the terminal, so is there any other way for installing programs?

Posted: 21st October 2009, 11:17 AM

View 8 Replies!   View Related
Programming :: Bash: Passing Output To Another Programs Input?
I am not sure if that Subject really explains it, basically I have a script that executes a CLI java-applet that requires a passphrase from the user. I can easily execute this by issuing the -p argument followed by the passphrase however that shows up on possible logs or at least on the results of the ' ps ' command. If you do not supply this -p argument it provides a new line with the echo " Enter Passphrase: " and asks for input.

how can I provide a result/input for the Passphrase request and is it still possible to throw this application in the background with the ' & ' following the command? I have seen a few examples that show a /bin/expect that expects a result and sends a command however I would like to refrain from any extra dependencies. Example of Regular Execution of application:


$ /usr/local/***/**** -u USERNAME -r Default-Realm -f certificate.der

Posted: 11-12-2009, 05:02 PM

View 6 Replies!   View Related
Copyright 2005-08, All rights reserved