Live Coding a Shell Script to Toggle Dark Mode for Terminal Tools

preview_player
Показать описание
Updating a few values in a few config files using a shell script, grep and perl.

Hit the subscribe button to receive more videos like this!

---

Timestamps:

0:00 What we'll be covering in this video
0:18 A personal note before we get started
1:15 Switching between dark and light themes should be easy
3:05 Creating a hello world script to get the ball rolling
5:12 Thinking about how this script is going to work
6:55 Figuring out if we're in dark or light mode using grep
8:54 Using perl to do a cross OS inline replace on multiple files
11:47 Refactoring hard coded config paths into variables
12:39 Changing the Microsoft terminal theme settings from the script
16:51 Switching around a few tmux colors programmatically
20:43 Figuring out how to source your tmux config from the script
22:51 Toggling fzf's theme colors
27:59 Accepting defeat on changing a parent's env variable from a child process
34:44 Reviewing the final script and doing a bit of refactoring
36:53 What you'll want to change to get this working on your end

Toggle dark mode script commit:

Reference links:

---

Follow along?

Рекомендации по теме
Комментарии
Автор

You had us in the first half, hahahaha. You are normally so straight-laced (pun not intended) that I didn't see that coming!!

johnanth
Автор

". toggle-dark-mode" should do the trick. In this case the parent (bash) process sources the environment variables changes from the toggle-dark-mode script into its own environment, otherwise the changes will be lost when the script exits.

svenr
Автор

Since you decided to get into personal story😄, then I'd like to ask how did you get so good in vim within a short period?

Gold_fi
Автор

Thanks for the live coding video, I like them! One thing which is disturbing me ... I didn't get the sense of this "personal note". Was it a joke or real talk? English is not my native language, I'm sorry.

nnutipa
welcome to shbcf.ru