Programming :: Open Gnome Terminal (pass Commands ) On Clicking Glade Button

Dec 18, 2010

I am working on a small project for making a small configuration tool for ubuntu 9.10 for new linux users, that make their system working easily without knowledge of the linux commands.I created a gui in glade and loaded the gui with my python program to show up, now i wish to have some python codes that can launch a gnome terminal (and also pass some linux commands to it) on the click of a button contained in the glade file.

View 1 Replies


ADVERTISEMENT

Ubuntu :: Clicking The Icon The Commands Ran In The Terminal Automatically?

Jan 15, 2010

I had automated some tedious commands in the terminal by writing them in a text file and placing an icon on the panel. By clicking the icon the commands ran in the terminal automatically. I cant for the life of me remember the icon command I used to get this to work.

View 3 Replies View Related

Ubuntu :: Sometimes Clicking Menus Won't Keep Them Open Unless I Hold Button / Fix It?

Aug 3, 2011

Does this happen to anyone else?

For example, sometimes when I create a bookmark in Chrome, you click the Folder button to have it popup a list of folders where you can put the bookmark. Sometimes clicking this causes it to pop open and stay open. Other times clicking it opens it for a second and then it immediately closes. To be able to select a folder when its acting like this I have to click and hold the mouse button and then select what I want while continuing to hold the button. This doesn't only happen in Chrome. Sometimes it happens while setting ubuntu settings in the OS itself or in other applications.

Is this a bug? Why is the behavior inconsistent?

View 1 Replies View Related

Programming :: Pass Complicated Commands As Argument To Another Script?

Apr 21, 2010

I am attempting to script some tasks I have to do, but I have no control over one of the scripts I have to use... and they output all kinds of useless things on the screen. My goal is simple: Capture all output from their scripts, and create a progress line that only shows the most recent output from their stuff. So, here was my first solution; a file I called "spin":

Code:
#!/bin/bash
spinX(){
PROC=$1
STRT='date "+%s"'
while [ -d /proc/$PROC ];do
last3=" 'getLine $2' "

To use it, you pass it a process ID and a file that contains the output from that process. As the process continues, a kurby dances on the screen (To let you know that the process has not hanged), and the tail of the output is shown (To let you know what it is doing). When the process ends, the kurby stops dancing and the time it took is displayed.

And here is the file I call "noise":
Code:
#!/bin/bash
while [ i -lt 100 ];do
i=1
echo "Look at me count!$"
sleep 1
let "i=$i+1"
done

This does nothing but create random output, for testing. It counts from 1 to 99 on the screen. To run my test, I do the following:
Code:
(noise) &>tmp.txt & spin $! tmp.txt

It works relatively well, but it is messy. I don't like creating a temp file, and I don't like the messy syntax for calling my program. I decided that I would rather move everything into the spin program, to make using it less messy:
Code:
#Spin Psuedo code
#$1 = command I am about to run
(exec $1) &>tmp.txt & spinX $! tmp.txt

By executing the process inside of the spin code, I can get rid of the tmp file later on without changing a lot of scripts (Or move it, or whatever). I can also call it by passing the command to the script, which I find more elegant.

So here is what I would like to know:
1) If possible, I would love to get rid of the tmp file all together, and store the most recent line of output from script 1 into a variable that script 2 can print out instead... is it possible?
2) How can I run a random command that is passed as an argument? Basic ones work fine, but anything with a pipe fails me.

Example of a script:
Code:
#!/bin/bash
#myEcho.sh
echo;echo "Recieved command: ";echo $1;echo;
echo "Attempting to run command: ";echo
exec $1

Example code for passing commands to script:
> myEcho.sh "ls -al" #works
> myEcho.sh 'ls -al' #works
> myEcho.sh "ls -al|grep *.sh" #fail
# Output:
#ls: invalid option -- |
#Try 'ls --help' for more information.
> myEcho.sh "ls -al|grep "*.sh"" #fail
# Output:
#ls: invalid option -- |
#Try ls --help' for more information.
> myEcho.sh 'ls -al|grep *.sh' #fail
# Output:
#ls: invalid option -- |
#Try 'ls --help' for more information.

View 8 Replies View Related

Programming :: Python : Pass Output Of System Commands To Variable?

Jan 25, 2011

I'm trying to write a python script that will use the current user's name when interacting. Ex: when started, it should say "hello daweefolk" when I am logged in.
I've tried
Code:
username=os.system("echo $USER")
but the variable remains empty.
What is the correct code?

View 1 Replies View Related

General :: Run Open Office Doc By Clicking / Terminal Have To Change Permissions To Run

Dec 8, 2010

Im trying hard to get familiar with Linux Ubuntu and Im a bit comfused on one thing. Why can I run an Open Office doc just by clicking and in terminal a have to change the permissions to run it even as a root?I thought that in graphic mode Im the actual root no? And so when I run the terminal I should be still the root no?

View 4 Replies View Related

Ubuntu :: Gnome-terminal -e <multiple Commands>

Sep 1, 2011

With xterm, I can do the following, and the scripts are executed sequentially in a single xterm: xterm -e 'script1.sh;script2.sh' But with gnome-terminal, when I do: gnome-terminal -e script1.sh;script2.sh It runs them in parallel in 2 different terminals. I've tried a few combinations of ", and ', around the scrips, but no difference.

View 2 Replies View Related

General :: Script To Input Commands Into Gnome-terminal?

Nov 24, 2010

I'm trying to get a script to open a gnome-terminal and input commands into it, just as you would typing them in. That way, I can automate commands using bash, even if the terminal is running a non-bash program like telnet, mysql, vim, etc.

So, for instance..

I would like to open telnet to connect to a mud (I'm aware of the security concerns) and input commands through a script.

This way, I can log in, enter name/password, and do some start-game stuff automatically.

This isn't just for a mud, though. I'd like to be able to script inputs for any terminal application... maybe automate vim, mysql, or whatever.

View 1 Replies View Related

Ubuntu Installation :: Upgrade Failed - Cannot Open Terminal To Run Commands

Apr 29, 2011

Yesterday I tried upgrading from 10.04 to 10.10 using the upgrade manager. About half way through, my computer froze up and the only thing I could do was reboot my computer. It had already finished downloading all the upgrades and the computer froze while it was trying to install the upgrades. When I boot my computer and the Grub screen appears, I chose the Ubuntu OS (I have a dual boot system of Ubuntu and Windows XP). When it goes to boot Ubuntu, it gives me a blank screen and then a box in the right hand corner that says this:
"Install problem! The configuration defaults for GNOME Power Manager have not been installed correctly. Please contact your computer administrator."

Then the screen remains blank. No cursor, no mouse pointer, nothing. I have researched this error message and it is either caused by not having any free space on my hard drive or that the upgrade packages weren't installed properly. In my case, it could be both. It is definitely the packages not be installed properly but I don't know how to find out if there is no free space on the hard drive partition for Ubuntu. Some of the solutions are to use the following commands in the terminal:
sudo apt-get clean
sudo dpkg --configure -a
sudo apt-get --reinstall install ubuntu-desktop

The last command might cause me to lose previous settings, so that would be a last resort if the first two commands don't work. So my main issue is that I cannot open a terminal. My computer is set up to automatically log in. When my computer boots, I have the Grub screen which allows me to choose the Ubuntu OS, Ubuntu in recovery mode or Windows Xp. However, when I choose Ubuntu in recovery mode and select "c" for the command line, it does not recognize the "sudo" command. Same when I choose the command line in the regular Ubuntu OS. When I type "sudo apt-get clean" (without quotes), it says "Sudo command not found." I cannot find the command lines that would be the equivalent of a "sudo" command to use in recovery mode.

If you hit the TAB key while in the command line of recovery mode, if gives a list of commands but I don't see a way to open up a terminal window. For example, when I type terminal_input, it just says, Active: Console, Available: usb_keyboard." I have also tried selecting the Ubuntu OS, waiting for it to boot and then hitting Ctrl+Alt+F1 but it does not give me a log in screen. I have tried Ctrl+Alt+F2 and Ctrl+Alt+F7 and neither of those give me a log in screen either. It is just a blank screen. No cursor or mouse pointer is visible. All I want is the ability to open up the terminal so I can run "sudo apt-get clean" and "sudo dpkg --configure -a".

View 8 Replies View Related

General :: Get Gnome Terminal Execute Different Commands From Diff. Tabs?

Jan 6, 2010

In gnome terminal it is possible to open multiple tabs with Quote:$ gnome-terminal --tab-with-profile=jake_lardasset --tab-with-profile=virtualsexgranny -x alpineWe got even further....Quote:gnome-terminal --tab-with-profile=james_treesexer --command pymol --tab-with-profile=loverboy13 --command alpineand pymol runs, but not in the tab and alpine runs in the tab.The problem is, that when using a script to check mail it has Quote:gnome-terminal --tab-with-profile=chrissypink --command alpine --tab-with-profile=jake_hugerichard -x ssh xxxx@xxxx.ut.eenot the other way aroundIs there a simpler way to do this?And why is it not possible to execute ssh with the --command parameter and -x has to be used ,but top and so on can be executed with --command

View 2 Replies View Related

Ubuntu Installation :: Samba Needs Glade On 11.04 - ImportError: No Module Named Glade

May 1, 2011

After upgrading my media computer earlier today, I tried to run Samba config (system-config-samba) and it crashed. Running again in terminal I got the following error:-

Code:
import mainWindow
File "/usr/share/system-config-samba/mainWindow.py", line 30, in <module> import gtk.glade
ImportError: No module named glade
Ths was fixed by installing (via Synaptic):-

Code:
python-glade2

View 2 Replies View Related

General :: Gnome-terminal/bash - Cancel Inserted Commands That Will Be Executed Later?

Mar 13, 2011

$ execute_some_long_command <command is executing> <Accidently press middle button that inserts bunch of garbage (including, for example, `rm -Rf ~/*`) into console>

How to let execute_some_long_command finish, but not execute inserted things?

View 1 Replies View Related

Programming :: Launching A Terminal Command With A Qt Button?

Feb 9, 2010

I've created a QT interface with some buttons and labels, and i want to launch a terminal command with one of these buttons,but the command maust starts with "sudo",unfortunately it didn't work because it wants root password and i can't enter it even in the Button cammand....

View 6 Replies View Related

Programming :: Prevent People From Exiting The Terminal By Clicking The "X" At The Top Right?

Nov 12, 2010

Currently i'm doing a script for my project and I want to prevent people from exiting the terminal by clicking the "X" at the top right. when I run the script, user cannot exit out of the terminal unless the scipt finish running.

View 5 Replies View Related

Debian Programming :: Trigger Interrupt With Middle Mouse Button In Terminal

Feb 2, 2015

Ctrl-c with middle mouse button (MMB) trigger in running bash script trigger.

The key combination Ctrl-C or "^C" with the keyboard triggered on a running bash script stands for "signal interrupt" (SIGINT) and terminates the process.

For my workflow in the test phase, how I could do that with the MMB-Buffer, followed by the modified script command:

Code: Select allscript runs
script runs
script runs

Signal interrupt and rerun with MMB trigger:

Code: Select all^C; ./script.sh
modified script runs
modified script runs
does not work and 2 hours meta-crawlers

View 1 Replies View Related

General :: Launch A Terminal By Clicking On The Terminal Icon At The Top Of The Screen

Apr 22, 2010

I have a favorite REXX program called fv2. When I was a Windows user I had an icon for fv2 on the Quick Launch bar. Click that icon, and the program ran. Now, as a Linux (Ubuntu) user it is necessary to go through several steps to run fv2.

1) Launch a terminal by clicking on the terminal icon at the top of the screen. What's that area called? The GNOME panel?
2) Enter: ~/Desktop/RexxScripts
3) Enter: regina fv2

