mirror of
https://github.com/harivansh-afk/nix.git
synced 2026-04-15 09:01:16 +00:00
feat: lazygit theme (#69)
This commit is contained in:
parent
a7acd0fb2d
commit
38c096dbc1
5 changed files with 84 additions and 23 deletions
|
|
@ -102,6 +102,14 @@ let
|
|||
"@TMUX_DARK_FILE@" = "${tmuxConfigs.dark}";
|
||||
"@TMUX_LIGHT_FILE@" = "${tmuxConfigs.light}";
|
||||
"@TMUX_CONFIG@" = "${config.xdg.configHome}/tmux/tmux.conf";
|
||||
"@LAZYGIT_DIR@" = theme.paths.lazygitDir;
|
||||
"@LAZYGIT_CURRENT_FILE@" = theme.paths.lazygitCurrentFile;
|
||||
"@LAZYGIT_DARK_FILE@" = "${theme.paths.lazygitDir}/config-dark.yml";
|
||||
"@LAZYGIT_LIGHT_FILE@" = "${theme.paths.lazygitDir}/config-light.yml";
|
||||
"@LAZYGIT_DARWIN_DIR@" = "${config.home.homeDirectory}/Library/Application Support/lazygit";
|
||||
"@LAZYGIT_DARWIN_FILE@" = "${config.home.homeDirectory}/Library/Application Support/lazygit/config.yml";
|
||||
"@LAZYGIT_DARWIN_DARK_FILE@" = "${config.home.homeDirectory}/Library/Application Support/lazygit/config-dark.yml";
|
||||
"@LAZYGIT_DARWIN_LIGHT_FILE@" = "${config.home.homeDirectory}/Library/Application Support/lazygit/config-light.yml";
|
||||
"@WALLPAPER_DARK_FILE@" = "${theme.wallpapers.dark}";
|
||||
"@WALLPAPER_LIGHT_FILE@" = "${theme.wallpapers.light}";
|
||||
};
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ link_mode_assets() {
|
|||
fzf_target="@FZF_DARK_FILE@"
|
||||
ghostty_target="@GHOSTTY_DARK_FILE@"
|
||||
tmux_target="@TMUX_DARK_FILE@"
|
||||
lazygit_target="@LAZYGIT_DARK_FILE@"
|
||||
wallpaper="@WALLPAPER_DARK_FILE@"
|
||||
apple_dark_mode=true
|
||||
;;
|
||||
|
|
@ -33,6 +34,7 @@ link_mode_assets() {
|
|||
fzf_target="@FZF_LIGHT_FILE@"
|
||||
ghostty_target="@GHOSTTY_LIGHT_FILE@"
|
||||
tmux_target="@TMUX_LIGHT_FILE@"
|
||||
lazygit_target="@LAZYGIT_LIGHT_FILE@"
|
||||
wallpaper="@WALLPAPER_LIGHT_FILE@"
|
||||
apple_dark_mode=false
|
||||
;;
|
||||
|
|
@ -42,17 +44,25 @@ link_mode_assets() {
|
|||
;;
|
||||
esac
|
||||
|
||||
mkdir -p "@STATE_DIR@" "@FZF_DIR@" "@GHOSTTY_DIR@" "@TMUX_DIR@"
|
||||
mkdir -p "@STATE_DIR@" "@FZF_DIR@" "@GHOSTTY_DIR@" "@TMUX_DIR@" "@LAZYGIT_DIR@"
|
||||
printf '%s\n' "$mode" > "@STATE_FILE@"
|
||||
ln -sfn "$fzf_target" "@FZF_CURRENT_FILE@"
|
||||
ln -sfn "$ghostty_target" "@GHOSTTY_CURRENT_FILE@"
|
||||
ln -sfn "$tmux_target" "@TMUX_CURRENT_FILE@"
|
||||
ln -sfn "$lazygit_target" "@LAZYGIT_CURRENT_FILE@"
|
||||
|
||||
if command -v tmux >/dev/null 2>&1 && tmux start-server >/dev/null 2>&1; then
|
||||
tmux source-file "@TMUX_CONFIG@" >/dev/null 2>&1 || true
|
||||
fi
|
||||
|
||||
if [[ "$(uname -s)" == "Darwin" ]] && command -v osascript >/dev/null 2>&1; then
|
||||
mkdir -p "@LAZYGIT_DARWIN_DIR@"
|
||||
if [[ "$mode" == "dark" ]]; then
|
||||
ln -sfn "@LAZYGIT_DARWIN_DARK_FILE@" "@LAZYGIT_DARWIN_FILE@"
|
||||
else
|
||||
ln -sfn "@LAZYGIT_DARWIN_LIGHT_FILE@" "@LAZYGIT_DARWIN_FILE@"
|
||||
fi
|
||||
|
||||
osascript -e "tell application \"System Events\" to tell appearance preferences to set dark mode to ${apple_dark_mode}" >/dev/null 2>&1 || true
|
||||
|
||||
osascript -e "tell application \"System Events\" to tell every desktop to set picture to \"${wallpaper}\"" >/dev/null 2>&1 || true
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue