Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # Get current time in HHMM format
- current_time=$(date +%H%M)
- # Win Terminal profile path
- wsl_path="/mnt/c/Users/marcos.souza/AppData/Local/Packages/Microsoft.WindowsTerminal_8wekyb3d8bbwe/LocalState/settings.json"
- # Define start and end times in HHMM format
- start_time=$(hdate -s -T -l s3 -L w38 --timezone -3 | tail -n 1 | awk -F ',' '{print $(NF-1)}' | tr -d ':')
- end_time=$(hdate -s -T -l s3 -L w38 --timezone -3 | tail -n 1 | awk -F ',' '{print $(NF)}' | tr -d ':')
- # Check if current time is between start and end times
- if [[ "$current_time" > "$start_time" && "$current_time" < "$end_time" ]]; then
- sed -i '/"defaults":/,/"list":/s/"Solarized Dark"/"Solarized Light"/' $wsl_path
- else
- sed -i '/"defaults":/,/"list":/s/"Solarized Light"/"Solarized Dark"/' $wsl_path
- fi
Advertisement
Add Comment
Please, Sign In to add comment