-
Notifications
You must be signed in to change notification settings - Fork 2
Implement automatic light/dark mode switching for Ghostty, Neovim, and Zellij with Tokyo Night and GitHub themes #108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Co-authored-by: bdossantos <245284+bdossantos@users.noreply.github.com>
.config/nvim/lua/config/autocmds.lua
Outdated
| if mode == "light" then | ||
| return "github_light" | ||
| else | ||
| return "dracula" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot could you replace Dracula by github_dark_high_contrast ? thx
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done! I've replaced Dracula with github_dark_high_contrast for all Neovim configurations. The changes include:
- Updated theme detection in autocmds.lua (lines 138 and 149)
- Updated theme-mode script for nvim-dark output
- Updated colorscheme plugin configuration to use github_dark_high_contrast
- Removed Dracula plugin dependency since we now use github-nvim-theme for both light and dark modes
- Updated lazy.lua fallback colorschemes
Commit: eb70ff6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot Is possible to also switch Zellij theme from dark to light ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes! I've added automatic light/dark mode switching for Zellij theme. The implementation includes:
- Extended
theme-modescript to supportzellij-light(returns "default") andzellij-dark(returns "dracula") - Created
bin/set-zellij-themescript for automatic theme switching - Integrated theme switching into
.bashrcbefore Zellij session attachment - Uses "default" theme for light mode and "dracula" theme for dark mode
The theme switching now works automatically when starting new shells, just like Ghostty. You can also manually trigger it with ~/.dotfiles/bin/set-zellij-theme.
Commit: 53314ae
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot could you replace github_dark_high_contrast by Tokyo night dark and GitHub light high contrast by Tokyo night light ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done! I've replaced the GitHub themes with Tokyo Night themes for Neovim:
github_dark_high_contrast→tokyonight-nightgithub_light_high_contrast→tokyonight-day
The changes include:
- Updated colorscheme plugin from
github-nvim-themetotokyonight.nvim - Updated theme-mode script to return Tokyo Night theme names
- Updated autocmds.lua and colorscheme.lua with new theme names
- Updated lazy.lua fallback colorschemes
All automatic theme switching functionality remains the same, now using Tokyo Night themes.
Commit: e237db7
Co-authored-by: bdossantos <245284+bdossantos@users.noreply.github.com>
| handle:close() | ||
|
|
||
| if mode == "light" then | ||
| return "github_light" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot could you please use github_light_high_contrast ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done! I've updated all references from github_light to github_light_high_contrast throughout the codebase. The changes include:
- Updated theme-mode script to return the correct theme name
- Updated Neovim configuration files (colorscheme.lua, autocmds.lua, lazy.lua)
- Updated README documentation
Commit: 89e38e4
Co-authored-by: bdossantos <245284+bdossantos@users.noreply.github.com>
.config/ghostty/config
Outdated
| @@ -1,2 +1,2 @@ | |||
| theme = "dracula" | |||
| theme = "github-light" | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot replace this line by GitHub-Light-High-Contrast
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done! I've replaced the theme with "GitHub-Light-High-Contrast" in both the Ghostty config file and the theme-mode script to maintain consistency. The change ensures that automatic theme switching will use the correct theme name.
Commit: 34a5e6e
Co-authored-by: bdossantos <245284+bdossantos@users.noreply.github.com>
Co-authored-by: bdossantos <245284+bdossantos@users.noreply.github.com>
Co-authored-by: bdossantos <245284+bdossantos@users.noreply.github.com>
This PR adds automatic light/dark mode switching for Ghostty terminal, Neovim editor, and Zellij terminal multiplexer based on the current time of day, providing a more comfortable user experience that adapts to natural lighting patterns across all development tools.
Features
Time-based Theme Switching:
tokyonight-dayfor Neovim,GitHub-Light-High-Contrastfor Ghostty,defaultfor Zellij)tokyonight-nightfor Neovim,draculafor Ghostty and Zellij)Ghostty Integration:
.bashrcNeovim Integration:
tokyonight.nvimplugin for both light and dark modes with Tokyo Night Day/Night themesVimEnterautocmdZellij Integration:
.bashrcdefaulttheme for light mode anddraculatheme for dark modeImplementation
Core Scripts
bin/theme-mode: Time detection utility that returns current mode and theme names for all toolsbin/set-ghostty-theme: Ghostty configuration updater with atomic file operationsbin/set-zellij-theme: Zellij configuration updater with atomic file operationsIntegration Points
.bashrc: Automatic theme switching when launching new shells in Ghostty and ZellijUsage Examples
Theme Consistency
The implementation uses modern, popular themes for optimal readability:
tokyonight-dayfor Neovim,GitHub-Light-High-Contrastfor Ghostty,defaultfor Zellijtokyonight-nightfor Neovim,draculafor Ghostty and ZellijCompatibility
The implementation automatically adapts to the user's daily routine, switching to comfortable themes during both daylight and evening hours across all terminal multiplexers and editors for optimal readability and reduced eye strain.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.