How can i do for run an app when ubuntu start? - linux

Hi i tried in several ways to launch firefox by example at the beginning, obviously my machine enters automatically to ubuntu without ask for user or password, so i made a script like that : firefox url. And i put this script on cron with the parameter : #reboot + path of my script but it doesn't works, because firefox is not launched, is not only firefox i need to will able to launch as well gedit when ubuntu start, i hope that can i help me whit this.
By the way i have ubuntu 14.04
Thanks

Go to Startup Applications via dash
There, add firefox ...
You can specify the URL to open by writing the command:
firefox URL
This will open URL in the browser. No script needed...

you don't need a script for this.
Ubuntu has a GUI for managing startup applications called "startup applications"
Click the Search button at the top of the Unity bar
Search for "Startup applications" and press enter
In the GUI you can press "add" and enter a custom command of your choice
Also look at existing entries to see how it is done.

Related

How to automatically start and advance a few steps in an application in background in linux?

I'm using Genymotion to run WhatsApp on Ubuntu 13.04 as I don't own an Android.
To get to Whatsapp everytime I login, I have to
1) open terminal and run ~genymotion/genymotion
2) click a button on the GUI which opens up another new window (play button).
3) wait for about 30s for the device to get ready.
How can I make the computer do these first two steps automatically for me at start up?
Even better if it possible to do them in background, i.e., I shouldn't see the GUI opening. It should perform the steps and be "minimized".
I was thinking if there was a way to record what my click does and then put it in a script.
Something like a strace command.
I hope my question is clear enough. I'm relatively new to Linux.
For now Genymotion allows you to start a VM from the command line, by calling the "player" binary, and passing the VM name as a parameter.
You could write a shell script that:
run: <GENYMOTION PATH>/player --vm-name <VM NAME>,
wait some seconds for the VM to boot: sleep 10,
then use adb to start your Application: adb shell am start -n com.whatsapp/com.whatsapp.Main
Luckily, no need to simulate clicks for this.

Running a GUI app on linux, without showing the gui?

I'm working with an api that requires an app to be started, the app runs a GUI on linux.
I need to punsh in some login information and then hide the app.
Is there a way I can go to the machine start the GUI and then hide it, log out, and have other users log in with out having the GUI shown, but still having the app running?
You can take a look at Xvfb http://en.wikipedia.org/wiki/Xvfb
it's a framebuffer version of X.
It will launch an X11 server without displaying it (useful with selenium for example)
Xdotool can send input to anyb xwindow, including xvfb

VNC on CentOS 5.5 + Gnome

I have successfully started a vncserver and can connect to it through the browser via 111.111.111.111:5081.
It looks like it's working because I do see the Gnome cursor (X).
However, apart from the cursor I just have a black screen. No taskbar or anything. Right click provides nothing either.
Does anyone have any idea what I need to do to get the full desktop ? I have created a new user and wondered if there is any settings that need changing.
Thanks in advance,
Alex
Your VNC server is running, but there is nothing running in it. No window manager, no desktop environment (GNOME), nothing. The cursor you are seeing is a Xserver cursor, not a GNOME cursor.
That probably means you ran the VNC server directly without using some of the friendly wrapper scripts such as vncserver. For example, if you have tightvnc installed and you run Xtightvnc directly, that's what you'll get.
For example, I usually start a VNC session (or port 5901) like this:
vncserver -geometry 1024x768 :1
Alternately, you can use x11vnc to serve your existing X desktop (instead of starting a new one in the background).

How do I logout from a computer using shell?

How can I log out of my computer using shell such the log-in window appears again?
I need this functionality in one my Linux script.
Update:
I want to replicate the code working behind the Logout button of my Ubuntu.
Desktop Enviroment being used: GNOME
I think this does the job:
gnome-session-save --logout
Also, take a look at the --help output, maybe you want to use the --force-logout option.
Usage:
gnome-session-save [OPTION...]
Help Options:
-h, --help Show help options
--help-all Show all help options
--help-gtk Show GTK+ Options
Application Options:
--logout Log out
--force-logout Log out, ignoring any existing inhibitors
--logout-dialog Show logout dialog
--shutdown-dialog Show shutdown dialog
--gui Use dialog boxes for errors
--display=DISPLAY X display to use
Your question is a bit vague. Are you trying to log out of a graphical session of a desktop environment (such as KDE/Gnome), as if the user clicked on "log off"?
Then you need to find out if/how the desktop environment supports scripting to log out. On KDE for example you can use kquitapp.
Try restarting the display manager using one of the following, depending one which one you're using. You'll obviously have to have the proper permissions.
/etc/init.d/xdm restart
/etc/init.d/kdm restart
/etc/init.d/gdm restart
It's a bit of a hack, but the way that screen's power detach does this is to determine its parent pid and send it a SIGHUP. (Clarification: This closes only the shell, so only works if you're running from a console - not a graphical login - so may not be what you're looking for.)
Type in terminal
gnome-session-quit
or
pkill -kill -u {Username}

Launching a web page in a different process

I want to launch the browser in a different process when a particular link is clicked on the page. When I checked the net I found the following tip: http://www.dslreports.com/faq/3849 . But there we have to change the registry. Is there any simple way of doing this without touching the registry?
If you use the Google Chrome browser, each new window or tab runs in a separate process. Internet Explorer version 8 will do the same (it's currently in the second beta round).
Earlier versions of IE will run a new window in a separate process if it is launched from, say, the Start menu or the command line, or a link in an email (but not by clicking a link within IE). I imagine you could create a proxy that the client would run through, which would intercept the links you care about and launch them by running a command line request. That seems like more trouble than mucking with the registry though (assuming that registry change still works -- looks like your link is from 2002).
I don't believe this is possible unless you change the client computer setup or software it's running.
Why do you want to do this?

Resources