sudo touch ~/.config/openbox/autostart.sh
sudo chmod +x ~/.config/openbox/autostart.sh
sudo nano ~/.config/openbox/autostart.sh
(add the following line to the file)
# to set the screen resolution. To determine all the supported
resolutions on your system execute the command 'xrandr' from terminal
#xrandr -s 1360x768 &
#Activate num lock on boot
numlockx &
# to launch the xfce panel
xfce4-panel &
# to set random wallpaper from the specified location
feh --randomize --bg-fill /usr/share/backgrounds/* &
# to run xautolock to lock the screen after inactivity
xautolock -time 10 -locker /usr/local/bin/lock -corners +0-0 -cornerdelay 5 -cornerredelay 5 -detectsleep -secure &
Consider this grey area as a comment section, only for this part of the code and is mean to elaborate and explain how the above command works. This may or many not be part of the script, but if it is included in the script, this shall always remain commented.
{{
-corners 00+-
+ indicates the xautolock should start
- indicates the xautolock should not start
0 indicates the xautolock should ignore and do nothing
Corners are configured in order : top left, top right, bottom left, bottom right
So, in the above command -corners 00+- indicates as follows
0 --> top left
0 --> top right
+ --> bottom left
- --> bottom right
which means that
- when the mouse cursor is placed to the bottom left and the parameter being '+' the xautolock will starts in the specified seconds for 'cornerdelay' even if the default timer of 10mins is specified.
- when the mouse cursor is placed to the bottom right and the parameter being '-' the xautolock will not activate even if the default timer of 10mins is specified.
- the top left and top right corners will not do anything as the parameter specified for them is '0' and that the default timer of 10mins will take effect.
}}
(save and exit --> Ctrl-O, enter, Ctrl-X, enter)
-run the command (without quotes) in the terminal to make the changes effective 'openbox --reconfigure'