mirror of
https://gitlab.com/dwt1/dotfiles.git
synced 2026-08-09 09:31:14 +10:00
100 lines
5.5 KiB
Bash
Executable File
100 lines
5.5 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
#
|
|
# Script name: dtos-colorscheme
|
|
# Description: Change colorscheme in DTOS.
|
|
# Dependencies: dmenu, dmscripts
|
|
# GitLab: https://www.gitlab.com/dwt1/dtos
|
|
# License: https://www.gitlab.com/dwt1/dtos/LICENSE
|
|
# Contributors: Derek Taylor
|
|
|
|
# Set with the flags "-e", "-u","-o pipefail" cause the script to fail
|
|
# if certain things happen, which is a good thing. Otherwise, we can
|
|
# get hidden bugs that are hard to discover.
|
|
set -euo pipefail
|
|
|
|
# shellcheck disable=SC1091
|
|
source "$HOME/.config/dmscripts/config"
|
|
|
|
options=("doom-one"
|
|
"dracula"
|
|
"gruvbox-dark"
|
|
"monokai-pro"
|
|
"nord"
|
|
"oceanic-next"
|
|
"palenight"
|
|
"solarized-dark"
|
|
"solarized-light"
|
|
"tomorrow-night")
|
|
|
|
choice=$(printf '%s\n' "${options[@]}" | ${DMENU} 'Choose color scheme:' "${@}")
|
|
|
|
if [[ $choice = "doom-one" ]]; then
|
|
## EMACS ##
|
|
sed -i "s/load-theme '.*/load-theme 'doom-one t)/g" "$HOME"/.config/emacs/config.org || echo "Cannot find config.org."
|
|
emacsclient -e "(load-theme 'doom-one t)" || echo "Emacsclient not running."
|
|
## ALACRITTY ##
|
|
sed -i "s/^colors: .*/colors: \*$choice/g" "$HOME"/.config/alacritty/alacritty.yml || echo "Error setting Alacritty colors"
|
|
elif [[ $choice = "dracula" ]]; then
|
|
## EMACS ##
|
|
sed -i "s/load-theme '.*/load-theme 'doom-dracula t)/g" "$HOME"/.config/emacs/config.org || echo "Cannot find config.org."
|
|
emacsclient -e "(load-theme 'doom-dracula t)" || echo "Emacsclient not running."
|
|
## ALACRITTY ##
|
|
sed -i "s/^colors: .*/colors: \*$choice/g" "$HOME"/.config/alacritty/alacritty.yml || echo "Error setting Alacritty colors"
|
|
elif [[ $choice = "gruvbox-dark" ]]; then
|
|
## EMACS ##
|
|
sed -i "s/load-theme '.*/load-theme 'doom-gruvbox t)/g" "$HOME"/.config/emacs/config.org || echo "Cannot find config.org."
|
|
emacsclient -e "(load-theme 'doom-gruvbox t)" || echo "Emacsclient not running."
|
|
## ALACRITTY ##
|
|
sed -i "s/^colors: .*/colors: \*$choice/g" "$HOME"/.config/alacritty/alacritty.yml || echo "Error setting Alacritty colors"
|
|
elif [[ $choice = "monokai-pro" ]]; then
|
|
## EMACS ##
|
|
sed -i "s/load-theme '.*/load-theme 'doom-monokai-pro t)/g" "$HOME"/.config/emacs/config.org || echo "Cannot find config.org."
|
|
emacsclient -e "(load-theme 'doom-monokai-pro t)" || echo "Emacsclient not running."
|
|
## ALACRITTY ##
|
|
sed -i "s/^colors: .*/colors: \*$choice/g" "$HOME"/.config/alacritty/alacritty.yml || echo "Error setting Alacritty colors"
|
|
elif [[ $choice = "nord" ]]; then
|
|
## EMACS ##
|
|
sed -i "s/load-theme '.*/load-theme 'doom-nord t)/g" "$HOME"/.config/emacs/config.org || echo "Cannot find config.org."
|
|
emacsclient -e "(load-theme 'doom-nord t)" || echo "Emacsclient not running."
|
|
## ALACRITTY ##
|
|
sed -i "s/^colors: .*/colors: \*$choice/g" "$HOME"/.config/alacritty/alacritty.yml || echo "Error setting Alacritty colors"
|
|
elif [[ $choice = "oceanic-next" ]]; then
|
|
## EMACS ##
|
|
sed -i "s/load-theme '.*/load-theme 'doom-oceanic-next t)/g" "$HOME"/.config/emacs/config.org || echo "Cannot find config.org."
|
|
emacsclient -e "(load-theme 'doom-oceanic-next t)" || echo "Emacsclient not running."
|
|
## ALACRITTY ##
|
|
sed -i "s/^colors: .*/colors: \*$choice/g" "$HOME"/.config/alacritty/alacritty.yml || echo "Error setting Alacritty colors"
|
|
elif [[ $choice = "palenight" ]]; then
|
|
## EMACS ##
|
|
sed -i "s/load-theme '.*/load-theme 'doom-palenight t)/g" "$HOME"/.config/emacs/config.org || echo "Cannot find config.org."
|
|
emacsclient -e "(load-theme 'doom-palenight t)" || echo "Emacsclient not running."
|
|
## ALACRITTY ##
|
|
sed -i "s/^colors: .*/colors: \*$choice/g" "$HOME"/.config/alacritty/alacritty.yml || echo "Error setting Alacritty colors"
|
|
elif [[ $choice = "solarized-dark" ]]; then
|
|
## EMACS ##
|
|
sed -i "s/load-theme '.*/load-theme 'doom-solarized-dark t)/g" "$HOME"/.config/emacs/config.org || echo "Cannot find config.org."
|
|
emacsclient -e "(load-theme 'doom-solarized-dark t)" || echo "Emacsclient not running."
|
|
## ALACRITTY ##
|
|
sed -i "s/^colors: .*/colors: \*$choice/g" "$HOME"/.config/alacritty/alacritty.yml || echo "Error setting Alacritty colors"
|
|
elif [[ $choice = "solarized-light" ]]; then
|
|
## EMACS ##
|
|
sed -i "s/load-theme '.*/load-theme 'doom-solarized-light t)/g" "$HOME"/.config/emacs/config.org || echo "Cannot find config.org."
|
|
emacsclient -e "(load-theme 'doom-solarized-light t)" || echo "Emacsclient not running."
|
|
## ALACRITTY ##
|
|
sed -i "s/^colors: .*/colors: \*$choice/g" "$HOME"/.config/alacritty/alacritty.yml || echo "Error setting Alacritty colors"
|
|
elif [[ $choice = "tomorrow-night" ]]; then
|
|
## EMACS ##
|
|
sed -i "s/load-theme '.*/load-theme 'doom-tomorrow-night t)/g" "$HOME"/.config/emacs/config.org || echo "Cannot find config.org."
|
|
emacsclient -e "(load-theme 'doom-tomorrow-night t)" || echo "Emacsclient not running."
|
|
## ALACRITTY ##
|
|
sed -i "s/^colors: .*/colors: \*$choice/g" "$HOME"/.config/alacritty/alacritty.yml || echo "Error setting Alacritty colors"
|
|
fi
|
|
|
|
if [ "$choice" ]; then
|
|
## QTILE ##
|
|
sed -i "s/^colors = colors.*/colors = colors.$choice/g" "$HOME"/.config/qtile/config.py || echo "Cannot find colors = colors."
|
|
sed -i "s/^colors=colors.*/colors = colors.$choice/g" "$HOME"/.config/qtile/config.py || echo "Cannot find colors=colors."
|
|
sed -i "s/^COLORSCHEME=.*/COLORSCHEME=$choice/g" "$HOME"/.config/qtile/autostart.sh || echo "Cannot find COLORSCHEME."
|
|
qtile cmd-obj -o cmd -f restart && $HOME/.config/qtile/autostart.sh || echo "Qtile not running"
|
|
fi
|