32 lines
1.3 KiB
Bash
Executable file
32 lines
1.3 KiB
Bash
Executable file
#!/usr/bin/env bash
|
|
|
|
set_fzf_theme() {
|
|
# Detect the current system appearance (Light or Dark mode) for Linux and macOS
|
|
if [[ "$OSTYPE" == "darwin"* ]]; then
|
|
# macOS
|
|
APPEARANCE=$(defaults read -g AppleInterfaceStyle 2>/dev/null)
|
|
elif [[ "$OSTYPE" == "linux-gnu"* ]]; then
|
|
# Linux
|
|
APPEARANCE=$(gsettings get org.gnome.desktop.interface gtk-theme 2>/dev/null)
|
|
else
|
|
# Default to Light mode if the system is not recognized
|
|
APPEARANCE="Dark"
|
|
fi
|
|
|
|
# Set fzf theme based on system appearance
|
|
if [[ $APPEARANCE == *"Dark"* || -n "$TMUX" ]]; then
|
|
FZF_THEME="--color=bg+:#1e1e1e,bg:#1e1e1e,spinner:#d33682,hl:#b58900,fg:#ffffff,header:#d33682,info:#268bd2,pointer:#859900,marker:#859900,fg+:#ffffff,prompt:#268bd2,hl+:#b58900"
|
|
else
|
|
# FZF_THEME="--color=bg+:#fdf6e3,bg:#fdf6e3,spinner:#d33682,hl:#b58900,fg:#657b83,header:#d33682,info:#268bd2,pointer:#859900,marker:#859900,fg+:#657b83,prompt:#268bd2,hl+:#b58900"
|
|
|
|
FZF_THEME="--color=bg+:#fdf6e3,bg:#fdf6e3,spinner:#d33682,hl:#b58900,fg:#657b83,header:#d33682,info:#268bd2,pointer:#859900,marker:#859900,fg+:#657b83,prompt:#268bd2,hl+:#b58900"
|
|
fi
|
|
|
|
echo "$FZF_THEME"
|
|
}
|
|
|
|
# If sourced directly, set FZF_THEME
|
|
if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
|
|
set_fzf_theme
|
|
fi
|
|
|