dotfiles/install.sh
Marty Oehme 6ac552d3d5
Switch to wayland
Added a simple wayland configuration.
Currently set up simple wayland configuration based on river window
manager and waybar.
Rivercarro is the layout manager, being the same in principle as rivertile,
the default layout manager for river, only it comes with smart gaps
(gaps turn off if there is only one window open)
and monocle mode (give one window all space).

Runs `keyd` in the background to replace the old `xcape` capslock switching
(capslock is escape and if held control).
Uses `swaybg` to set a wallpaper.

Added powermenu and lockscreen scripts.
Improved lockscreen script to detect and work for wayland.
Moved old rofi mode 'powermenu' to more general powermenu script,
which works with any rofi-like selector (dmenu, bemenu, wofi, etc.)
Loses some of its design quality but since it was wonky anyway,
and I rarely see the menu,
we could repurpose its functionality for a more general powermenu
concept.
Currently hardcoded for `bemenu` but can be easily swapped and possibly
even extended back to rofi.
Fixed file upload link sharing to clipboard.

Updated rofi-pass to pass-pick.
Made rofi-pass universal and less integrated to rofi - that's also the
reason for the name change.
`pass-pick` works with rofi (default), bemenu or dmenu. In theory it
should also work with any other picker that contains a stdin listing
function similar to dmenu.
It has been definitely tested both on rofi and bemenu.
The best user experience still reigns on rofi, where available keys are
displayed on the picker and the keys themselves make the most sense.
But all functions can be reached from bemenu as well, though the key
mappings are more arbitrary and can not be changed as in rofi.
The autofilling tool works with both xdotool and ydotool, so should work
both on X11 and on Wayland. Ydotool ideally requires its daemon to be
running, otherwise some of the typing may get gut off. Otherwise no
change should be necessary.

Updated qutebrowser open_download for bemenu.
Updated download opening script to work with both rofi and bemenu.
Prefers original rofi implementation but works with both, and can be set
to use a custom dmenu-like file picker as well.

Add brightnessctl and removed custom audio / brightness scripts since they
became unnecessary.

Updated bootstrap script to include system files:
With `keyd` taking its configuration from the `/etc` directory and not
home, a second stow stage was necessary. These stow files are in a
module called `system-packages` inside the top-level `bootstrap` stow
package.
They will not be installed by the default dotfile stow invocation but
have been integrated as an extra step into the install script.
Installing this module requires sudo privileges!

Switched vifm überzug to sixel graphics rendering.
überzug relies on X11 functionality to work, while sixel does not.
Unfortunately, alacritty does not work with sixel graphics yet, only
foot does (somewhat).

Waybar currently runs the gruvbox dark soft color scheme.
Added the old polybar archupdates script to waybar and extended it to
output json format with additional metadata that waybar can read.
Can still output the old plaintext format that polybar expects.
Added a wireguard connection to waybar,shows if currently
connected to either a wireguard or tun VPN service.
If so, shows an icon in the waybar - that can be hovered over to show
the full assigned IP address.
Added an upcoming event display to waybar,
a simple event indicator to show upcoming events on the calendar, on
hovering over it the tooltip lists all upcoming events.

Added `screenshot` script to take simple screenshots and
rectangle region shots of the current output.
Can be invoked through the river shortcut PrintScr:
`PrintScr` - Fullscreen screenshot
`Mod+PrintScr` - Region screenshot
`Shift+PrintScr` - Fullscreen screenshot and file upload
`Mod+Shift+PrintScr` - Region screenshot and file upload

Extended `sharefile` to take paths through stdin and make
use of `fd` if it is found on the system.
2021-11-30 22:30:07 +01:00

123 lines
3.7 KiB
Bash
Executable file

#!/usr/bin/env bash
#
# install.sh
#
# Installs dotfiles and packages for my setup.
# Needs to be invoked from containing dotfile directory to work correctly.
#
# Will first install yay, then all my used packages (read from bootstrap/packages.txt)
#
# Finally, symlinks all dotfiles into their correct locations using stow
bootstrap_dir="${BOOTSTRAP_DIRECTORY:-./bootstrap}"
main() {
local cmd=""
local ret=0
case "$1" in
-v | --version)
printf "Personal system bootstrap script.\n\nby Marty Oehme\n\nv0.2\n"
;;
-h | --help)
printf "Usage: install [-f|--force][-v|--version][-h|--help]\n\n-f Do not ask for any confirmations but force update and installation.\n"
;;
-f | --force)
install true
;;
*)
install false
;;
esac
shift
$cmd "$@"
ret=$((ret + $?))
exit $ret
}
# takes default value (y/n), question, abort message as arguments
# automatically answers yes if unattended install
check_consent() {
if [ "$UNATTENDED" == "true" ]; then
true
else
[[ "$1" == "y" ]] && default_consent="[Y/n]" || default_consent="[y/N]"
printf "%s %s " "$2" "$default_consent"
read -r answer
if [[ "$1" == "n" ]] && [[ "$answer" != y* ]]; then
echo first
printf "%s\n" "$3"
false
elif [[ "$1" == "y" ]] && [[ "$answer" == n* ]]; then
echo second
printf "%s\n" "$3"
false
else
true
fi
fi
}
entry_question() {
check_consent n "This will take a while, install many packages and link dotfiles all over the place. Proceed?" "Aborting." || exit
}
enable_git_hooks() {
check_consent y "Should we enable git hooks for this repository, so that installed packages are automatically compared when committing?" "Not changing repository settings." || return
git config --local core.hooksPath .githooks/
echo "Changed repository settings."
}
stow_dotfiles() {
check_consent y "Link home directory dot files?" "Not linking dotfiles." || return
# get all top level directories, remove their slashes and dots
# finally get rid of .dot-directories, since they are for the repo not for my homedir
targets="$(find . -maxdepth 1 -type d | sed -e 's/^\.\/\(.*\)$/\1/' | sed -e '/^\./d')"
# shellcheck disable=2086
# -- for some reason stow only works with unqoted var expansion
stow -R ${targets} 2> >(grep -v 'Absolute/relative mismatch between Stow dir' 1>&2)
echo "Linked dotfiles."
}
stow_system_packages() {
check_consent n "Link system settings as well? This will require sudo access." "Not touching system files." || return
sudo stow --dir="$bootstrap_dir" --target="/" -R system-packages/
echo "Linked system files."
}
install_packages() {
check_consent n "Install pre-designated packages? This will take a while." "Not installing packages." || return
export BOOTSTRAP_PACKAGES="bootstrap/packages.txt"
if ! "$UNATTENDED"; then
"$bootstrap_dir"/install_packages.sh
else
"$bootstrap_dir"/install_packages.sh -f
fi
unset BOOTSTRAP_PACKAGES
echo "Installed packages."
}
install() {
UNATTENDED=$1
if ! "$UNATTENDED"; then
entry_question
fi
echo "====================== BEGINNING INSTALLATION ============================="
install_packages
echo "=================== BEGINNING DOTFILE MANAGEMENT =========================="
stow_dotfiles
stow_system_packages
echo "================== ENABLING GIT REPOSITORY HOOKS =========================="
enable_git_hooks
echo "====================== INSTALLATION FINISHED =============================="
exit 0
}
main "$@"