LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 02-15-2014, 09:00 PM   #1
KYJazzyJeff
Member
 
Registered: Jun 2012
Location: Louisville, KY, USA
Distribution: Fedora 32
Posts: 85

Rep: Reputation: Disabled
openbox is ignoring my autostart script.


I have it saved as an executable, with the .sh suffix and stored in the $HOME/.config/openbox/ directory. I also made sure that none of my lines of code are commented out. Here's what I have in there so far:

wbar &
nitrogen --restore &

Running this script manually (clicking on it in a file manager) works, but it is completely ignored at startup. What gives?
 
Old 02-15-2014, 11:58 PM   #2
Randicus Draco Albus
Senior Member
 
Registered: May 2011
Location: Hiding somewhere on planet Earth.
Distribution: No distribution. OpenBSD operating system
Posts: 1,709
Blog Entries: 8

Rep: Reputation: 634Reputation: 634Reputation: 634Reputation: 634Reputation: 634Reputation: 634
Without any other information to work on, I shall start at the beginning. Did you create a copy of the autostart.sh in ~/.config and add your entries at the end of the file, or did you create an autostart.sh in your home directory with only those two entries? (It took me a while to figure that one out when learning to configure Openbox.) In other words, are
wbar &
nitrogen --restore &
after
Code:
# This shell script is run before Openbox launches.
# Environment variables set here are passed to the Openbox session.

# Set a background color
BG=""
if which hsetroot >/dev/null; then
    BG=hsetroot
else
    if which esetroot >/dev/null; then
    BG=esetroot
    else
    if which xsetroot >/dev/null; then
        BG=xsetroot
    fi
    fi
fi
test -z $BG || $BG -solid "#303030"

# D-bus
if which dbus-launch >/dev/null && test -z "$DBUS_SESSION_BUS_ADDRESS"; then
       eval `dbus-launch --sh-syntax --exit-with-session`
fi

# Make GTK apps look and behave how they were set up in the gnome config tools
if test -x /usr/libexec/gnome-settings-daemon >/dev/null; then
  /usr/libexec/gnome-settings-daemon &
elif which gnome-settings-daemon >/dev/null; then
  gnome-settings-daemon &
# Make GTK apps look and behave how they were set up in the XFCE config tools
elif which xfce-mcs-manager >/dev/null; then
  xfce-mcs-manager n &
fi

# Preload stuff for KDE apps
if which start_kdeinit >/dev/null; then
  LD_BIND_NOW=true start_kdeinit --new-startup +kcminit_startup &
fi

# Run XDG autostart things.  By default don't run anything desktop-specific
# See xdg-autostart --help more info
DESKTOP_ENV="OPENBOX"
if which /usr/lib/openbox/xdg-autostart >/dev/null; then
  /usr/lib/openbox/xdg-autostart $DESKTOP_ENV
fi
 
Old 02-16-2014, 05:37 AM   #3
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 15,305
Blog Entries: 9

Rep: Reputation: 4379Reputation: 4379Reputation: 4379Reputation: 4379Reputation: 4379Reputation: 4379Reputation: 4379Reputation: 4379Reputation: 4379Reputation: 4379Reputation: 4379
i think it should be just "autostart", not "autostart.sh".

also, depending on your distro and desktop environment openbox might choose not to parse it at login, or a different file.
 
Old 02-16-2014, 08:28 AM   #4
KYJazzyJeff
Member
 
Registered: Jun 2012
Location: Louisville, KY, USA
Distribution: Fedora 32
Posts: 85

Original Poster
Rep: Reputation: Disabled
FYI: I have it stored in $HOME/.config/openbox/ as autostart.sh which never existed in this directory in the first place, so I copied a file with the same name and attributes from WindowMaker, and made changes to that.
 
Old 02-16-2014, 09:15 AM   #5
berbae
Member
 
Registered: Jul 2005
Location: France
Distribution: Arch Linux
Posts: 540

Rep: Reputation: Disabled
For the autostart script to be used, you need to start openbox with the 'openbox-session' command not just 'openbox'.
 
Old 02-16-2014, 12:08 PM   #6
KYJazzyJeff
Member
 
Registered: Jun 2012
Location: Louisville, KY, USA
Distribution: Fedora 32
Posts: 85

