diff --git a/setup.bash b/setup.bash index 79c8790..40bd5d0 100755 --- a/setup.bash +++ b/setup.bash @@ -24,7 +24,8 @@ install-apt-dependencies() { vorbis-tools \ sound-theme-freedesktop \ terminator \ - xscreensaver + xscreensaver \ + nitrogen set +x } @@ -41,7 +42,7 @@ asset-dirs-exist() { install-dependencies() { echo "=> Checking dependencies" - if ! are-in-path xcompmgr openbox dunst ogg123 terminator xscreensaver \ + if ! are-in-path xcompmgr openbox dunst ogg123 terminator xscreensaver nitrogen \ || ! asset-dirs-exist; then install-apt-dependencies fi @@ -198,6 +199,23 @@ check-config() { config-add startup_script "$startup_script" fi + + if ! config-has desktop_background; then + read -rep "Pleade provide a file to use as desktop background, leave blank for none: " \ + background + + if [[ -z $background ]]; then + config-add desktop_background none + else + config-add desktop_background "$background" + fi + fi +} + +add-custom-background() { + if [[ $(config-get background) != 'none' ]]; then + printf 'nitrogen --set-auto %s\n' "$(config-get background)" >> "$(config-dir openbox)/autostart.sh" + fi } setup-openbox-for-user() { @@ -213,6 +231,7 @@ setup-openbox-for-user() { create-user-config-if-not-created check-config add-custom-startup + add-custom-background echo '=> Finished. You might want to run "openbox --restart" ' \ '(or for initial setup "openbox --exit" and then login again)'