I run fv2 several times per day and would really like to have the convenience of a clickable icon.

View 3 Replies View Related

Fedora :: 12 (KDE) - Very Long Pause Clicking F Button?

Jan 2, 2010

I just got F12 installed on my laptop and so far it was a breeze! Thanks to leigh for the fantastic nvidia and compiz installation tips, and to bbfuller for getting the BroadCom wireless working.I do notice, however, that when I press the F button (KDE) there is about a 20-30 second pause before the window pops up. I see the same thing when I start a terminal window.

View 6 Replies View Related

Ubuntu :: Clicking Shutdown Button Just Logs Off

Feb 4, 2010

I'm running a laptop and a desktop that both have Hardy on them. A few days ago I updated to 8.04.4 on both and since then when I click on the red Shutdown button and then click on 'Shutdown' it just logs me out. Anyone have this happen to them after the update? Any ideas on how to fix it?I am not physically pushing the power button on the PC's. so unfortunately going to Gnome Top Panel Menu > System > Preferences > Power Management > General Tab Actions will not work to correct this issue

View 4 Replies View Related

Fedora :: Glade-3 - Change The Run Application Window Of Gnome Panel?

Mar 9, 2010

how i can change the run application window of gnome panel; i had done this with glade-3 but i dont know how to manage its signal and slots for example by clicking on a button it opens an app ,i cant manage it signals and slots

View 1 Replies View Related

General :: Gnome-terminal Command To Open Up A New Tab?

Aug 20, 2010

Are there a command to open up a new tab in gnome terminal(Ctrl+T outcome). I need it to use with in bash script.

View 2 Replies View Related

Software :: Use Php To Pass Commands Onto A Server?

Mar 4, 2009

hi all how do i use php to pass commands onto a server? like i want to be able to:

