UbuntuThis forum is for the discussion of Ubuntu Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am trying to set a default background image in openbox.
To achieve this, I (at a terminal) type:
Code:
sudo feh --bg-scale /path/to/image
Works perfectly.
Now obviously I don't want to type this everytime I log in, so I added the command to my .xinitrc file.
The problem is, that I cannot use sudo, as my password is required and I cannot pass this to the startx script, without running it as sudo, which I don't want to do.
Without sudo, the image is not applied as my user has no permission to do so.
I would like to know, how I could modify the "/etc/sudoers" file, so that my default user can run only the command in question, without having to enter the password.
I have tried:
Code:
username ALL = NOPASSWD: ALL
which gives the desired effect, with the backdraw of posing a huge security risk as anyone using my pc could just do a "sudo rm -r /usr"
Or can I solve this problem, by adding my user to a different group?
Originally posted by hungrigerhaifisch I am trying to set a default background image in openbox.
To achieve this, I (at a terminal) type:
Code:
sudo feh --bg-scale /path/to/image
Works perfectly.
Now obviously I don't want to type this everytime I log in, so I added the command to my .xinitrc file.
The problem is, that I cannot use sudo, as my password is required and I cannot pass this to the startx script, without running it as sudo, which I don't want to do.
Without sudo, the image is not applied as my user has no permission to do so.
I would like to know, how I could modify the "/etc/sudoers" file, so that my default user can run only the command in question, without having to enter the password.
I have tried:
Code:
username ALL = NOPASSWD: ALL
which gives the desired effect, with the backdraw of posing a huge security risk as anyone using my pc could just do a "sudo rm -r /usr"
Or can I solve this problem, by adding my user to a different group?
Just out of curiousity, why must you use sudo to set wallpaper? The background settings are owned by the currently logged in user, and sudo is not required.
...why must you use sudo to set wallpaper? The background settings are owned by the currently logged in user, and sudo is not required.
Well thats what I thought, BUT I am afraid that my box (or rather X) is telling me differently.
If I enter
Code:
feh --bg-scale /path/to/image
(note, no sudo) nothing happens. The same line with sudo, and my background image is set!
Now it seems logical, that the same behaviour applies to X, when it executes what is written in the .xinitrc file.
Without sudo, X starts (and Openbox) but no background image, with sudo, X starts but just sits there doing nothing (no Openbox). Terminating the X server reveals, that it is waiting for a password. Now if I, before running the startx-script do a
Code:
sudo aptitude
or any other sudo command (and enter my password), and then run
Code:
startx
the X-Server fires up, sets my background image, and runs Openbox.
Now either this is a bug, (I am running Ubuntu Breezy!) or I am missing something crucial.
Quote:
is it not easier to set wall paper through the configure desktop page? im assuming openbox has the config desktop area somewhere.
Sadly, this is not the case, as neither the themes nor openbox itself set a background image.
One has to use a 'third-party-tool', such as feh!
Hmmm. You are not running as root, correct? I've never seen this behavior before. The user you are running as should be able to run startx and feh with no problems. Openbox is a minimal window manager, and provides no capability to manage wallpaper. Openbox does have a theme and setting manager called "obconf", but it must be installed seperately, and does not manage wallpaper. A full-blown desktop environment like Xfce4, Gnome or KDE will provide functionality to alter the desktop, but they are much larger, slower, and use far more system resources. If this is not an issue to you, perhaps using a full desktop environment is better. I am not familiar with Ubuntu at all, so cannot give you any distro-specific help - sorry about that.
...but they are much larger, slower, and use far more system resources....
Sadly this IS an issue for me.
On my "real" machine, I use GNOME, but of course 1800Mhz and 512MBs of Ram are more than enough to do so...the machine in question is my old 300Mhz Laptop, and OpenBox, being even more lightweight than blackbox or fluxbox (and still pretty!) is just right for it.
Quote:
You are not running as root, correct? I've never seen this behavior before...
Actually, I've by now figuered, that X is behaving quite normal. If You have GDM XDM or KDM installed, try running them as a normal user, it should give you something like, "only root wants to run GDM".
So my solution (not tested yet) is probably to install either GDM or XDM, the latter being less dependent on Resource hogging GNOME, and let it do all the setting up.
Originally posted by hungrigerhaifisch Sadly this IS an issue for me.
On my "real" machine, I use GNOME, but of course 1800Mhz and 512MBs of Ram are more than enough to do so...the machine in question is my old 300Mhz Laptop, and OpenBox, being even more lightweight than blackbox or fluxbox (and still pretty!) is just right for it.
Actually, I've by now figuered, that X is behaving quite normal. If You have GDM XDM or KDM installed, try running them as a normal user, it should give you something like, "only root wants to run GDM".
So my solution (not tested yet) is probably to install either GDM or XDM, the latter being less dependent on Resource hogging GNOME, and let it do all the setting up.
When I find time, I'll post the result!
Do you boot to a command line and then run startx? I know GDM/KDM/XDM need to be run as root, because they normally run as a system service. How frustrating - sorry, the only thing I can think of is a problem with the permissions of your ~/.Xauthority file, but I am kind of grabbing at straws.
Originally posted by davideckels i have an imperfect fix- i edited my menu.xml to include a section for backgrounds, then added an action menu entry for each background i like.
with a spearate entry for each of the backgrounds i want to rotate.
it's a little kludgy, but a good googling of "openbox ubuntu default background" suggests this may be the best kludgy workaround available.
let me know if you figure out why a sinple xinitrc file doesn't work, won't you?
I have a script I downloaded that will accomplish the same thing, but it involves installing Ruby, which is a scripting language. No big deal, just might not be something you want to do. Here is another option: have you heard of the file manager Rox? You can run Rox in your .xinitrc, and it can provide a desktop for you, including icons and wallpaper. It's very lightweight, and plays nicely with Openbox. It has some disadvantages, but only with other apps that insist on drawing directly to the root window.
I still cannot understand why you cannot set your own wallpaper from .xinitrc - that's very odd. Your normal user is in the "users" group, correct? Not that it really matters, but this seems like a permissions thing. Your normal user should be able to run any executable in /usr/bin or /usr/local/bin. Bsetbg should be located in /usr/bin, which any user in the "users" group has rights to execute. Can you check your /etc/group file to see of your normal user is part of the "users" group?
quoted:
I still cannot understand why you cannot set your own wallpaper from .xinitrc - that's very odd. Your normal user is in the "users" group, correct? Not that it really matters, but this seems like a permissions thing. Your normal user should be able to run any executable in /usr/bin or /usr/local/bin. Bsetbg should be located in /usr/bin, which any user in the "users" group has rights to execute. Can you check your /etc/group file to see of your normal user is part of the "users" "group?"
replied:
i just added myself to "users". let's try this again... (keystrokes, creak of shifting electrons) nope. not with an .xinitrc or an .xsession file, set as a regular file or an executable, with my group as "users" or otherwise.
...handy info:
user dave, groups... include "users"
ubuntu breezy
2.6.12-9-686-smp from install cdrom
openbox 3.2-7 from synaptic universe/X11
xorg 6.8.2-60 from install cdrom
generic nv driver from install cdrom
... what else can i tell you?
Well, here is a solution you might try, but is still not optimum because your normal user should be able to run any binary in /usr/bin. There is still a problem with your system, but this may work: run "visudo" (without the quotes, and as root). This will allow you to edit your /etc/sudoers file and add your user's permissions to run startx.
Code:
username hostname=NOPASSWD:/path/to/binary
Obviously, substitute your username hostname and /path/to/binary for the appropriate values. visudo will run whatever editor is set in your system wide editor variable, which may actually be vi. Vi is a minion of the devil (just kidding), and I cannot tell you how to do anything in vi - it is very difficult for a first time user to use, at least for me. You cannot edit /etc/sudoers with a text editor, you must use visudo. As an alternative to using the masochistic vi, you may set your EDITOR variable in /etc/profile first, choosing an editor which is easier to use, such as nano or pico. Once you make changes to /etc/profile, you will need to log out/in to see the changes. After that, you can run visudo and add the line above to the file. Once you save the file, visudo will exit and update /etc/sudoers. This is not a perfect solution, and still means something is hosed in your system, although for the life of me I cannot figure out what.
An alternative might be to install GDM/XDM. Have you considered this? Good luck....
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.