fix script and update tmux config
This commit is contained in:
@@ -8,16 +8,15 @@ set -euo pipefail
|
|||||||
|
|
||||||
case "$(uname -s)" in
|
case "$(uname -s)" in
|
||||||
Linux*)
|
Linux*)
|
||||||
sed_command="sed -i"
|
sed_i() { sed -i "$@"; }
|
||||||
;;
|
;;
|
||||||
Darwin*)
|
Darwin*)
|
||||||
sed_command="sed -i ''"
|
sed_i() { sed -i '' "$@"; }
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Unknown platform"
|
echo "Unknown platform"
|
||||||
return 1
|
return 1
|
||||||
;;
|
;;
|
||||||
|
|
||||||
esac
|
esac
|
||||||
|
|
||||||
function switch_alacritty_colors() {
|
function switch_alacritty_colors() {
|
||||||
@@ -28,9 +27,9 @@ function switch_alacritty_colors() {
|
|||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
if grep -q 'dawn' "$config_file"; then
|
if grep -q 'dawn' "$config_file"; then
|
||||||
$sed_command 's/rose-pine-dawn\.toml/rose-pine.toml/g' "$config_file"
|
sed_i 's/rose-pine-dawn\.toml/rose-pine.toml/g' "$config_file"
|
||||||
else
|
else
|
||||||
$sed_command 's/rose-pine\.toml/rose-pine-dawn.toml/g' "$config_file"
|
sed_i 's/rose-pine\.toml/rose-pine-dawn.toml/g' "$config_file"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -42,10 +41,10 @@ function switch_tmux_colors() {
|
|||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
if grep -q '@rose_pine_variant '\''dawn'\''' "$config_file"; then
|
if grep -q '@rose_pine_variant '\''dawn'\''' "$config_file"; then
|
||||||
$sed_command 's/rose_pine_variant '\''dawn'\''/rose_pine_variant '\''main'\''/g' "$config_file"
|
sed_i 's/rose_pine_variant '\''dawn'\''/rose_pine_variant '\''main'\''/g' "$config_file"
|
||||||
tmux source-file ~/.tmux.conf
|
tmux source-file ~/.tmux.conf
|
||||||
else
|
else
|
||||||
$sed_command 's/rose_pine_variant '\''main'\''/rose_pine_variant '\''dawn'\''/g' "$config_file"
|
sed_i 's/rose_pine_variant '\''main'\''/rose_pine_variant '\''dawn'\''/g' "$config_file"
|
||||||
tmux source-file ~/.tmux.conf
|
tmux source-file ~/.tmux.conf
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -60,6 +60,8 @@ set -g @rose_pine_variant 'main' # Options are 'main', 'moon' or 'dawn'
|
|||||||
set -g @rose_pine_date_time '%Y-%m-%d %H:%M '
|
set -g @rose_pine_date_time '%Y-%m-%d %H:%M '
|
||||||
set -g @rose_pine_directory 'on'
|
set -g @rose_pine_directory 'on'
|
||||||
set -g @rose_pine_disable_active_window_menu 'on'
|
set -g @rose_pine_disable_active_window_menu 'on'
|
||||||
|
|
||||||
|
set -g @plugin 'MunifTanjim/tmux-mode-indicator'
|
||||||
set -g @rose_pine_status_left_prepend_section '#{tmux_mode_indicator}'
|
set -g @rose_pine_status_left_prepend_section '#{tmux_mode_indicator}'
|
||||||
|
|
||||||
# bind F5 to theme switch
|
# bind F5 to theme switch
|
||||||
|
|||||||
Reference in New Issue
Block a user