Ubuntu :: Bash For Programs Running In Terminal?

Aug 9, 2011

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)

Code:

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.

Code:

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.

Code:

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?

ADVERTISEMENT

Ubuntu :: Compiling And Running Some C++ Programs (with G++ From The Terminal)?

Jun 7, 2011

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 running...so 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.

View 1 Replies View Related

Ubuntu :: Bash: Determine If Running In Terminal?

Jul 10, 2010

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?

View 2 Replies View Related

Ubuntu :: Short Key To Command Histroy In Terminal Running Bash?

Jan 20, 2011

In windows command prompt, F8 key can cycle through your previously entered commands i.e say you enter "ping google.com" 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.

View 3 Replies View Related

General :: Make A Bash Script Keep Running In Same Terminal After It Calls Second Script?

Jun 25, 2010

I have a startup script for jboss (start.sh) that sets some JAVA_OPTS and then calls bash run.sh.If I run it (start.sh) 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 ./start.sh?

View 4 Replies View Related

General :: Run Programs From System Terminal Without Blocking Terminal?

Jun 19, 2010

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.

View 3 Replies View Related

Ubuntu :: Bash Broken, Lost Functionality In Terminal (gnome-terminal)?

Dec 10, 2010

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!

View 9 Replies View Related

Ubuntu :: Terminal Bash / -bash: Ls: Command Not Found

Jun 5, 2011

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

View 9 Replies View Related

General :: Running Bash But Common Bash Commands Not Working?

Jul 17, 2010

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

Code:
root@sdptfw:~ # uname -a
Linux sdptfw.sdpt.co.za 2.4.36 #1 Tue Jul 22 13:13:24 GMT 2008 i686 i686 i386 GNU/Linux
root@sdptfw:~ # echo $SHELL$
/bin/bash$

[Code]....

View 13 Replies View Related

General :: Why Does Running A Program In Bash Work, When Running It In The Menu Doesn't?

Jul 26, 2010

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

View 1 Replies View Related

Software :: Terminal For Running VB Scripts (a SecureCRT Like Terminal)?

Apr 5, 2011

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.

View 4 Replies View Related

Ubuntu :: Where Are Programs Download With Apt-get In Terminal

Sep 1, 2011

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.

View 9 Replies View Related

Ubuntu :: Run GUI Programs From Terminal Correctly?

Aug 3, 2010

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

...in 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.

View 3 Replies View Related

Ubuntu :: Auto Start Programs In Terminal?

Sep 18, 2010

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.

View 1 Replies View Related

Ubuntu :: Removing Start Up Programs In Terminal?

Mar 11, 2010

I recently learned how to add start up programs in the terminal using the following command:

Code:
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:

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

View 3 Replies View Related

Ubuntu Installation :: Install Programs And Use Them By Using The Terminal?

Jun 25, 2011

How can i install programs using the terminal and how can i use programs by using the terminal?

View 3 Replies View Related

Ubuntu :: Terminal: Run Programs As Separate Process?

Jul 11, 2011

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

View 8 Replies View Related

Ubuntu :: Finding Names Of Programs To Use In Terminal?

Oct 30, 2010

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?

View 2 Replies View Related

Slackware :: If Close Terminal Ran Bash Script Inside / Bash Script Stops

Apr 28, 2011

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.

View 6 Replies View Related

Ubuntu :: KDE Programs Running Under Gnome?

Feb 15, 2011

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?

View 3 Replies View Related

Ubuntu :: Running Programs After ISO Mount

Apr 8, 2010

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

View 5 Replies View Related

Ubuntu :: Running Programs From Windows?

Jul 3, 2010

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.

View 3 Replies View Related

Fedora :: Installing The Programs With Terminal?

Jul 23, 2010

Installing the programs with terminal?

View 6 Replies View Related

Fedora :: Can Install Programs Other Than Using The Terminal

Oct 21, 2009

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?

View 8 Replies View Related

Programming :: Bash: Passing Output To Another Programs Input?

Nov 12, 2009

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:

Code:

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

View 6 Replies View Related

General :: Feeding Input To Interactive Programs In Bash?

Aug 30, 2010

If I have an interactive program, e.g top, which, after launch, can be fed with key strokes and changes its behavior, for example, after launching top and then pressing "1", you can see the CPU utilization per core. I was wondering if there is a programmatical way to do so, so I don't have to press "1" every time. I would think it is an easy task, but so far my attempts have failed.

View 4 Replies View Related