Original Poster
Rep: Reputation: Disabled
OK then, how do I tell WattOS to start openbox in this manner? I've been looking all over for ways to modify the login/startup options in WattOS but haven't had much luck. WattOS comes pre-loaded with launchers for:

LXDE
openbox
XFCE
ios
WindowMaker
FVWM
IceWM
awesome

Notice I said launchers because only LXDE and openbox are fully installed. The rest of the launchers are simply placeholders for those window managers and require the user to go get the packages for the desired window manager and install them. So how do I add/remove window managers to/from this list or alter their startup commands, as I need to with openbox?
 
Old 02-16-2014, 01:31 PM   #7
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 15,305
Blog Entries: 9

Rep: Reputation: 4379Reputation: 4379Reputation: 4379Reputation: 4379Reputation: 4379Reputation: 4379Reputation: 4379Reputation: 4379Reputation: 4379Reputation: 4379Reputation: 4379
Quote:
Originally Posted by KYJazzyJeff View Post
I copied a file with the same name and attributes from WindowMaker, and made changes to that.
ooooh, hold the horses!
can you just post the whole file here, please?
 
Old 02-16-2014, 08:44 PM   #8
KYJazzyJeff
Member
 
Registered: Jun 2012
Location: Louisville, KY, USA
Distribution: Fedora 32
Posts: 85

Original Poster
Rep: Reputation: Disabled
OK, here's what it looks like:

!/bin/sh
#
# These things are run when an Openbox X Session is started.
# You may place a similar script in $HOME/.config/openbox/autostart
# to run user-specific things.
#

# If you want to use GNOME config tools...
#
#if test -x /usr/lib/openbox/gnome-settings-daemon >/dev/null; then
# /usr/lib/openbox/gnome-settings-daemon &
#elif which gnome-settings-daemon >/dev/null; then
# gnome-settings-daemon &
#fi

# If you want to use XFCE config tools...
#
#xfce-mcs-manager &

nitrogen --restore &
wbar

Everything before 'nitrogen --restore &' is original. Is $HOME/.config/openbox/autostart somehow referring to a directory by that name? If so, maybe I need to add that and put this in there.
 
Old 02-17-2014, 05:49 PM   #9
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 15,305
Blog Entries: 9

Rep: Reputation: 4379Reputation: 4379Reputation: 4379Reputation: 4379Reputation: 4379Reputation: 4379Reputation: 4379Reputation: 4379Reputation: 4379Reputation: 4379Reputation: 4379
Quote:
Originally Posted by ondoho View Post
i think it should be just "autostart", not "autostart.sh".
have you actually tried that?
Quote:
also, depending on your distro and desktop environment openbox might choose not to parse it at login, or a different file.
so it's wattos. which i'm not familiar with.
doesn't it have some gui in the menu for Startup Applications or something like that? it should.
does it have to be openbox' autostart?
i'm using plain openbox as a graphical desktop environment, and openbox parses the file allright.
i'll say it again, if you are logging into some xxxxx-session (lxde?), then i do not know if openbox even parses autostart, but there are certainly (100%) other ways to autostart applications.
 
Old 04-13-2014, 08:06 PM   #10
the dsc
Member
 
Registered: May 2009
Distribution: Debian
Posts: 165
Blog Entries: 199

Rep: Reputation: 46
Quote:
Originally Posted by KYJazzyJeff View Post
OK then, how do I tell WattOS to start openbox in this manner? I've been looking all over for ways to modify the login/startup options in WattOS but haven't had much luck. WattOS comes pre-loaded with launchers for:

LXDE
openbox
XFCE
ios
WindowMaker
FVWM
IceWM
awesome

Notice I said launchers because only LXDE and openbox are fully installed. The rest of the launchers are simply placeholders for those window managers and require the user to go get the packages for the desired window manager and install them. So how do I add/remove window managers to/from this list or alter their startup commands, as I need to with openbox?
Are these "launchers" on a Display Manager (a graphical "log-in screen")?

