I have googled my tail off - but can't seem to find what I am looking for. In Ubuntu (or any Linux distro for that matter) is there a way to set the GUI shell to only be Firefox or Chrome. Meaning - I don't need an entire desktop environment - just the one application.
I am pretty much trying to figure out a Linux equivalent to changing HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon from explorer.exe to firefox.exe.
By default, distributions are setup the way that a display manager is fired up right after the X server. For Gnome, that would be GDM, for KDE that would be KDM etc. What you need to do is to replace a Window manager with a custom application, which in your case is a web browser. Generally, you can achieve this by putting your command(s) into ~/.xinitrc and ~/.xsession files, for example:
#!/usr/bin/env bash
firefox &
For Ubuntu, this process is explained in details here. Other distros are quite similar.
Hope it helps. Good Luck!
Related
Is there a way to launch a bash/ksh shell, or execute a shell script from Chromium? Is there a setting to tweak, a plungin to add, a workaround besides php and a local server?
Sorry if this is a duplicate. I assumed I would find an answer here, but only see answers about launching Chromium using a script or complete workarounds avoiding my question, with a local server and JavaScript/PHP. I have an Apache server available and can do the coding, but rather not.
I could do this in Internet Explorer on Windows (or used to be able to launch a .bat script there. I haven't used IE in a long time), why not in Chromium on Linux?
I understand the security concerns and sandbox in the browser, but in this case the browser never goes outside a firewall and I just want to launch a script from Chromium.
Thank you for your thoughtful replies.
Reminder: Arch Linux uses pacman not apt-get
So I had an idea that I wanted to be able to leave my room and still see the progress of a download from my phone. I have looked for preexisting programs but have found none, so I decided to write a program myself.
the first step I took was reading the pacman documentation, to see if a function that could get the current download status was. I know there is a file I can check to see if exists
/var/lib/pacman/db.lck
which would tell me if there is a download
however I wanted to know more specifics on the download - progress and time remaining, name of download.
I have also found some GUI programs that use pacman and I was thinking of getting the source code to see if I could use some of that, but haven't found anything useful.
is there a way to find out the specifics about a current download, other than looking at the terminal that the command is running on?
Why overcomplicate things? Just install "screen" via pacman, and start the pacman update inside a screen.. And from your smartphone, use a SSH client to connect to your local machine and access that screen.
You could setup an ssh server on your host machine and connect to it using a terminal emulator on your phone (termux for example) and run whatever commands you like from there. This way you'll be able to view all terminal output from your phone quite seamlessly.
I, I'm writing an app with electron (http://electron.atom.io/). I would like to deactivate the monitor/display of the pc and only activate it again, when something in the app happens (for energy-saving). Is there a way to do this?
The only think I found, is the powerSaveBlocker (http://electron.atom.io/docs/api/power-save-blocker/) which doesn't help me...
You'll need to use native system APIs to do this, on Windows you can use one of the solutions proposed in Turn on/off monitor.
One of the ways you can do that is by executing batch files from electron/node in Windows , shell scripts in Linux and whatever MAC OS uses to execute commands.
These scripts would contain the OS level commands to turn on/off the display which are easily available .
When to fire these scripts would depend on your application logic .
I need to run my Qt GUI application immediately when my linux system starts.
I do not need any other things apart from this Qt GUI application. No need of desktop.
Previously I have started daemo using update-rc.d command but I do not know how to start GUI and I do not have much knowledge about X11.
I went through net & found two links:
Running a Qt application at startup
This is telling to create desktop entry file for you... but as i do not need desktop.
And only want my GUI to run. So this is not the solution which i am looking for.
http://www.qtcentre.org/threads/28564-Qt-app-in-linux-startup
Here I am not able to understand what I have to do with /xinitrc.d.
And how my application GUI can start. Can some one clarify this point?
Can some one suggest what I will have to do to start only GUI application?
You very probably need some X window manager to run your Qt application, perhaps even some desktop environment (i.e. you want EWMH & ICCCM compliance), and you obviously need a running X11 server (usually Xorg). So you could manage to have some xinitrc for all that.
Notice that some session -or display- managers like lightdm can be configured to start some special sessions.
In all cases, you need a lot more than just your application to be running, and you certainly need to understand in detail what your Qt application really requires (mostly thru Qt libraries). Learn more about the X11 protocol. See also freedesktop.org.
If you're using lightdm Desktop Manager, then edit your /etc/lightdm/lightdm.conf file by uncommenting line
session-setup-script=
and immediately after equal sign (without spaces) add path to your gui application!
Save lightdm.conf file, and restart the system!
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}