add theme support for gnome terminal

This commit is contained in:
Mylloon 2023-09-13 13:43:40 +02:00
parent 1dcb9e7308
commit 3c1ce4fccc
Signed by: Anri
GPG key ID: A82D63DFF8D1317F

View file

@ -15,12 +15,24 @@ main() {
if [ $# -eq 0 ]; then if [ $# -eq 0 ]; then
echo "No arguments supplied" echo "No arguments supplied"
else else
local profiles profile
profiles=("$(gsettings get org.gnome.Terminal.ProfilesList list | tr -d \'[],)")
case $1 in case $1 in
"sunset" ) # Go to dark mode "sunset" ) # Go to dark mode
# Set the Dracula theme
set org.gnome.desktop.wm.preferences theme Dracula set org.gnome.desktop.wm.preferences theme Dracula
# Set the Terminal profile
profile="${profiles[0]}"
gsettings set org.gnome.Terminal.ProfilesList default "${profile}"
# Set the fish theme
fish -c "fish_config theme choose 'Base16 Eighties' && yes | fish_config theme save"
;; ;;
"sunrise" ) # Go to light mode "sunrise" ) # Go to light mode
echo "Nothing to do" # Set the Terminal profile
profile="${profiles[1]}"
gsettings set org.gnome.Terminal.ProfilesList default "${profile}"
# Set the fish theme
fish -c "fish_config theme choose 'Solarized Light' && yes | fish_config theme save"
;; ;;
* ) * )
echo "Can't interpret given argument" ;; echo "Can't interpret given argument" ;;