If they are, you got to find out which one WattOS uses by default (if you haven't changed it) and it's configuration file, which possibly has just "openbox" instead of "openbox-session", as others previously mentioned. Google says its "lightdm". Some ubuntu manual page says the config file is "/etc/lightdm/lightdm.conf". There must be some line with "openbox" there, possibly mentioning it twice, one for the "label", other for the command. I'm just guessing here, it's just the way things usually are.

Last edited by the dsc; 04-13-2014 at 08:10 PM.
 
Old 12-07-2016, 05:09 PM   #11
tech-support
LQ Newbie
 
Registered: Aug 2016
Posts: 21

Rep: Reputation: Disabled
I have the same problem where ubuntu ignores the autostart file, which seems to be the difference in the invocation of 'openbox' or 'openbox-session.' Where in /etc/ can one find the ubuntu session login configuration?

Thanks in advance
 
Old 12-18-2016, 11:15 AM   #12
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 15,305
Blog Entries: 9

Rep: Reputation: 4379Reputation: 4379Reputation: 4379Reputation: 4379Reputation: 4379Reputation: 4379Reputation: 4379Reputation: 4379Reputation: 4379Reputation: 4379Reputation: 4379
Quote:
Originally Posted by tech-support View Post
I have the same problem where ubuntu ignores the autostart file, which seems to be the difference in the invocation of 'openbox' or 'openbox-session.'
invoking
Code:
exec openbox
will NOT parse ~/.config/openbox/autostart.
Code:
exec openbox-session
WILL. plus xdg autostart stuff.

i think that lxde (which uses openbox) is set up in a way that it does NOT parse ~/.config/openbox/autostart.

if your concern is autostarting applications, you are not dependent on ~/.config/openbox/autostart; no need to poke around in /etc.
 
Old 12-18-2016, 11:49 AM   #13
FredGSanford
Senior Member
 
Registered: Nov 2005
Location: USA
Distribution: Mageia 7 - Debian 10 - Artix Linux
Posts: 1,142
Blog Entries: 5

Rep: Reputation: 207Reputation: 207Reputation: 207
If you're using a Display Manager to log into WattsOS, does it offer an option befofe signing in to choose which session to use? Such as LXDE or Openbox? If so, choose Openbox and it should begin the session with it, then the autostart file should proceed.
 
Old 12-19-2016, 12:02 AM   #14
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 9,764

Rep: Reputation: 4408Reputation: 4408Reputation: 4408Reputation: 4408Reputation: 4408Reputation: 4408Reputation: 4408Reputation: 4408Reputation: 4408Reputation: 4408Reputation: 4408
Quote:
Originally Posted by tech-support View Post
I have the same problem where ubuntu ignores the autostart file, which seems to be the difference in the invocation of 'openbox' or 'openbox-session.' Where in /etc/ can one find the ubuntu session login configuration?

Thanks in advance
I don't know what you're asking, but all the OpenBox config files in /etc are here:

Code:
/etc/xdg/openbox/
 
Old 12-19-2016, 04:12 AM   #15
jamison20000e
Senior Member
 
Registered: Nov 2005
Location: ...uncanny valley... infinity\1975; (randomly born:) Milwaukee, WI, US( + travel,) Earth( I wish,) END BORDER$!◣◢┌∩┐ Fe26-E,e...
Distribution: any GPL that works well on my cheapest; has been KDE or CLI but open... http://goo.gl/NqgqJx &c ;-)
Posts: 4,006
Blog Entries: 3

Rep: Reputation: 1359Reputation: 1359Reputation: 1359Reputation: 1359Reputation: 1359Reputation: 1359Reputation: 1359Reputation: 1359Reputation: 1359Reputation: 1359
Hi. Here's another direction:
Code:
crontab -e
Code:
@reboot ~/autostart.sh
https://www.cyberciti.biz/faq/linux-...system-reboot/
 
  


Reply

Tags
openbox


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] "Permission denied" when Openbox tries to execute autostart.sh in ~/.config/openbox alarazr Linux - Software 4 10-04-2012 03:50 PM
[SOLVED] Openbox runs lots of stuff (not set on autostart) at startup after the last upgrade the dsc Linux - Desktop 1 01-03-2012 05:14 PM
Openbox autostart.sh and setting alias on openbox start Jelloir Linux - Desktop 1 07-03-2011 03:56 AM
[SOLVED] Question, Openbox autostart on second desktop TobiSGD Linux - Desktop 1 09-15-2010 08:36 PM
[openbox] My autostart.sh file is not restoring things Removed44 Linux - Newbie 4 06-14-2010 09:31 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 09:58 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration