#!/usr/bin/env bash set -euo pipefail # function to select theme function func_seltheme { cmd=(dialog --separate-output --checklist "Select theme (Only select one)" 22 76 16) options=(1 "Nyarch" off # any option can be set to default to "on" 2 "Spaceengine Pink" off) choices=$("${cmd[@]}" "${options[@]}" 2>&1 >/dev/tty) clear for choice in $choices; do case $choice in 1) echo "nyarch" >"$HOME/.seltheme" ;; 2) echo "space-pink" >"$HOME/.seltheme" ;; esac done } # if no seltheme file exists, ask to select a theme if [[ ! -f "$HOME/.seltheme" ]]; then func_seltheme fi #################### #### Arguments #### #################### copy_firefox=0 # handle arguments if [[ "$#" -eq 1 ]]; then # -t/--theme to change theme if [[ "$1" == "-t" || "$1" == "--theme" ]]; then func_seltheme elif [[ "$1" == "-f" || "$1" == "--firefox" ]]; then copy_firefox=1 elif [[ "$#" -gt 1 ]]; then echo "Too many arguments" exit 1 fi cat </tmp/i3config.ini cp /tmp/i3config.ini ~/.config/polybar/i3config.ini # xresources dpi xftdpi="$(cat ~/configs/arch-config/per-device/lupusregina/xresources-dpi-override)" awk -v xftdpi="$xftdpi" '/!per-device dpi insert/{print;print xftdpi;next}1' ~/.Xdefaults >/tmp/.Xdefaults cp /tmp/.Xdefaults ~/.Xdefaults fi cat </dev/null cp "$tempdir/bash-cat-with-cat/cat.sh" "$HOME/scripts/pieces/cat.sh" cat <