|
|
|
@ -89,8 +89,6 @@ copy-config() {
|
|
|
|
|
|
|
|
|
|
add-custom-startup() {
|
|
|
|
|
declare startup_file=''
|
|
|
|
|
read -rep "Please provide a path to a custom startup script for your sessions (default: ~/.startup):" \
|
|
|
|
|
startup_file
|
|
|
|
|
|
|
|
|
|
[[ -z $startup_file ]] && startup_file="$HOME/.startup"
|
|
|
|
|
printf '. "%s"\n' "$startup_file" >> "$(config-dir openbox)/autostart.sh"
|
|
|
|
@ -165,6 +163,43 @@ copy-themes-to-theme-dir() {
|
|
|
|
|
cp -r "$(here)/themes"/* "$(theme-dir)/"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
create-user-config-if-not-created() {
|
|
|
|
|
if ! [[ -f ~/.code-clopper-ob ]]; then
|
|
|
|
|
echo '=> Creating user config'
|
|
|
|
|
echo -n > ~/.code-clopper-ob
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
config-get() {
|
|
|
|
|
declare -u value_name="$1"
|
|
|
|
|
grep -Po '(?<=^'"$value_name"'=")[^"]+(?="$)' ~/.code-clopper-ob
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
config-has() {
|
|
|
|
|
config-get "$1" &>>/dev/null
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
config-add() {
|
|
|
|
|
declare -u value_name="$1"
|
|
|
|
|
declare value="$2"
|
|
|
|
|
printf '%s="%s"\n' "$value_name" "$value" >> ~/.code-clopper-ob
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
check-config() {
|
|
|
|
|
declare startup_script=''
|
|
|
|
|
|
|
|
|
|
if ! config-has startup_script; then
|
|
|
|
|
read -rep "Please provide a path to a custom startup script for your sessions (default: ~/.startup):" \
|
|
|
|
|
startup_script
|
|
|
|
|
|
|
|
|
|
if [[ -z $startup_script ]]; then
|
|
|
|
|
startup_script="$HOME/.startup"
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
config-add startup_script "$startup_script"
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
setup-openbox-for-user() {
|
|
|
|
|
add-ppas
|
|
|
|
|
install-dependencies
|
|
|
|
@ -175,6 +210,8 @@ setup-openbox-for-user() {
|
|
|
|
|
copy-bins-to-local-dir
|
|
|
|
|
copy-libs-to-local-dir
|
|
|
|
|
copy-themes-to-theme-dir
|
|
|
|
|
create-user-config-if-not-created
|
|
|
|
|
check-config
|
|
|
|
|
add-custom-startup
|
|
|
|
|
|
|
|
|
|
echo '=> Finished. You might want to run "openbox --restart" ' \
|
|
|
|
|