Repository navigation
Expand file tree
/
Copy pathtoggle-theme.sh
More file actions
executable file
·39 lines (35 loc) · 1.85 KB
/
Copy pathtoggle-theme.sh
File metadata and controls
executable file
·39 lines (35 loc) · 1.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/usr/bin/env sh
# Toggle dark and light themes for Linux Mint Mate App, tmux, alacritty,
# nvim and bat
# Thanks to https://shapeshed.com/vim-tmux-alacritty-theme-switcher/
CURRENT_MODE=$(gsettings get org.gnome.desktop.interface color-scheme)
ALACRITTYCONF="./alacritty/.config/alacritty/alacritty.toml"
TMUXCONF="./tmux/.tmux.conf"
BATCONF="./bat/.config/bat/config"
GITCONF="./git/.gitconfig"
VIMCONF="./nvim/.config/nvim/lua/plugins/colorscheme.lua"
ZSHRC="./zsh/.zshrc"
# Toggle logic based on current mode
if [ "$CURRENT_MODE" = "'prefer-dark'" ]; then
gsettings set org.gnome.desktop.interface color-scheme 'default'
sed -i "s/catppuccin-mocha/catppuccin-latte/" "$ALACRITTYCONF"
sed -i "s/@catppuccin_flavour 'mocha'/@catppuccin_flavour 'latte'/" "$TMUXCONF"
sed -i "s/Catppuccin-mocha/Catppuccin-latte/" "$BATCONF"
sed -i "s/features = catppuccin-mocha/features = catppuccin-latte/" "$GITCONF"
sed -i 's/catppuccin-mocha/catppuccin-latte/' "$VIMCONF"
sed -i 's/mocha.yml/latte.yml/' "$ZSHRC" # Lazygit
sed -i 's/XDG:catppuccin-mocha/XDG:catppuccin-latte/' "$ZSHRC" # fast-syntax-highlighting
sed -i 's/CURRENT_MODE="mocha"/CURRENT_MODE="latte"/' "$ZSHRC" # fzf
else
gsettings set org.gnome.desktop.interface color-scheme 'prefer-dark'
sed -i "s/catppuccin-latte/catppuccin-mocha/" "$ALACRITTYCONF"
sed -i "s/@catppuccin_flavour 'latte'/@catppuccin_flavour 'mocha'/" "$TMUXCONF"
sed -i "s/Catppuccin-latte/Catppuccin-mocha/" "$BATCONF"
sed -i "s/features = catppuccin-latte/features = catppuccin-mocha/" "$GITCONF"
sed -i 's/catppuccin-latte/catppuccin-mocha/' "$VIMCONF"
sed -i 's/latte.yml/mocha.yml/' "$ZSHRC" # Lazygit
sed -i 's/XDG:catppuccin-latte/XDG:catppuccin-mocha/' "$ZSHRC" # fast-syntax-highlighting
sed -i 's/CURRENT_MODE="latte"/CURRENT_MODE="mocha"/' "$ZSHRC" # fzf
fi
tmux source-file "$TMUXCONF"
exec zsh