General :: Find The Bash Source Files Of Programs In Mac OSX?

Jan 6, 2011

I am currently writing some convenience methods for my terminal in my bash_profile and am sure if what I am writing is "the best way". I figure a good way to verify whether what I'm doing is right or not would be to find some source code of more established programs and see how they do it.My question then is, where can I find this code on my Mac? An example is, with Macports installed, where is the source code that opens the port interactive console when I type nothing but "port" in my shell?(I added Linux in the title even though I am on a Mac because I assume the answer would be the same for both)

View 3 Replies View Related

Ubuntu :: Wine, Or My Error, Programs Not Running?

Apr 11, 2011

i used to run wine and a windows chat program. I got away from linux for a while, but now am back, but the same program i used to run, now gives and error.. to check my internet connection. <urlopen error [Errno 5] Access denided> I gave the program the permission to run, but what am i missing?

View 9 Replies View Related

Ubuntu :: Get A Segfault Whenever Running Programs With OpenGL?

Oct 24, 2010

I'm running Ubuntu 10.04, and for some reason I get a segfault whenever running programs with OpenGL. I ran "lspci | grep VGA" in the terminal and this is the output:

Code:
02:00.0 VGA compatible controller: ATI Technologies Inc M92 [Mobility Radeon HD 4500 Series]

View 2 Replies View Related

Ubuntu :: Running WinXP Programs In VirtualBox?

Jun 5, 2010

Everything works fine; No problems running WinXP from an ISO, etc. I have several Windows only applications which I want to run on the WinXP VM. I cannot see the programs I have downloaded when using Explorer for Windows.Ordinarily, in a WinXP only system, I just find the program to be installed and double click on it to start the automatic installation routine.In this case, I cannot see any of the .exe files used for the install.I have placed those downloaded Windows application in the same directory on my Ubuntu Box as where VirtualBox, the Sun Guest Editions and the CD Image of the Garmin Trip and Map system.I installed the Garmin system directly from and ISO of the CD I made using Brasero. It works without a hitch.Should I take the Windows e.e programs and burn them to a CD and then transfer them as ISO tback to the VM drive?

View 3 Replies View Related

Ubuntu :: Modding Programs Not Running In Wine

Jul 8, 2011

im try to run modding programs for xbox which are all for window (.exe) but the ones that dont have an install they just click and run in windows dont open my laptop thinks about it and doesnt open them here are the programs that dont work

mw2 clan edit
ezgt2.2
lefluffie
usb xtaf xplorer
modio

View 2 Replies View Related

OpenSUSE Install :: 11.3 - How To Use Terminal To Add / Remove Programs

Mar 15, 2011

I am coming from Kubuntu 10.10, which is a Debian based OS. I am used to going into the terminal and typing sudo apt-get install or sudo apt-get remove to install and remove programs. I know it is the hard way to do it, but I find it gave me more flexibility. So how do I do this in openSUSE 11.3? Or can I even install things through terminal? What is the command? I know there is YaST but I also want to learn how to use the terminal

View 8 Replies View Related

Ubuntu :: 'unsave' A Session (list Of Currently Running Programs)?

Nov 6, 2010

System -> Preferences -> Startup Applications -> Options -> Remember Currently-Running Applications I have Skype added to the startup applications list. This works fine. After doing the above, two instances of Skype are starting up every time - and I have not checked the "Automatically remember ... " checkbox. I could not find a way to undo this. After doing the above again, three instances of Skype are starting up every time.

View 3 Replies View Related

General :: Compiling And Running C Programs

Aug 19, 2010

I am new to C programming and I need a way to compile and run my code. I've made a little research and I found that eclipse is a nice IDE. But I don't know how to configure it and generally. What do I need to download and install to make it work. I've also tried downloading easy eclipse that doesn't need any configuration or extra files but the link on the site was broken. Is there any other C IDE like easy eclipse available?

View 5 Replies View Related

General :: Compiling And Running GTK Programs

Jun 24, 2010

I am trying to study gtk programming and get stucked before some errors in compiling them. Iam using ubuntu 9.10 and i didnt installed any additional libraries or packages for running these gtk programs assuming gtk is already installed in ubuntu. I am newbie to gtk I tried compiling some example programs from my tutorial and it ended up in errors. So do I need any additional packages to run these programs.when compiling it shows package config cannot find any gtk+-2.0 packages and to try specifying .pc in environment path. I don't know how to set these path stuff.

View 1 Replies View Related

ADVERTISEMENT