all repos — nixfiles @ d980b43c1d5ff78e9e3e3f05bad89ce23277d8d2

System and user configuration, managed by nix and home-manager

scripts/terminal/set-terminal-theme.applescript (view raw)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
global lightProfile, darkProfile

set lightProfile to "Flexoki Light"
set darkProfile to "Flexoki Dark"

to getTargetProfile()
	tell application "System Events"
		set isDark to dark mode of appearance preferences
	end tell
	if isDark then
		return darkProfile
	else
		return lightProfile
	end if
end getTargetProfile

to setTerminalProfile(targetProfile)
	tell application "Terminal"
		set default settings to settings set targetProfile
		set startup settings to settings set targetProfile

		repeat with existingWindow in windows
			set current settings of existingWindow to settings set targetProfile
		end repeat
	end tell
end setTerminalProfile

getTargetProfile()
setTerminalProfile(result)