You are not logged in.
Does anyone know which script runs last when running openboox. i would like to add a final piece of code to the end of the script. also is there a program that displays all the files that run when a program is run?
reason being that i am trying to run some scripts once openbox has finished loading i have tried the methods explained including adding lines to ~/.config/openbox/autostart. i have tried adding lines to usr/lib/openbox/openbox-autostart. i will keep trying. maybe it needs to go into the etc/xdg/openbox/autostart file for it to work?
also for trying to understand a little more, is usr/lib/openbox/openbox-autostart the part of the source code that tells etc/xdg/openbox/autostart to run on completion of openbox?
spiritech
Last edited by spiritech (2013-12-22 09:37:55)
Offline
Post the scripts you wanted to run.
Offline
Post the scripts you wanted to run.
They are very simple bash scripts.
#!/bin/bash
feh --bg-scale "/media/sdb/Backgrounds/Neon/abstract-blue-smoke-light.jpg"and
#!/bin/bash
cairo-dock -o &
setxkbmap gb
pulseaudio --startOffline
I don't use openbox, but /usr/lib/openbox/openbox-autostart sounds like the default location of the autostart file. Like a lot of other applications, you make a copy and place it in your home directory, where you don't need root access to run it.
Does placing your commands at the end of the openbox autostart not work?
Offline
I don't use openbox, but /usr/lib/openbox/openbox-autostart sounds like the default location of the autostart file. Like a lot of other applications, you make a copy and place it in your home directory, where you don't need root access to run it.
Does placing your commands at the end of the openbox autostart not work?
i place the path to the file i want to run at the end of the file.
/home/user/file.01
/home/user/file.02
Offline
If you execute them manually, do they work?
Offline
karol wrote:Post the scripts you wanted to run.
They are very simple bash scripts.
#!/bin/bash feh --bg-scale "/media/sdb/Backgrounds/Neon/abstract-blue-smoke-light.jpg"and
#!/bin/bash cairo-dock -o & setxkbmap gb pulseaudio --start
Pulseaudio should start on it's own through xdg I believe ( /etc/xdg/autostart ), the rest of the commands you should be able to just put directly into your autostart file without needing to call on external scripts (the autostart file is bash / sh anyways (that is the interpreter called for it)).
.config/openbox/autostart
feh --bg-scale "/media/sdb/Backgrounds/Neon/abstract-blue-smoke-light.jpg &
cairo-dock -o &
setxkbmap gb &What exactly is going wrong when you put these commands in your sutostart file? They just don't start? Are you remembering to put "&" at the end of each line? If you must runa script and it's not working try doing "bash /path/to/script &" may work
Last edited by dodo3773 (2013-12-15 07:43:58)
Offline
If you execute them manually, do they work?
yes.
Offline
spiritech wrote:karol wrote:Post the scripts you wanted to run.
They are very simple bash scripts.
#!/bin/bash feh --bg-scale "/media/sdb/Backgrounds/Neon/abstract-blue-smoke-light.jpg"and
#!/bin/bash cairo-dock -o & setxkbmap gb pulseaudio --startPulseaudio should start on it's own through xdg I believe ( /etc/xdg/autostart ), the rest of the commands you should be able to just put directly into your autostart file without needing to call on external scripts (the autostart file is bash / sh anyways (that is the interpreter called for it)).
.config/openbox/autostart
feh --bg-scale "/media/sdb/Backgrounds/Neon/abstract-blue-smoke-light.jpg & cairo-dock -o & setxkbmap gb &What exactly is going wrong when you put these commands in your sutostart file? They just don't start? Are you remembering to put "&" at the end of each line? If you must runa script and it's not working try doing "bash /path/to/script &" may work
i will try the bash prefix as i would like to keep them as scripts so that i can modify them later on.
thank you.
Offline
.config/openbox/autostart
feh --bg-scale "/media/sdb/Backgrounds/Neon/abstract-blue-smoke-light.jpg & cairo-dock -o & setxkbmap gb &What exactly is going wrong when you put these commands in your sutostart file? They just don't start? Are you remembering to put "&" at the end of each line? If you must runa script and it's not working try doing "bash /path/to/script &" may work
i have added the lines
bash /path/to/script &
bash /path/to/another/script &into the file .config/openbox/autostart sill nothing happens. i will try adding to etc/xdg/openbox/autostart.
Offline
i have now tried adding the command
feh --bg-scale "/media/sdb/Backgrounds/Neon/abstract-blue-smoke-light.jpg" &manually to both ~/.config/openbox/autostart and /etc/xdg/openbox/autostart files and it still does not work.
Offline
For feh to set the background, I have the executable file ~/.config/openbox/autostart, which contains the line:
sh ~/.config/feh/themes/fehbg &~/.config/feh/themes/fehbg is not set executable so I need the 'sh', above. This file is a single line:
feh --bg-center '/home/casey/pictures/walker-evans_church-interior.jpg'Offline
How are you launching openbox?
When you run the openbox command on its own, the autostart scripts will not run. They are run by openbox-session or when you log in graphically with the "Openbox" session type.
Offline
you probably messed up your openbox default setup completely by now.
all the autostart files in your system should be left untouched, except for the one in $HOME/.config/openbox.
and there's no need for a "default" autostart file. it's a simple shell script where you put what you want executed after login, like setting the background, starting a panel...
that said, if you have openbox as part of a desktop environment like lxde, things are a bit different.
please check http://openbox.org/wiki/Help:Autostart
Offline
all the autostart files in your system should be left untouched, except for the one in $HOME/.config/openbox.
My understanding is that if you want to make per-user configurations you do it in ~/.config/openbox/autostart. To configure openbox in some way for all users you would do it in /etc/xdg/openbox/autostart, which is run before the autostart in the user's $HOME.
The docs contradict each other on several points. The man page says the openbox command runs openbox-session, while the openbox wiki says "openbox" alone will not run the autostart script.
The man page says if there is a ~/.config/openbox/autostart then that will be used instead of /etc/xdg/openbox autostart, but the wiki says the /etc... autostart is run first, then ~/.config...
EDIT: The openbox wiki is correct, the manual page for openbox is wrong.
If "exec openbox" is run from .xinitrc no autostart file is run either from ~/.config/openbox or /etc/xdg.
Using "exec openbox-session" in .xinitrc runs autostart files in both locations.
Last edited by sonoran (2013-12-15 14:41:33)
Offline
i wrote "should", not "must".
agreed, on a multi-user setup it's abit different. somehow i don't think that that is op's situation.
If "exec openbox" is run from .xinitrc no autostart file is run either from ~/.config/openbox or /etc/xdg.
Using "exec openbox-session" in .xinitrc runs autostart files in both locations.
this is an interesting detail. thanks.
but i think it's up to op now.
Offline
here are all the autostart files associated with openbox
usr/lib/openbox/openbox-autostart
usr/lib/openbox/openbox-xdg-autostart
etc/xdg/openbox/autostart
~/.config/openbox/autostarti assume the two usr/lib files are something to do with the actual openbox prgram. the etc/xdg file is the main global file for autostart, and the ~/.config file is the user file.
If "exec openbox" is run from .xinitrc no autostart file is run either from ~/.config/openbox or /etc/xdg.
Using "exec openbox-session" in .xinitrc runs autostart files in both locations.
if this is the case for the .xinitrc file then there lies my problem. i start openbox with exec openbox-session from the .xinitrc file. and seeing as some of the scripts i want to run are window dependent i cannot use any of the .xinitrc options to run those scripts as .xinitrc runs before openbox/window managers.
so my question is this how can i run a bash script when openbox has finished loaded?
Offline
Any "customisations" to the openbox scripts in /etc/xdg and /usr/lib will be overwritten on update of the packages and are there as a set of (working until messed with) sane defaults. Startup scripts should be called (or one-liners written to) ~/.config/openbox
Writing standalone one-liners for autostart is pretty redundant IMHO and would be better left in ~/.config/openbox/autostart
/etc/xdg/openbox/autostart sets up the environment to fire the /etc or $HOME autostart scripts - so if you have mangled those in anyway (permissions? killed -x bit?)you can hardly be surprised they are not working... retain any snippets of code that may be useful and reinstalling a clean openbox with the default scripts inplace may be your best solution and will only take 10 minutes...
Offline
i assume the two usr/lib files are something to do with the actual openbox prgram. the etc/xdg file is the main global file for autostart, and the ~/.config file is the user file.
Right. The two scripts in /usr/lib/openbox actually look for the other configuration scripts so you shouldn't change them. Configuration should be done in ~/.config/openbox/autostart for a single user or /etc/xdg/openbox/autostart for all users. Pacman will put a .pacnew file there if you have made changes - it shouldn't overwrite a config file on an update.
so my question is this how can i run a bash script when openbox has finished loaded?
Check this section of the Arch Wiki: https://wiki.archlinux.org/index.php/Op … g_commands
I don't need any sleep delays in my autostart commands, one of which is feh --bg-tile, but your programs might.
Once you get everything working you can play with running the commands as bash scripts, if you insist. ![]()
Offline
ok, i think the "don't mess around" part is covered good.
if this is the case for the .xinitrc file then there lies my problem. i start openbox with exec openbox-session from the .xinitrc file. and seeing as some of the scripts i want to run are window dependent i cannot use any of the .xinitrc options to run those scripts as .xinitrc runs before openbox/window managers.
NO. i also have "exec openbox-session" in there. and it parses ~/.config/openbox/autostart.
so for gods sake, after you have cleaned your system, put your scripts in autostart.
BUT
i'll just point out again what i've written before:
if you installed openbox as part of a desktop environment like lxde, things are a bit different.
i know this for a fact, i just don't know how exactly different.
Last edited by ondoho (2013-12-16 19:06:45)
Offline
f you installed openbox as part of a desktop environment like lxde, things are a bit different.
i know this for a fact, i just don't know how exactly different.
LXDE [and possibly other DE when utilising openbox as WM] create their own "profile" and read their own config files eg ~/.config/openbox/lxde-rc.xml instead of a vanilla ~/.config/openbox/rc.xml. It is all covered in the wiki quite comprehensively. Likewise when combined with a session manager (LXDM, LightDM etc) other startup options, locations and scripts come available - again covered in the wiki.
Offline
changing exec openbox to exec openbox-session in ~/.xinitrc and installing pyxdg solved the problem.
thank you all for your help.
Last edited by spiritech (2013-12-25 06:56:46)
Offline
Ehmm... glad you got it working, but that's definitely not what did it. ~/.config/openbox/autostart runs after openbox starts, so putting exec openbox-session in there makes no sense at all.
Offline
Ehmm... glad you got it working, but that's definitely not what did it. ~/.config/openbox/autostart runs after openbox starts, so putting exec openbox-session in there makes no sense at all.
yes your right no sense at all. exec openbox-session in ~/.xinitrc not ~/.config/openbox/autostart.
post corrected ty.
i now have my script "~/path/to/script" in "~/.config/openbox/autostart"
[random chat]the actuall script contains
#!/bin/bash
~/spiritech-desktop/set-key-map.sh
~/spiritech-desktop/audio.sh
~/spiritech-desktop/background-changer.sh
~/spiritech-desktop/cairo-dock.sh
~/spiritech-desktop/x-composite-manager.sh
~/spiritech-desktop/printer.shthe reason i have the script in my home folder is that i find it easier to access than having the commands, or paths to scripts in the ~/.config/openbox/autostart.[/random chat]
Last edited by spiritech (2013-12-25 07:09:15)
Offline