1. delete the content of a file (or just delete the file and make a new one if it's easier)

2. read the content from a file

3. write new data to a file via an input box

4. run a command on the server

View 7 Replies View Related

Programming :: Interface Glade 3.6.7 And 'C' In Ubuntu 10.10?

Apr 18, 2011

this is my first time here: I've been programming GUI software in C# in MonoDev for some time now. I just noticed that I can use my favorite language, C, with Glade to do the same thing. I've been going through some tutorials with a little frustration with them. Some seem to be written for older Glade versions.

The latest example had me save my Glade project to a "tutorial.glade" file. Then run it through a 'gtk-builder-convert' utility. Problem: the utility program returns errors indicating the the tutorial.glade file was written badly, that there is supposed to be a <glade-interface> tag that is missing.

[Code]...

View 1 Replies View Related

Debian Multimedia :: Gnome-terminal Refuses To Open

Jan 30, 2015

I updated my Jessie system today. Nothing crucial in the apt-get list as far as I can see, perhaps it's unrelated. Anyway, now I cannot open the terminal any longer. Launching `gnome-terminal` shows the app name in the menu bar, a spinning wheel, and then after a few seconds nothing. It doesn't appear in the list of processes, either. I can still log into the text shell via ctrl-alt-F1.

I also added `LC_TIME="en_GB.UTF-8"` to `/etc/environment` to get rid of the American date format. Could it be the cause? I just tried to launch the terminal from the JVM. I get this output:

Code: Select all(process:2629): Gtk-WARNING **: Locale not supported by C library.
Using the fallback 'C' locale.
Error constructing proxy for org.gnome.Terminal:/org/gnome/Terminal/Factory0: Error calling StartServiceByName for org.gnome.Terminal: GDBus.Error:org.freedesktop.DBus.Error.Spawn.ChildExited: Process org.gnome.Terminal exited with status 8

I will delete the environment variable again and reboot, but I wonder if I can still have the British date format?

View 1 Replies View Related

Ubuntu :: Gnome Terminal Wont Stay Open?

May 27, 2010

when i click on the terminal icon , it opens up for a split second but then closes right away . I've tried alt+F2 and clicked on run in terminal but still same problem. how can i fix this ?

View 6 Replies View Related

General :: Impossible To Open A Terminal Window In Gnome?

Oct 1, 2009

After a cleaning of some software from my ubuntu (Jaunty) desktop I am no longer able to open a terminal window in Gnome.I tried to reinstall gnome terminal from synaptic but this made no difference...In the command line that you get with Alt-F2 I tried the code: man ls
and a terminal window opens but after exiting the man page (q) it disappears!

View 9 Replies View Related

Ubuntu :: Need Grub To Pass On Some Commands To Secondary OS

Jul 29, 2011

So, I have a netbook with a 320GB harddrive and I'm testing all kinds of fun distros out. Right now I have 11.04, 11.10 daily, Jolicloud, Chromium OS, and MeeGo. Meego uses it's own weirdass boot loader, which sets things up a certain way. My computer has a touchscreen, and I had to modify some things to get it all working properly. Anyway, I reinstalled grub on my main partition (11.04), but now the command I need doesn't go through to meego.

The command is "usbhid.quirks=0x0eef:0x725e:0x40" For my other systems, I have it in /etc/default/grub in the "GRUB_CMDLINE_LINUX_DEFAULT=" line.

Obviously there is nothing like this in Meego, and a thread on their forum said I would have to configure it in whichever bootloader I'm using.

View 3 Replies View Related

Programming :: Invoke Cairo Functions From Glade?

Feb 12, 2011

I have created a glade file which so far have two regions in it:

1) On the right division is a toggle button which calls a C script when enabled.

2) I have a drawing area, in which I would like to plot a point (X-Y scatter plot). The plot should be generated dynamically using a C script. I am not sure how the integration between the two is possible for a drawing area.

In glade what properties of drawing area should I set? eg.expose event, realize etc. I was thinking of using cairo for generating the plot.

View 2 Replies View Related

Programming :: GTK / Glade Use C - Bash - Pascal Or Settle For Python?

Dec 17, 2010

I have searched the net for guides on GTK/Glade and have learned that I have to install Glade in order to experiment with it. It also appears that it only works for Perl. I would primarily like to use C ,Bash , Pascal or settle for Python if possible. Can anyone offer some general info on this topic?

View 4 Replies View Related

Programming :: Opening A Text File From Glade Interface?

Jan 26, 2011

opening a text file from glade interface.how?using c code

View 1 Replies View Related

Programming :: Use Glade With C/python To Create A Graphical User Interface

Jan 30, 2011

I am working with ubuntu (linux) and have to create a graphical user interface. The GUI is a 2-D plot that have to plot a point. The point ( x and y co-ordinates) are not hardcoded, and are coming from another file (another piece of code written in c / python). I was thinking to use Glade with c/python to create this. But, I am not sure how to start with this.

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved