-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
86 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,34 @@ | ||
function change_appearance --argument appearance_setting | ||
set -l appearance light # default value | ||
if test -z $appearance_setting | ||
set -l val (defaults read -g AppleInterfaceStyle) >/dev/null | ||
if test $status -eq 0 | ||
set appearance dark | ||
set -l appearance light # default value | ||
if test -z $appearance_setting | ||
set -l val (defaults read -g AppleInterfaceStyle) >/dev/null | ||
if test $status -eq 0 | ||
set appearance dark | ||
end | ||
else | ||
switch $appearance_setting | ||
case light | ||
osascript -l JavaScript -e "Application('System Events').appearancePreferences.darkMode = false" >/dev/null | ||
set appearance light | ||
case dark | ||
osascript -l JavaScript -e "Application('System Events').appearancePreferences.darkMode = true" >/dev/null | ||
set appearance dark | ||
end | ||
end | ||
else | ||
switch $appearance_setting | ||
case light | ||
osascript -l JavaScript -e "Application('System Events').appearancePreferences.darkMode = false" >/dev/null | ||
set appearance light | ||
case dark | ||
osascript -l JavaScript -e "Application('System Events').appearancePreferences.darkMode = true" >/dev/null | ||
set appearance dark | ||
end | ||
end | ||
|
||
# change neovim | ||
for addr in (ls $(echo $TMPDIR)nvim.$(echo $USER)/*/nvim.*.0) | ||
switch $appearance | ||
case dark | ||
nvim --server $addr --remote-send ':set background=dark<CR>' | ||
case light | ||
nvim --server $addr --remote-send ':set background=light<CR>' | ||
# change neovim | ||
for addr in (ls $(echo $TMPDIR)nvim.$(echo $USER)/*/nvim.*.0) | ||
switch $appearance | ||
case dark | ||
nvim --server $addr --remote-send ':set background=dark<CR>' | ||
case light | ||
nvim --server $addr --remote-send ':set background=light<CR>' | ||
end | ||
end | ||
end | ||
|
||
# change and reload ghostty appearance | ||
# https://github.com/mitchellh/ghostty/issues/601 | ||
# change and reload ghostty appearance | ||
# https://github.com/mitchellh/ghostty/issues/601 | ||
|
||
# change tmux | ||
# switch $appearance | ||
# case dark | ||
# tmux source-file ~/.tmux/tmux-dark.conf | ||
# case light | ||
# tmux source-file ~/.tmux/tmux-light.conf | ||
# end | ||
# change zellij theme | ||
# zelijj options --theme $appearance | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters