You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
63 lines
1.3 KiB
Bash
63 lines
1.3 KiB
Bash
#!/bin/bash
|
|
###
|
|
# This file is part of the code-cloppers openbox setup. Use at your own risk.
|
|
#
|
|
# This script should setup openbox for a user on ubuntu
|
|
|
|
is-in-path() {
|
|
which "$1" &>>/dev/null
|
|
}
|
|
|
|
install-apt-dependencies() {
|
|
echo "=> Installing apt dependencies"
|
|
set -x
|
|
sudo apt-get update && \
|
|
sudo apt-get install xcompmgr openbox albert plank
|
|
set +x
|
|
|
|
}
|
|
|
|
install-dependencies() {
|
|
echo "=> Checking dependencies"
|
|
if ! is-in-path xcompmgr || ! is-in-path openbox; then
|
|
install-apt-dependencies
|
|
fi
|
|
}
|
|
|
|
here() {
|
|
dirname "$(readlink -f "${BASH_SOURCE[0]}")"
|
|
}
|
|
|
|
config-dir() {
|
|
echo "$HOME/.config/openbox"
|
|
}
|
|
|
|
copy-config() {
|
|
declare config_dir=''
|
|
config_dir="$(config-dir)"
|
|
|
|
echo "=> Copying config"
|
|
|
|
[[ -d "$config_dir" ]] || mkdir -p "$config_dir"
|
|
cp -r "$(here)/config/"* "$config_dir"/
|
|
}
|
|
|
|
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 'source "%s"\n' "$startup_file" >> "$(config-dir)/autostart.sh"
|
|
}
|
|
|
|
setup-openbox-for-user() {
|
|
install-dependencies
|
|
copy-config
|
|
add-custom-startup
|
|
|
|
echo "=> Finished"
|
|
}
|
|
|
|
setup-openbox-for-user
|